Commit f7602d2f5b064a5bb3d5fabf18b03722623e8f52

Authored by wangfan
1 parent dfb8438b

c端预定

... ... @@ -246,7 +246,7 @@ Page({
},
})
},
markertap(e){
markertap(e,flag=true){
console.log(e)
let markers=this.data.markers;
let bl=1.2;
... ... @@ -269,10 +269,13 @@ Page({
}
}
})
this.setData({
scrollIntoView:'seller-'+e.markerId,
let obj={
markers:markers,
})
};
if(flag){
obj.scrollIntoView='seller-'+e.markerId;
}
this.setData(obj)
},
async getMarkers(){
let cmap=this.data.map;
... ... @@ -414,4 +417,21 @@ Page({
map:map,
})
},
getClassNameFlag:true,
activeSellerID:'',
bindscroll(e){
if(!this.getClassNameFlag) return;
this.getClassNameFlag=false;
let w=e.detail.scrollWidth/this.sellers.length;
let i=Math.round(e.detail.scrollLeft/w);
console.log(e.detail,this.sellers,i);
if(this.activeSellerID!=this.sellers[i].id){
this.activeSellerID=this.sellers[i];
this.markertap({
markerId:this.sellers[i].id
},false)
}
this.getClassNameFlag=true;
},
})
\ No newline at end of file
... ...
... ... @@ -45,6 +45,7 @@
scroll-x
class="scroll-view_H"
scroll-into-view="{{scrollIntoView}}"
bindscroll="bindscroll"
>
<view class="flex-ll">
<view class="seller" wx:for="{{sellers}}" wx:key="{{sellers.key}}" id="seller-{{item.id}}">
... ...