Commit ec0783cd6ab614eafd8f17f8c1533e2f84fb767d

Authored by wangfan
1 parent 1cfa133e

c端预定

@@ -32,6 +32,7 @@ Page({ @@ -32,6 +32,7 @@ Page({
32 scrollIntoView:'', 32 scrollIntoView:'',
33 suggestion:{}, 33 suggestion:{},
34 hasSuggestion:false, 34 hasSuggestion:false,
  35 + current:0,
35 }, 36 },
36 transverseViewHeight:transverseViewHeight,//横向滚动高度,苹果要比安卓多20 37 transverseViewHeight:transverseViewHeight,//横向滚动高度,苹果要比安卓多20
37 //qqmapsdk:null, 38 //qqmapsdk:null,
@@ -267,7 +268,8 @@ Page({ @@ -267,7 +268,8 @@ Page({
267 console.log(e) 268 console.log(e)
268 let markers=this.data.markers; 269 let markers=this.data.markers;
269 let bl=1.2; 270 let bl=1.2;
270 - markers.forEach(m=>{ 271 + let current=0;
  272 + markers.forEach((m,i)=>{
271 m.iconPath=m.iconPath.replace('/cates-active/','/cates/') 273 m.iconPath=m.iconPath.replace('/cates-active/','/cates/')
272 m.zIndex=m.zIndexBak 274 m.zIndex=m.zIndexBak
273 if(m.width==20*bl){ 275 if(m.width==20*bl){
@@ -279,6 +281,7 @@ Page({ @@ -279,6 +281,7 @@ Page({
279 m.height=7; 281 m.height=7;
280 } 282 }
281 if(m.id==e.markerId){ 283 if(m.id==e.markerId){
  284 + current=i;
282 if(m.width==20){ 285 if(m.width==20){
283 m.width=20*bl; 286 m.width=20*bl;
284 m.height=25*bl; 287 m.height=25*bl;
@@ -295,6 +298,7 @@ Page({ @@ -295,6 +298,7 @@ Page({
295 }; 298 };
296 if(flag){ 299 if(flag){
297 obj.scrollIntoView='seller-'+e.markerId; 300 obj.scrollIntoView='seller-'+e.markerId;
  301 + obj.current=current
298 } 302 }
299 this.setData(obj) 303 this.setData(obj)
300 }, 304 },
@@ -469,6 +473,13 @@ Page({ @@ -469,6 +473,13 @@ Page({
469 setTimeout(function(){ 473 setTimeout(function(){
470 that.getClassNameFlag=true; 474 that.getClassNameFlag=true;
471 },300) 475 },300)
472 - 476 + },
  477 + bindtransition(e){
  478 + console.log(e.detail.current);
  479 + let i=e.detail.current
  480 + this.activeSellerID=this.sellers[i];
  481 + this.markertap({
  482 + markerId:this.sellers[i].id
  483 + },false)
473 }, 484 },
474 }) 485 })
@@ -46,6 +46,7 @@ @@ -46,6 +46,7 @@
46 </picker> 46 </picker>
47 </view> 47 </view>
48 <view class="transverse-list"> 48 <view class="transverse-list">
  49 + <!--
49 <scroll-view 50 <scroll-view
50 scroll-x 51 scroll-x
51 class="scroll-view_H" 52 class="scroll-view_H"
@@ -60,6 +61,20 @@ @@ -60,6 +61,20 @@
60 </view> 61 </view>
61 62
62 </scroll-view> 63 </scroll-view>
  64 + -->
  65 + <swiper
  66 + indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
  67 + interval="2000" duration="500"
  68 + previous-margin="{{20}}px" next-margin="{{20}}px"
  69 + current="{{current}}" bindchange="bindtransition">
  70 + <block wx:for="{{sellers}}" wx:key="*this">
  71 + <swiper-item>
  72 + <view class="seller" id="seller-{{item.id}}">
  73 + <sb-tr seller="{{item}}"></sb-tr>
  74 + </view>
  75 + </swiper-item>
  76 + </block>
  77 + </swiper>
63 </view> 78 </view>
64 </view> 79 </view>
65 </view> 80 </view>
@@ -56,10 +56,8 @@ @@ -56,10 +56,8 @@
56 width: 100%; 56 width: 100%;
57 } 57 }
58 .transverse-list .seller{ 58 .transverse-list .seller{
59 - margin: 16rpx 20rpx 0rpx;  
60 - box-sizing: content-box;  
61 - min-width: 710rpx;  
62 - width: 100%; 59 + width: 96%;
  60 + margin: 16rpx auto 0;
63 } 61 }
64 62
65 .picker{ 63 .picker{