调整定位权限丢失小程序无法运行问题
This commit is contained in:
@@ -24,7 +24,7 @@ Page({
|
||||
this.setData({
|
||||
state: options.state
|
||||
})
|
||||
this.getLocation();
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -144,35 +144,6 @@ Page({
|
||||
isShowNewplot: true
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
// 活动当前坐标
|
||||
getLocation() {
|
||||
let that = this;
|
||||
wx.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(res) {
|
||||
latitude = res.latitude;
|
||||
longitude = res.longitude;
|
||||
that.getData()
|
||||
},
|
||||
fail: function(res) {
|
||||
if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') {
|
||||
that.setData({
|
||||
isShowAuth: true
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// 获取授权
|
||||
setAuthSuccess(e) {
|
||||
if (e.detail.authSetting['scope.userLocation']) {
|
||||
this.getLocation();
|
||||
this.setData({
|
||||
isShowAuth: false
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user