我创建的 普通快速启动模板
点击获取头像登录后跳转到地图页面
在地图页面onLoad里调用 wx.getLocation一直返回失败,以前是可以的 啊 ,最近改了?背景颜色。
onLoad: function () {
console.log("执行前" + this.data.latitude);
wx.getLocation({
type: 'wgs84',
success: function (res) {
this.setData({
latitude: res.latitude,
longitude: res.longitude,
})
console.log("获取成功")
},
complete: function (res) {
console.log("动作完成")
},
fail: function (res) {
console.log("失败")
},
})
console.log("执行hou" + this.data.latitude)
},

微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
微信小程序开发者回答:
S***:
求指教
S***:
本来是type: 'gcj02',
失败后换的 ,这个不是问题
开放平台全网发布检测有BUG
S***:
已解决,不知道什么时候拒绝获取位置了,释放下内存同意就行了
本文网址:http://www.91bianli.com/kaifazhinan/63959.html