小程序点击进入设置没有位置信息?
发布于 5 年前 作者 juan90 8949 次浏览 来自 问答

使用uniapp配置的"permission" : {

            “scope.userLocation” : {

                “desc” : “商城定位”

            }

        },

但是进去设置里显示xxx未使用你的任何信息

1 回复

需要用户授权的。

wx.getSetting({
  success(res) {
    if (!res.authSetting['scope.userLocation']) {
      wx.authorize({
        scope: 'scope.userLocation',
        success () {
          wx.getLocation()
        }
      })
    }
  }
})
回到顶部