This commit is contained in:
xiaozhiyong
2024-08-13 08:54:54 +08:00
parent 8943b412ea
commit cfcb6da1b5
6 changed files with 99 additions and 36 deletions

View File

@@ -179,7 +179,7 @@
</view>
</view>
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
<three-sites v-if="showThreeSites" @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
</view>
</template>
@@ -349,12 +349,13 @@
const openid = uni.getStorageSync('openid')
if (token && openid) {
this.getAuthInfo()
} else {
uni.showToast({
title: '您还没有登录哦',
icon: "none"
})
}
}
// else {
// uni.showToast({
// title: '您还没有登录哦',
// icon: "none"
// })
// }
this.refreshLocation()
},
@@ -412,6 +413,7 @@
type: 'wgs84',
success: (res) => {
uni.setStorageSync('location', res)
this.getSiteList()
},
fail: () => {
uni.getSetting({
@@ -423,30 +425,42 @@
confirmText: '去设置',
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({})
uni.openSetting({
complete:() => {
// this.getSiteList()
// this.realPosition()
// this.refreshLocation()
}
})
}
}
})
}else {
uni.showToast({
title:'获取定位失败,请稍后再试!',
icon:'none'
})
}
}
})
},
complete: () => {
this.getSiteList()
},
});
},
realPosition() {
uni.getLocation({
type: 'wgs84',
success: (res) => {
uni.setStorageSync('location', res)
},
complete: () => {
this.getSiteList()
},
// complete: () => {
// this.getSiteList()
// },
});
},
// realPosition() {
// uni.getLocation({
// type: 'wgs84',
// success: (res) => {
// uni.setStorageSync('location', res)
// this.getSiteList()
// },
// // complete: () => {
// // this.getSiteList()
// // },
// });
// },
hideModel(name) {
if (name == 'auth') {
this.showAuthFrror = false

View File

@@ -262,7 +262,7 @@
} else {
this.isFilterData=true
}
this.getSiteList()
// this.getSiteList()
},
onPullDownRefresh() {
@@ -363,17 +363,59 @@
onSelected(e) {
// console.log(e)
},
// refreshLocation() {
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// uni.setStorageSync('location', res)
// this.getSiteList()
// }
// });
// },
refreshLocation() {
uni.getLocation({
type: 'wgs84',
success: function(res) {
success: (res) => {
uni.setStorageSync('location', res)
}
this.getSiteList()
},
fail: () => {
uni.getSetting({
success: (res) => {
if (!res.authSetting['scope.userLocation']) {
uni.showModal({
title: '请您打开定位权限',
content: '用于获取您当前位置附近的油站',
confirmText: '去设置',
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({
complete:() => {
// this.getSiteList()
// this.realPosition()
this.refreshLocation()
}
})
}
}
})
}else {
uni.showToast({
title:'获取定位失败,请稍后再试!',
icon:'none'
})
}
}
})
},
// complete: () => {
// this.getSiteList()
// },
});
},
getSiteList() {
this.refreshLocation()
// this.refreshLocation()
let data1 = {
currentPage: this.currentPage,