wx.authorize授權后再獲取地址信息報錯?
发布于 4 年前 作者 ping16 11473 次浏览 来自 问答

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"

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

回到顶部