wx.authorize授權后再獲取地址信息報錯?

发布于 5 年前作者 ping1611601 次浏览最后编辑 5 年前来自 ask

wx.getSetting({

      success: res=>{

        if (res.authSetting['scope.userLocation']) {

          //用户已授权

          this.getLocation();

        } else{

          //用户未授权

          wx.authorize({

            scope: 'scope.userLocation',

            success: resSuc=>{

              this.getLocation();

            },

            fail: errSuc => {

              hud.hideLoading();

              wx.showModal({

                title: '提示',

                content: '请前往设置打开位置权限',

                success(reso) {

                  if(reso.confirm{

                    wx.openSetting({

                      success(resn) {

                      }

                    })

                  } else {

                  }

                }

              })

            }

          })

        }

      }

    })

getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF"

使用流量的情況,安卓系統

0 回复
暂无回复