收藏
回答

getLocation 成功了,但是对成功函数中返回的 res 的运用一个也不执行?

--------

已解决:是该手机没有开定位功能

--------


getLocation 失败,已确认授权。体验版,开发版;

在开发工具中是成功的,用的是同一个微信号,

system: iphone,ios 12.3.1,WeChat 7.0.8

getLocation() {

            wx.getLocation({
                type: 'gcj02',
                success: res => {
                    this.$util.setStor('location', res);
                    this.setData({
                        location: res
                    });
                    this.getMarkerList(res);
                    console.log('wx.getLocation:', res);
                    console.log('wx.getLocation success');
                },
                fail: err => {
                    console.log('wx.getLocation fail')//这个打印了
                },
                complete: () => {
                    console.log('wx.getLocation complete')
                    this.moveToLocation();
                }
            });
        },





最后一次编辑于  2019-11-04
回答关注问题邀请回答
收藏

2 个回答

  • 污昂ᰔᩚ王࿐
    污昂ᰔᩚ王࿐
    2019-10-31

    请求失败了肯定不执行啊

    2019-10-31
    有用 1
    回复 1
    • 符东伟
      符东伟
      2019-10-31
      谢谢,我粗心了
      2019-10-31
      回复
  • _人世间
    _人世间
    2019-10-31

    你确定你打印的那个输出,难道不是fail里边的?

    2019-10-31
    有用
    回复 1
    • 符东伟
      符东伟
      2019-10-31
      谢谢,我粗心了
      2019-10-31
      回复
登录 后发表内容
问题标签