为了账号安全,请及时绑定邮箱和手机立即绑定

wx.getLocation无法正确执行回调,估计是作用域的原因

wx.getLocation无法正确执行回调,估计是作用域的原因

慕无忌1623718 2018-10-18 14:41:57
wx.getLocation({    type: 'wgs84',     success: function (res) {      alert("=======" + res.latitude);      coords.latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90      coords.longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。      alert("com here===" + coords.longitude);      getShopList();    },    cancel: function (res) {      getShopList();    },    fail: function (res) {      getShopList();    }  });      上面是我写的调用方法,能进success方法,并且执行了第一个alert,但是下面的不能执行了。我怀疑是js不识别coords和getShopList方法,这我都在外层定义的,我怀疑是作用域的问题。但是不知道怎么解决
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 3201 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号