Commit 123b70da1fa7a42f82b1ccf947837f3ea377f704

Authored by wangfan
1 parent 01b86e20

fixbug 授权

@@ -142,7 +142,9 @@ Page({ @@ -142,7 +142,9 @@ Page({
142 this.GetCollectionSellerList(); 142 this.GetCollectionSellerList();
143 }).catch((e) => { 143 }).catch((e) => {
144 console.log('wx.getLocation.catch', e); 144 console.log('wx.getLocation.catch', e);
145 - if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) { 145 + if ('getLocation:fail auth deny' == e.errMsg
  146 + || 'getLocation:fail:auth denied' == e.errMsg
  147 + || 'getLocation:fail authorize no response' == e.errMsg) {
146 this.selectComponent('#showModal').options({ 148 this.selectComponent('#showModal').options({
147 header: '定位失败', 149 header: '定位失败',
148 body: '需要地理位置授权' 150 body: '需要地理位置授权'
@@ -176,4 +178,7 @@ Page({ @@ -176,4 +178,7 @@ Page({
176 url:'/pages/reserve/detail?id='+util.attr(e,'sid') 178 url:'/pages/reserve/detail?id='+util.attr(e,'sid')
177 }) 179 })
178 }, 180 },
  181 + showModal(e){
  182 + wx.openSetting()
  183 + },
179 }) 184 })
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "navigationBarTitleText":"一键订", 4 "navigationBarTitleText":"一键订",
5 "usingComponents": { 5 "usingComponents": {
6 "formids":"/components/formids/formids", 6 "formids":"/components/formids/formids",
  7 + "showModal":"/components/showModal/showModal",
7 "sb-tr":"/components/reserve/seller-box-transverse/seller-box", 8 "sb-tr":"/components/reserve/seller-box-transverse/seller-box",
8 "nav":"/components/nav/nav" 9 "nav":"/components/nav/nav"
9 } 10 }
@@ -13,3 +13,4 @@ @@ -13,3 +13,4 @@
13 <view class="seller flex-vc" wx:if="{{!hasMore}}">没有更多了</view> 13 <view class="seller flex-vc" wx:if="{{!hasMore}}">没有更多了</view>
14 </view> 14 </view>
15 </view> 15 </view>
  16 +<showModal id="showModal" confirmText="去授权" bindshowModal="showModal"></showModal>
@@ -318,12 +318,12 @@ Page({ @@ -318,12 +318,12 @@ Page({
318 }, 318 },
319 hasInRegionFlag:false, 319 hasInRegionFlag:false,
320 hasInRegion(){//定位是否在地图视野内 320 hasInRegion(){//定位是否在地图视野内
321 - if(this.hasInRegionFlag) return true;  
322 - if(!this.user.latitude) return false;//用户无定位  
323 - if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置  
324 let map = this.mapData; 321 let map = this.mapData;
325 if(!map.region.northeast.latitude || !map.region.northeast.longitude) return false;//未获得视野 322 if(!map.region.northeast.latitude || !map.region.northeast.longitude) return false;//未获得视野
326 if(!map.region.southwest.latitude || !map.region.southwest.longitude) return false;//未获得视野 323 if(!map.region.southwest.latitude || !map.region.southwest.longitude) return false;//未获得视野
  324 + if(this.hasInRegionFlag) return true;
  325 + if(!this.user.latitude) return false;//用户无定位
  326 + if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置
327 ///判断定位 首次 进入视野 327 ///判断定位 首次 进入视野
328 if(this.user.latitude>map.region.southwest.latitude 328 if(this.user.latitude>map.region.southwest.latitude
329 && this.user.longitude>map.region.southwest.longitude 329 && this.user.longitude>map.region.southwest.longitude