Commit 8b46f905da6bf6c68af051d153d92dae0b10c0d7

Authored by wangfan
1 parent bebace5b

地理位置授权

... ... @@ -47,6 +47,7 @@ Page({
* 生命周期函数--监听页面加载
*/
hasOnLoad:false,
hasGetLocation:false,
onLoad: async function (options) {
this.hasOnLoad=true;
// this.qqmapsdk=new QQMapWX({
... ... @@ -89,7 +90,7 @@ Page({
this.getClassNameFlag=true;
//this.getPos();
if(this.data.hasSuggestion) return;
if(!this.hasOnLoad) return;
if(!this.hasOnLoad && this.hasGetLocation) return;
this.hasOnLoad=false;
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
... ... @@ -154,6 +155,7 @@ Page({
getPos(systemInfo){
this._getPos().then(res => {
console.log('wx.getLocation.then', res);
this.hasGetLocation=true;
let map = this.data.map;
map.latitude = res.latitude;
map.longitude = res.longitude;
... ... @@ -176,8 +178,11 @@ Page({
},
})
}).catch((e) => {
this.hasGetLocation=false;
console.log('wx.getLocation.catch', e);
if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) {
if ('getLocation:fail auth deny' == e.errMsg
|| 'getLocation:fail:auth denied' == e.errMsg
|| 'getLocation:fail authorize no response' == e.errMsg) {
this.selectComponent('#showModal').options({
header: '定位失败',
body: '需要地理位置授权'
... ... @@ -342,7 +347,7 @@ Page({
let map = this.mapData;
//console.log('getMarkers',map.region);
if(!this.hasInRegion()) {
console.log('FAIL:::',this.user,map)
//console.log('FAIL:::',this.user,map)
return setTimeout(()=>{
this.getMarkers();
},300)
... ...
... ... @@ -340,7 +340,7 @@
"id": 40,
"name": "邀请Ren pages/customer/index ",
"pathName": "pages/customer/detail_owner_invitation",
"query": "id=6158&fromid=test&hasInvitation=1&hasSellerShare=1",
"query": "id=6173&fromid=test&hasInvitation=1&hasSellerShare=1",
"scene": null
},
{
... ...