This commit is contained in:
曹辉 2023-04-17 10:39:33 +08:00
parent c4823f035c
commit 2701a974de

View File

@ -266,35 +266,35 @@
this.orderNo = this.itemlist.orderNo
},
onShow() {
// var that = this
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// that.list.serveLocationLatitude = res.latitude
// that.list.serveLocationLongitude = res.longitude
// uni.request({
// url: "https://apis.map.qq.com/ws/geocoder/v1/" + '?location=' + res.latitude +
// ',' +
// res.longitude + "&key=TXGBZ-VGEWW-LJHRR-3CDLI-N57YO-YQBHJ",
// method: 'GET',
// success: function(respone) {
// that.list.serviceLocationName = respone.data.result.address
// },
// fail(err) {}
// })
// },
// fail: error => {
// uni.showModal({
// title: '',
// content: '',
// success: (res) => {
// uni.openSetting({
// success(res) {}
// });
// }
// })
// }
// });
var that = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
that.list.serveLocationLatitude = res.latitude
that.list.serveLocationLongitude = res.longitude
uni.request({
url: "https://apis.map.qq.com/ws/geocoder/v1/" + '?location=' + res.latitude +
',' +
res.longitude + "&key=TXGBZ-VGEWW-LJHRR-3CDLI-N57YO-YQBHJ",
method: 'GET',
success: function(respone) {
that.list.serviceLocationName = respone.data.result.address
},
fail(err) {}
})
},
fail: error => {
uni.showModal({
title: '提示',
content: '获取定位失败,是否授权打开定位',
success: (res) => {
uni.openSetting({
success(res) {}
});
}
})
}
});
}
}
</script>