fix:修复订单监控总会显示弹窗的bug(采用时间比较形式)
This commit is contained in:
+24
-2
@@ -414,9 +414,13 @@ function getUserLocation() {
|
||||
wx.getLocation({
|
||||
type: 'gcj02',
|
||||
success: (res) => {
|
||||
// 对经度和纬度进行四舍五入,保留小数点后五位
|
||||
const longitude = parseFloat(res.longitude.toFixed(5));
|
||||
const latitude = parseFloat(res.latitude.toFixed(5));
|
||||
|
||||
resolve({
|
||||
longitude: res.longitude,
|
||||
latitude: res.latitude
|
||||
longitude,
|
||||
latitude
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
@@ -426,6 +430,24 @@ function getUserLocation() {
|
||||
});
|
||||
});
|
||||
}
|
||||
//TODO : 修改getUserLocation函数,使其返回Promise(暂时弃用)
|
||||
// function getUserLocation() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// wx.getLocation({
|
||||
// type: 'gcj02',
|
||||
// success: (res) => {
|
||||
// resolve({
|
||||
// longitude: res.longitude,
|
||||
// latitude: res.latitude
|
||||
// });
|
||||
// },
|
||||
// fail: (error) => {
|
||||
// console.error('获取位置失败:', error);
|
||||
// reject(error);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
// 逆地理编码 - 根据经纬度获取地址信息
|
||||
function getRegeo(longitude, latitude) {
|
||||
|
||||
Reference in New Issue
Block a user