- 发布:2024-07-19 17:18
- 更新:2024-07-20 06:57
- 阅读:88
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: macOS Monterey 12.6.1
HBuilderX类型: Alpha
HBuilderX版本号: 4.23
手机系统: 全部
手机厂商: 华为
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
操作步骤:
uni.chooseLocation({
success: (res) => {
if (type == 1) {
this.venue = res;
} else if (type == 2) {
this.startLocation = res;
} else if (type == 3) {
this.endLocation = res;
}
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log(this.venue,'venue');
console.log(this.startLocation,'startLocation');
console.log(this.endLocation,'endLocation');
},
fail:(err)=>{
console.log(err)
}
});
uni.chooseLocation({
success: (res) => {
if (type == 1) {
this.venue = res;
} else if (type == 2) {
this.startLocation = res;
} else if (type == 3) {
this.endLocation = res;
}
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log(this.venue,'venue');
console.log(this.startLocation,'startLocation');
console.log(this.endLocation,'endLocation');
},
fail:(err)=>{
console.log(err)
}
});
预期结果:
希望能像之前一样,获取当前定位,以及地址列表
希望能像之前一样,获取当前定位,以及地址列表
实际结果:
不正常
不正常
bug描述:
uni.chooseLocation不管用了,无法获取当 前定位,配置 的是高德地图,之前还好好的,今天突然发现不管用了,一直定位在天安门那,然后 hbuilld 里报错。
17:10:42.042 [JS Framework] Failed to execute the callback function:
TypeError: Cannot read property 'points' of undefined
17:10:42.083 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property 'points' of undefined
at (/__uniappchooselocation.js.nvue:1:28376)