Commit 123b70da1fa7a42f82b1ccf947837f3ea377f704

Authored by wangfan
1 parent 01b86e20

fixbug 授权

... ... @@ -142,7 +142,9 @@ Page({
this.GetCollectionSellerList();
}).catch((e) => {
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: '需要地理位置授权'
... ... @@ -176,4 +178,7 @@ Page({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
},
showModal(e){
wx.openSetting()
},
})
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTitleText":"一键订",
"usingComponents": {
"formids":"/components/formids/formids",
"showModal":"/components/showModal/showModal",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"nav":"/components/nav/nav"
}
... ...
... ... @@ -13,3 +13,4 @@
<view class="seller flex-vc" wx:if="{{!hasMore}}">没有更多了</view>
</view>
</view>
<showModal id="showModal" confirmText="去授权" bindshowModal="showModal"></showModal>
\ No newline at end of file
... ...
... ... @@ -318,12 +318,12 @@ Page({
},
hasInRegionFlag:false,
hasInRegion(){//定位是否在地图视野内
if(this.hasInRegionFlag) return true;
if(!this.user.latitude) return false;//用户无定位
if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置
let map = this.mapData;
if(!map.region.northeast.latitude || !map.region.northeast.longitude) return false;//未获得视野
if(!map.region.southwest.latitude || !map.region.southwest.longitude) return false;//未获得视野
if(this.hasInRegionFlag) return true;
if(!this.user.latitude) return false;//用户无定位
if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置
///判断定位 首次 进入视野
if(this.user.latitude>map.region.southwest.latitude
&& this.user.longitude>map.region.southwest.longitude
... ...