收藏
回答

调用jssdk返回不对

getAddress() {

getJsSdkUiPackageAsync().then(res => {

this.getLocation(res.Data)

})

},

getLocation(params) {

jweixin.config({

debug: true,

"appId": params.AppId,

"timestamp": params.Timestamp,

"nonceStr": params.NonceStr,

"signature": params.Signature,

jsApiList: ["getLocation"] //根据需要看需要哪些SDK的功能

});


jweixin.ready(function() {

jweixin.checkJsApi({

jsApiList: [

'getLocation'

],

success: function(res) {

if (res.checkResult.getLocation == false) {

alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');

return;

}

}

});

jweixin.error(function(res) {

console.log("接口调取失败")

});

// 获取位置

jweixin.getLocation({

type: 'wgs84',

success: function(res) {

console.log('jssdk获取的位置:', res.longitude, res.latitude)

_this.getList([res.longitude, res.latitude]) //通过经纬度去做需要的事情

},

cancel: function(res) {

alert('您已禁止获取位置信息')

}

});

});

},


返回是

Exception: 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)

回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2021-08-30

    你好,麻烦截图下回调信息和控制台获取config是否为false呢?

    2021-08-30
    有用
    回复 5
    • 周鑫
      周鑫
      2021-09-06
      您好config 是true        success 返回为  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-06
      回复
    • 周鑫
      周鑫
      2021-09-06
      2021-09-06
      回复
    • 社区技术运营专员--许涛
      社区技术运营专员--许涛
      2021-09-06回复周鑫
      调用方”、“被调用方”和“参数”属性不能在严格模式函数或用于调用它们的参数对象上访问
      请参考文档调用:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html
      2021-09-06
      回复
    • 丶雪悠
      丶雪悠
      2022-08-02回复周鑫
      请问解决了吗,是因为什么,我也报这样的错
      2022-08-02
      回复
    • 🔥
      🔥
      2023-12-26回复周鑫
      我也是,没法解决吗
      2023-12-26
      回复
  • 我想吃鱼了
    我想吃鱼了
    2023-04-10

    到底是啥问题啊,我也是

    2023-04-10
    有用
    回复
登录 后发表内容