wx.getLocation({
type: 'wgs84',
isHighAccuracy:true,
highAccuracyExpireTime:5000,
success: function (res) {
console.log(res,'getLocation返回的信息')
let latitude = res.latitude;
let longitude = res.longitude;
var speed = res.speed;
var accuracy = res.accuracy;
}).catch(err => {
console.log(err.response?.data?.error?.message || err.message);
showToast({
message: '打卡失败',
type: 'fail',
duration: 1000
});
});
},
cancel: function (res) {
alert("用户拒绝授权获取地理位置");
},
fail: function (res) {
console.error('获取位置失败', res);
showToast({
message: '获取位置失败,请检查定位权限',
type: 'fail',
duration: 2000
});
}
});

机型: 华为mate70Pro,系统 鸿蒙4.3,网络信号满格,位置权限正常开启,SDK正常配置,用户已授权,之前一直能正常调用wx.getLocation,
但从今天早上开始调用wx.getLocation一直显示getLocation:timeout。
微信版本为8.0.66