小米8,定位问题
发布于 5 年前 作者 yong73 699 次浏览 来自 问答
  • 小米8 wx.getLocation  使用流量 报错 getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF,wifi正常

onLoad: function () {

this.getCityId();

},

getCityId: function () {

console.log(‘获取经纬度’);

var that = this;

//通过原生方法获取坐标

wx.getLocation({

success: function (res) {

that.setData({

show: res.latitude,

})

console.log(‘坐标’, res)

var latitude = res.latitude

var longitude = res.longitude

},

fail: function (e) {

console.log(‘错误’, e);

that.setData({

show:e.errMsg,

});

}

})

回到顶部