Commit b883a5ce187505635f6548de7a9cff7a6c001443

Authored by wangfan
1 parent d3581c01

C端调整

... ... @@ -22,6 +22,21 @@ Component({
this.triggerEvent("pos",res);
}).catch((e) => {
console.log('wx.getLocation.catch', e);
if(e.errCode==2){//定位失败
wx.showModal({
title:'定位失败',
content:'请开启位置服务',
showCancel:false,
success:()=>{
console.log('wx.showModal::success,给默认坐标');
this.triggerEvent("pos",{
latitude: 39.636911,
longitude: 118.150591,
});
},
})
return;
}
if ('getLocation:fail auth deny' == e.errMsg
|| 'getLocation:fail:auth denied' == e.errMsg
|| 'getLocation:fail authorize no response' == e.errMsg) {
... ...
... ... @@ -16,6 +16,8 @@ const renNum=function(){
}
const cates_version='?1.1';
const hasSellerConcat=true;//变量存储所有商户
const def_latitude=39.63691;
const def_longitude=118.15059;
Page({
/**
... ... @@ -23,8 +25,8 @@ Page({
*/
data: {
map: {
latitude: 23.099994,
longitude: 113.324520,
latitude: def_latitude,
longitude: def_longitude,
scale: mapScale,
height: 300,
},
... ... @@ -49,8 +51,8 @@ Page({
sellersNow:[],//本次视图内商户
searchAddrTop:50,
user:{
latitude: 23.099994,
longitude: 113.324520,
latitude: def_latitude,
longitude: def_longitude,
},
/**
* 生命周期函数--监听页面加载
... ... @@ -332,7 +334,7 @@ Page({
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==def_latitude && this.user.longitude==def_longitude) return false;//默认位置
///判断定位 首次 进入视野
if((this.user.latitude>map.region.southwest.latitude
&& this.user.longitude>map.region.southwest.longitude
... ...