getLocation:fail:timeout
发布于 6 年前 作者 xiuyingchang 12260 次浏览 来自 问答

手机是360 N6 pro 型号 1801-A01

手机定位开了,微信也授权了

wx.getLocation一直在走fail报

//代码 -----------------------

<button class="userinfo-btn" plain="{{true}}" open-type="openSetting" bindopensetting="handler">授权获取地理位置</button>


//.js

//地理位置授权

handler: function (e) {

    var _this=this;

    console.log(e.detail.authSetting["scope.userLocation"])

    if (e.detail.authSetting["scope.userLocation"]) {

        wx.getLocation({

            type'gcj02',

            success: res => {

                console.log(res)

                app.globalData.userLocation.latitude = res.latitude;

                app.globalData.userLocation.longitude = res.longitude;

                _this.getProductList(_this.data.page)

            }, fail: err => {

                console.log(err)

            }, complete:ree=>{

                console.log(ree)

            }

        })

    }

}

4 回复
  1. 大概率和环境有关,确认下微信发送位置是否正常or其他定位app是否正常;

  2. 检查下位置服务是否开启;

  3. 我->设置->帮助与反馈->右上角上传日志,并提供微信号与时间点哈。

    ---

    确认上述两点还有问题请给下日志吧

我这边是公众号h5开发,也用到了getLocation方法,有不少安卓手机反映定位开了,但是getLocation失败了,失败信息:timeout;

有没有什么解决的办法?

请问你的这个问题处理好了吗

回到顶部