Commit c9def95456fac00fb51c0260e1ea753ad6e3c439

Authored by wangfan
1 parent 641ab89c

reserve index

Showing 1 changed file with 11 additions and 4 deletions
@@ -98,10 +98,17 @@ Page({ @@ -98,10 +98,17 @@ Page({
98 //this.getMapPos(); 98 //this.getMapPos();
99 }).catch((e)=>{ 99 }).catch((e)=>{
100 console.log('wx.getLocation.catch',e); 100 console.log('wx.getLocation.catch',e);
101 - this.selectComponent('#showModal').options({  
102 - header:'定位失败',  
103 - body:'需要地理位置授权'  
104 - }).show(); 101 + if('getLocation:fail auth deny'==e.errMsg){
  102 + this.selectComponent('#showModal').options({
  103 + header:'定位失败',
  104 + body:'需要地理位置授权'
  105 + }).show();
  106 + }else{
  107 + setTimeout(()=>{
  108 + this.getPos()
  109 + },500)
  110 + }
  111 +
105 }) 112 })
106 }, 113 },
107 _getPos(){ 114 _getPos(){