9***@qq.com
9***@qq.com
  • 发布:2021-09-07 10:23
  • 更新:2022-05-24 13:40
  • 阅读:455

关于微信jssdk在H5使用时碰到的问题求助大佬

分类:uni-app

getAddress() {
getJsSdkUiPackageAsync().then(res => {
if (res.Data.AppId) {
uni.setStorageSync('signature', res.Data)
this.getLocation(res.Data)
} else {
const signature = uni.getStorageSync('signature');
this.getLocation(signature)
console.log(signature)
}

            })  
        },  
        getLocation(signature) {  
            jweixin.config({  
                debug: true,  
                "appId": signature.AppId,  
                "timestamp": signature.Timestamp,  
                "nonceStr": signature.NonceStr,  
                "signature": signature.Signature,  
                jsApiList: ["getLocation", "checkJsApi"] //根据需要看需要哪些SDK的功能  
            })  
            jweixin.ready(function() {  
                jweixin.checkJsApi({  
                    jsApiList: [  
                        'getLocation'  
                    ],  
                    success: function(res) {  
                        if (res.checkResult.getLocation == false) {  
                            alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');  
                            return;  
                        }  
                    }  
                })  

                jweixin.getLocation({  
                    type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'  
                    success: function(res) {  
                        console.log(res)  
                    }  
                });  
            })  

        },  

返回为 :
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
at Function.remoteFunction (<anonymous>:2:14)

2021-09-07 10:23 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com (作者)

求助大神这个到底是我哪里写错了 还是说必须要到微信上运行才可以???

9***@qq.com

9***@qq.com (作者)

捞一下

m***@126.com

m***@126.com -

解决了吗

要回复问题请先登录注册