|
@@ -12,6 +12,8 @@ Page({ |
|
@@ -12,6 +12,8 @@ Page({ |
|
12
|
map:{},
|
12
|
map:{},
|
|
13
|
height:1000,
|
13
|
height:1000,
|
|
14
|
hasLoading:true,
|
14
|
hasLoading:true,
|
|
|
|
15
|
+ activeSellerID:'',//高亮商家
|
|
|
|
16
|
+ scrollSellerID:'',//滚动到商家
|
|
15
|
},
|
17
|
},
|
|
16
|
user:{},
|
18
|
user:{},
|
|
17
|
/**
|
19
|
/**
|
|
@@ -252,7 +254,7 @@ Page({ |
|
@@ -252,7 +254,7 @@ Page({ |
|
252
|
this.markertap({markerId:this.data.markers[0].id})
|
254
|
this.markertap({markerId:this.data.markers[0].id})
|
|
253
|
}
|
255
|
}
|
|
254
|
},
|
256
|
},
|
|
255
|
- markertap(e){
|
257
|
+ markertap(e,scrollTo=true){
|
|
256
|
if(!e.markerId || e.markerId=='local') return;
|
258
|
if(!e.markerId || e.markerId=='local') return;
|
|
257
|
let markers=this.data.markers
|
259
|
let markers=this.data.markers
|
|
258
|
this.activeSellerID = e.markerId
|
260
|
this.activeSellerID = e.markerId
|
|
@@ -284,6 +286,9 @@ Page({ |
|
@@ -284,6 +286,9 @@ Page({ |
|
284
|
markers: markers,
|
286
|
markers: markers,
|
|
285
|
activeSellerID:this.activeSellerID,
|
287
|
activeSellerID:this.activeSellerID,
|
|
286
|
};
|
288
|
};
|
|
|
|
289
|
+ if(scrollTo){
|
|
|
|
290
|
+ obj.scrollSellerID=this.activeSellerID
|
|
|
|
291
|
+ }
|
|
287
|
this.setData(obj)
|
292
|
this.setData(obj)
|
|
288
|
},
|
293
|
},
|
|
289
|
filterGroupData:{},
|
294
|
filterGroupData:{},
|
|
@@ -297,6 +302,25 @@ Page({ |
|
@@ -297,6 +302,25 @@ Page({ |
|
297
|
this.selectComponent('#as').show(e.detail.seller);
|
302
|
this.selectComponent('#as').show(e.detail.seller);
|
|
298
|
}
|
303
|
}
|
|
299
|
},
|
304
|
},
|
|
|
|
305
|
+ scrollEvent(e){
|
|
|
|
306
|
+ let idx=0
|
|
|
|
307
|
+ if(e.detail.scrollTop>20){
|
|
|
|
308
|
+ idx=parseInt(e.detail.scrollTop/162)
|
|
|
|
309
|
+ let ms=(e.detail.scrollTop%162)>100?1:0;
|
|
|
|
310
|
+ idx+=ms;
|
|
|
|
311
|
+ }
|
|
|
|
312
|
+ //console.log('scrollEvent',e,e.detail.scrollTop,idx)
|
|
|
|
313
|
+ //console.log('scrollEvent',this.sellers[idx].sellername)
|
|
|
|
314
|
+ this.debounce(()=>{
|
|
|
|
315
|
+ this.scrollEventActive(idx)
|
|
|
|
316
|
+ },300)
|
|
|
|
317
|
+ },
|
|
|
|
318
|
+ scrollEventActive(idx){
|
|
|
|
319
|
+ if(this.sellers[idx]){
|
|
|
|
320
|
+ //this.activeSellerID=this.sellers[idx].id
|
|
|
|
321
|
+ this.markertap({markerId:this.sellers[idx].id},false)
|
|
|
|
322
|
+ }
|
|
|
|
323
|
+ },
|
|
300
|
back:function() {
|
324
|
back:function() {
|
|
301
|
/*
|
325
|
/*
|
|
302
|
var mta = require('mta-wechat-analysis')
|
326
|
var mta = require('mta-wechat-analysis')
|