/* 获取真实设备的gps位置 /
const getRealDeviceLocation = async () => {
uni.getLocation({
type: 'wgs84',
success(res) {
const { latitude, longitude } = res;
console.log(res);
// self.decodeLocation(latitude, longitude);
},
fail(err) {
console.error(err);
}
});
};
onMounted(() => {
getRealDeviceLocation();
});
请教诸位大能,现在出现的问题是再编译到微信小程序之后获取不到,控制台也没有任何提示,然后再manifest.json中我已经给微信小程序权限配置开启了位置接口,描述也写上了"您的地理位置将用于小程序打卡功能"
鼠鼠闯世界 (作者)
好的,我这边尝试后发现可以,可能是因为调用时机问题导致的
2026-01-28 11:07