提交修改
This commit is contained in:
+37
-6
@@ -83,6 +83,11 @@ export default {
|
||||
// this.syncTabbar()
|
||||
},
|
||||
methods: {
|
||||
goto(item){
|
||||
uni.navigateTo({
|
||||
url: '/pages/square/detiles?id='+item.id
|
||||
});
|
||||
},
|
||||
getFuzzy() {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.getSetting({
|
||||
@@ -114,12 +119,38 @@ export default {
|
||||
uni.makePhoneCall({ phoneNumber: num });
|
||||
},
|
||||
changeTab(key) {
|
||||
if (this.currentTab === key) return
|
||||
this.currentTab = key
|
||||
this.page = 1
|
||||
this.hasMore = true
|
||||
this.slist = []
|
||||
this.loadList()
|
||||
if((this.longitude==''||this.latitude=='')&&key=='near'){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先授权地理位!',
|
||||
content: '请在设置中开启模糊定位权限',
|
||||
confirmText: '去设置',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
wx.openSetting({
|
||||
success: (setRes) => {
|
||||
if (setRes.authSetting['scope.userFuzzyLocation']) {
|
||||
that.getFuzzy().then(res => {
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
console.log(res);
|
||||
}).catch(err => console.error(err));
|
||||
} else {
|
||||
reject(new Error('未开启模糊定位权限'));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.currentTab === key) return
|
||||
this.currentTab = key
|
||||
this.page = 1
|
||||
this.hasMore = true
|
||||
this.slist = []
|
||||
this.loadList()
|
||||
},
|
||||
loadList(isLoadMore = false) {
|
||||
if (isLoadMore) {
|
||||
|
||||
Reference in New Issue
Block a user