Commit 4b64f30a699ab919f7b038d4447d1ed7009d35fc

Authored by vking
1 parent 25a2b9d0

new 2.0

... ... @@ -12,6 +12,8 @@ Page({
map:{},
height:1000,
hasLoading:true,
activeSellerID:'',//高亮商家
scrollSellerID:'',//滚动到商家
},
user:{},
/**
... ... @@ -252,7 +254,7 @@ Page({
this.markertap({markerId:this.data.markers[0].id})
}
},
markertap(e){
markertap(e,scrollTo=true){
if(!e.markerId || e.markerId=='local') return;
let markers=this.data.markers
this.activeSellerID = e.markerId
... ... @@ -284,6 +286,9 @@ Page({
markers: markers,
activeSellerID:this.activeSellerID,
};
if(scrollTo){
obj.scrollSellerID=this.activeSellerID
}
this.setData(obj)
},
filterGroupData:{},
... ... @@ -297,6 +302,25 @@ Page({
this.selectComponent('#as').show(e.detail.seller);
}
},
scrollEvent(e){
let idx=0
if(e.detail.scrollTop>20){
idx=parseInt(e.detail.scrollTop/162)
let ms=(e.detail.scrollTop%162)>100?1:0;
idx+=ms;
}
//console.log('scrollEvent',e,e.detail.scrollTop,idx)
//console.log('scrollEvent',this.sellers[idx].sellername)
this.debounce(()=>{
this.scrollEventActive(idx)
},300)
},
scrollEventActive(idx){
if(this.sellers[idx]){
//this.activeSellerID=this.sellers[idx].id
this.markertap({markerId:this.sellers[idx].id},false)
}
},
back:function() {
/*
var mta = require('mta-wechat-analysis')
... ...
... ... @@ -53,9 +53,10 @@
</block>
<block wx:else="">
<scroll-view class="view scroll-view" scroll-y="true"
scroll-into-view="seller-{{activeSellerID}}"
scroll-into-view="seller-{{scrollSellerID}}"
scroll-with-animation
bindscroll="scroll" style="width:100%;height: {{height-50}}px;">
bindscroll="scrollEvent"
style="width:100%;height: {{height-50}}px;">
<block wx:for="{{sellers}}" wx:key="sellers" >
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
<seller-card class="seller-card" id="seller-{{item.id}}"
... ...