//预约到店 获取当前经纬度
getLocation() {
const that = this;
uni.authorize({
scope: 'scope.userLocation',
geocode: true,
success() { // 允许授权
// that.getLocationInfo();
uni.getLocation({ //获取经纬度信息
type: 'wgs84',
success(res) {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
}
});
},
fail() { // 拒绝授权
// that.openConfirm();
console.log("你拒绝了授权,无法获得周边信息")
}
})
},
微信小程序获取当前经纬度
于 2021-11-29 19:19:55 首次发布