Commit 208f0066eb40ed972ccfce372031ccd5f8f7491c

Authored by vking
1 parent ce94e9d8

fix 橱窗与地图数据不匹配

Showing 1 changed file with 29 additions and 3 deletions
... ... @@ -471,7 +471,7 @@ Page({
this.selectComponent('#list').getList(param);
this.param=param;
let now_sid=[];
App.Customer.SellerList(param).then(res => {
App.Customer.SellerList(param).then(async res => {
this.mapData.region.southwest.latitude='';
if (res.ret == 200) {
let sellersList=res.data;
... ... @@ -562,7 +562,7 @@ Page({
mk.display='';
}
})
obj.markers=this.setLocationMarker(obj.markers);
obj.markers=await this.setLocationMarker(obj.markers);
this.setData(obj)
if(now_sid.length>0) {
setTimeout(() => {
... ... @@ -710,7 +710,33 @@ Page({
}
ds.setA2LHeight(e.type=='hide'?0:40);
},
setLocationMarker(markers){
async setMapRegion(){
return new Promise((success,fail)=>{
if(this.mapCtx){
this.mapCtx.getRegion({
success:(res)=>{
if(res.southwest.latitude) {
this.mapData.region = res
success()
}
},
fail:()=>{
fail()
}
})
}else{
fail()
}
})
},
async setLocationMarker(markers){
try{
await this.setMapRegion();
}catch (e){
this.timeoutGetMarkers()
return []
}
let map = this.mapData;
let mks=[]
let matchPosNum=1
... ...