- 微信公众号页面使用JSSDK的wx.getLocation获取位置信息,偶发所有回调都不执行?
JsSDK版本:1.6.0 API名称:wx.getLocation 问题描述:在iOS16、iOS15中,将系统设置中的微信->位置设置为“下次询问或在共享时”,使用微信进入公众号网页,在弹出的定位授权提示框中选择不允许,wx.getLocation就挂了,包括success、fail、cancel、complete在内的所有回调都不执行,代码无法继续往下运行。 代码: wx.ready(() => { wx.getLocation({ type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' success: function (res) { console.log('授权成功', res) const latitude = res.latitude // 纬度,浮点数,范围为90 ~ -90 const longitude = res.longitude // 经度,浮点数,范围为180 ~ -180。 if (longitude && latitude) { localStorage.setItem(StorageKeysEnum.LNGLAT, `${longitude},${latitude}`) resolve() } else { Dialog.alert({ title: '定位失败!', message: '请在系统设置中打开微信定位权限', confirmButtonColor: '#3eba5c', }) reject() } }, fail: (e) => { console.log('获取定位失败:', e) Dialog.alert({ title: '定位失败!', message: '请在系统设置中打开微信定位权限', confirmButtonColor: '#3eba5c', }) reject() }, cancel: (res) => { console.log('取消授权', res) reject() }, complete: (res) => { console.log('授权完成:', res) }, }) })
2023-08-08 - getLocation:fail:timeout是什么原因?
微信公众号网页使用wx.getLocation获取定位,提示getLocation:fail:timeout,用户反映手机重启后就好了,但是过一段时间又会发生,是什么原因?
2024-11-11 - 小程序webview内嵌H5,H5用location.href跳转URLLink提示无法打开该页面?
小程序webview内嵌H5,H5使用location.href跳转微信URLLink,提示无法打开该页面,是什么原因导致的? [图片]
2024-03-05 - web-view嵌套h5页面,h5里面wx.config报错 invalid url domain?
[图片]
2024-01-03 - 如何在本地调试中调用wx.config接口?
wx.config({ debug: true, // 是否开启调试模式 appId: 'xxxxxxx', //appid nonceStr: 'yyyyyy', timestamp: '1721266366', url: 'http://192.168.1.15:5500/', signature: 'zzzzzz', jsApiList: [ 'updateAppMessageShareData', ] // 需要使用的JS接口列表 }) 代码如上 前端页面工作在http://192.168.1.15:5500/,并通过微信开发工具打开 出现有invalid url 及invalid signature两种问题 请问我应该如何设置url字段,以及如何在微信测试账号中设置白名单?(是否带http://?是否带端口号?)
2024-07-18 - uniapp vue h5项目,内嵌在别人家小程序里,项目引入的高德地图线上环境不显示?
uniapp vue h5项目,内嵌在别人家小程序里,项目引入的高德地图线上环境不显示 报错内容:GET <script> error: https://webapi.amap.com/maps? 哪位大佬给看看
2024-04-18