1***@qq.com
1***@qq.com
  • 发布:2025-11-10 16:50
  • 更新:2025-11-10 16:50
  • 阅读:22

【报Bug】使用chooseLocation报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 25H2

HBuilderX类型: 正式

HBuilderX版本号: 4.85

手机系统: Android

手机系统版本号: Android 13

手机厂商: 小米

手机机型: civi

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

使用
var that = this
uni.chooseLocation({
success: (res) => {
if (type == 0) {
that.formData.startAddress = res.name
that.formData.startLocation = res.latitude + "," + res.longitude
} else if (type == 1) {
that.formData.endAddress = res.name
that.formData.endLocation = res.latitude + "," + res.longitude
}
//that.mapChange()
}
})
报错
[JS Framework] Failed to execute the callback function:
TypeError: Cannot read property 'pageIndex' of null
16:46:06.600 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property 'pageIndex' of null
at (/__uniappchooselocation.js.nvue:32:16971)

操作步骤:

var that = this
uni.chooseLocation({
success: (res) => {
if (type == 0) {
that.formData.startAddress = res.name
that.formData.startLocation = res.latitude + "," + res.longitude
} else if (type == 1) {
that.formData.endAddress = res.name
that.formData.endLocation = res.latitude + "," + res.longitude
}
//that.mapChange()
}
})

预期结果:

返回选择地址信息

实际结果:

[JS Framework] Failed to execute the callback function:
TypeError: Cannot read property 'pageIndex' of null
16:46:06.600 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property 'pageIndex' of null
at (/__uniappchooselocation.js.nvue:32:16971)

bug描述:

使用chooseLocation报错

2025-11-10 16:50 负责人:无 分享
已邀请:

要回复问题请先登录注册