wx.openLocation打不开微信内置地图?也没有任何报错?
发布于 6 年前 作者 machao 2113 次浏览 来自 官方Issues

wx.checkJsApi返回success,就是没有跳转到内置地图,也没有任何抛错

wx.checkJsApi({
                debug: true,
                appId: data.appId,
                timestamp: data.timestamp,
                nonceStr: data.nonceStr,
                signature: data.signature,
                jsApiList: ['openLocation'],
                fail () {
                    Toast.error('设备不支持');
                },
                success: () => {
                    const { name = '客户', address = '客户地址未知' } = this.store;
                    Toast.success(`${longitude},${latitude},${name},${address}`)

                    wx.openLocation({
                        latitude: +latitude, 
                        longitude: +longitude,
                        name,
                        address,
                        scale: 16, 
                        infoUrl: ''
                    });
                }
            });
1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部