邓洁 : 定位框只显示确认按钮
This commit is contained in:
@@ -1,27 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="tabs-bg" />
|
<view class="tabs-bg"></view>
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
<view class="title-view" v-for="(item, index) in title" :key="item" @click="changeActiveIndex(index)"
|
<view class="title-view" v-for="(item, index) in title" :key="item" @click="changeActiveIndex(index)"
|
||||||
:class="{isActive: activeIndex === index}">
|
:class="{isActive: activeIndex === index}">
|
||||||
<text>{{item}}</text>
|
<text>{{item}}</text>
|
||||||
<view class="arrow" v-if="activeIndex !== index">
|
<view class="arrow" v-if="activeIndex !== index">
|
||||||
<u-image src="/static/dropdown/dp_icon_lxia.png" width="14rpx" height="11rpx" />
|
<u-image src="/static/dropdown/dp_icon_lxia.png" width="14rpx" height="11rpx"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="arrow" v-if="activeIndex === index">
|
<view class="arrow" v-if="activeIndex === index">
|
||||||
<u-image src="/static/dropdown/dp_icon_hlxia.png" width="14rpx" height="11rpx" />
|
<u-image src="/static/dropdown/dp_icon_hlxia.png" width="14rpx" height="11rpx"></u-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-border">
|
<view class="item-border">
|
||||||
<DropDownItem
|
<DropDownItem v-if="activeIndex !== -1" :list="tablist" @cancelDrop="cancelDrop" @getQueryInfo="getQueryInfo"
|
||||||
v-if="activeIndex !== -1"
|
:type="title[activeIndex]" />
|
||||||
:list="tablist"
|
|
||||||
@cancelDrop="cancelDrop"
|
|
||||||
@getQueryInfo="getQueryInfo"
|
|
||||||
:type="title[activeIndex]"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -60,9 +55,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.postlist[0]=JSON.parse(uni.getStorageSync('classList'))
|
this.postlist[0] = JSON.parse(uni.getStorageSync('classList'))
|
||||||
// this.postlist[0].unshift('全部')
|
// this.postlist[0].unshift('全部')
|
||||||
this.postlist[1]=JSON.parse(uni.getStorageSync('regionList'))
|
this.postlist[1] = JSON.parse(uni.getStorageSync('regionList'))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeActiveIndex(index) {
|
changeActiveIndex(index) {
|
||||||
|
|||||||
@@ -46,14 +46,13 @@
|
|||||||
options: {
|
options: {
|
||||||
styleIsolation: 'shared', // 解除样式隔离
|
styleIsolation: 'shared', // 解除样式隔离
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
//点击轮播图
|
//点击轮播图
|
||||||
handleSwiperList(currentNum, bannerURL) {
|
handleSwiperList(currentNum, bannerURL) {
|
||||||
const item=bannerURL[currentNum]
|
const item = bannerURL[currentNum]
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.link+`?id=${item.param}&type=${item.type}`
|
url: item.link + `?id=${item.param}&type=${item.type}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,32 @@
|
|||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log("获取经纬度失败", err);
|
console.log("获取经纬度失败", err);
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -189,20 +215,77 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.authSetting['scope.userFuzzyLocation']) {
|
if (res.authSetting['scope.userFuzzyLocation']) {
|
||||||
console.log('用户已经授权定位权限');
|
console.log('用户已经授权定位权限');
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// that.getUserLocation()
|
||||||
} else {
|
} else {
|
||||||
console.log('用户未授权定位权限');
|
console.log('用户未授权定位权限');
|
||||||
uni.authorize({
|
uni.authorize({
|
||||||
scope: 'scope.userFuzzyLocation',
|
scope: 'scope.userFuzzyLocation',
|
||||||
success: function() {
|
success: function() {
|
||||||
console.log('授权成功');
|
console.log('授权成功');
|
||||||
that.getUserLocation()
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '请确保手机系统定位已开启',
|
||||||
|
// icon: 'none',
|
||||||
|
// duration: 2000,
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
fail: function() {
|
fail: function() {
|
||||||
console.log('授权失败');
|
console.log('授权失败');
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: '检测到您没打开获取信息功能权限,是否去设置打开?',
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
confirmText: "确认",
|
confirmText: "确认",
|
||||||
cancelText: '取消',
|
showCancel: false,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.openSetting({
|
uni.openSetting({
|
||||||
|
|||||||
Reference in New Issue
Block a user