收藏
回答

定位 用户拒绝获取定位后有没有什么方法调起来?

定位 用户拒绝获取定位后有没有什么方法调起来?

定位 用户拒绝获取定位后有没有什么方法调起来?

定位 用户拒绝获取定位后有没有什么方法调起来?

uni.getLocation()

回答关注问题邀请回答
收藏

2 个回答

  • 缪伟光(新塍)
    缪伟光(新塍)
    2021-09-16

      gohome() {

        // map是id

        var that=this

        const mpCtx = wx.createMapContext("map");

        wx.getSetting({

          success(res) {

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

              wx.authorize({

                scope: 'scope.userLocation',

                success () {

                  mpCtx.moveToLocation();

                  that.getmygcj02()

                },

                fail () {

                  wx.openSetting({

                    success (res) {

                      mpCtx.moveToLocation();

                //      that.getmygcj02()

                    }

                  })

                },

              })

            }

            else

            { mpCtx.moveToLocation();

       //       that.getmygcj02()}

          }

        })

    试试看吧,我的源码

    2021-09-16
    有用
    回复
  • 🌞
    🌞
    2021-09-16

    使用 wx.openSetting打开设置页,手动选择打开。

    2021-09-16
    有用
    回复
登录 后发表内容