Showing
7 changed files
with
51 additions
and
22 deletions
| @@ -61,9 +61,19 @@ Component({ | @@ -61,9 +61,19 @@ Component({ | ||
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | + let duritem=[]; | ||
| 65 | + for(let i=0;i<Math.ceil((durlist.length)/5);i++){ | ||
| 66 | + duritem.push({ | ||
| 67 | + list:[] | ||
| 68 | + }) | ||
| 69 | + } | ||
| 70 | + durlist.forEach((v,i)=>{ | ||
| 71 | + let thiscurrent=Math.floor(i/5); | ||
| 72 | + duritem[thiscurrent].list.push(v) | ||
| 73 | + }) | ||
| 64 | this.setData({ | 74 | this.setData({ |
| 65 | - durlist:durlist, | ||
| 66 | - time:durlist.length>0 ? durlist[0].showdur : '' | 75 | + durlist:duritem, |
| 76 | + time:durlist.length>0 ? duritem[0].list[0].showdur : '' | ||
| 67 | }) | 77 | }) |
| 68 | this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'}) | 78 | this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'}) |
| 69 | }, | 79 | }, |
| 1 | -<swiper class="dur-list" display-multiple-items="5"> | ||
| 2 | - <block wx:for="{{durlist}}" wx:key="{{index}}"> | 1 | +<swiper class="dur-list" display-multiple-items="1"> |
| 2 | + <block wx:for="{{durlist}}" wx:key="{{index}}" wx:for-item="itemlist"> | ||
| 3 | <swiper-item> | 3 | <swiper-item> |
| 4 | - <view class="white-font font30r font-bold flex-cc dur-timer" data-time="{{item.showdur}}" catchtap="selecttime">{{item.showdur}}</view> | 4 | + <view class="flex-ll"> |
| 5 | + <block wx:for="{{itemlist.list}}" wx:key="{{index}}"> | ||
| 6 | + <view class="white-font font30r font-bold flex-cc dur-timer" data-time="{{item.showdur}}" catchtap="selecttime">{{item.showdur}}</view> | ||
| 7 | + </block> | ||
| 8 | + </view> | ||
| 5 | </swiper-item> | 9 | </swiper-item> |
| 6 | </block> | 10 | </block> |
| 7 | </swiper> | 11 | </swiper> |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | } | 5 | } |
| 6 | .dur-timer{ | 6 | .dur-timer{ |
| 7 | width:120rpx; | 7 | width:120rpx; |
| 8 | - height:100%; | 8 | + height:100rpx; |
| 9 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ | 9 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ |
| 10 | background: -o-linear-gradient(-45deg, #F2D190, #C0A369); /* Opera 11.1 - 12.0 */ | 10 | background: -o-linear-gradient(-45deg, #F2D190, #C0A369); /* Opera 11.1 - 12.0 */ |
| 11 | background: -moz-linear-gradient(top, #F2D190, #C0A369); /* Firefox 3.6 - 15 */ | 11 | background: -moz-linear-gradient(top, #F2D190, #C0A369); /* Firefox 3.6 - 15 */ |
| @@ -12,11 +12,18 @@ Component({ | @@ -12,11 +12,18 @@ Component({ | ||
| 12 | }, | 12 | }, |
| 13 | attached(){ | 13 | attached(){ |
| 14 | let peoplelist=[] | 14 | let peoplelist=[] |
| 15 | - for(let i=4;i<=30;i++){ | 15 | + for(let i=0;i<=Math.ceil((30-4)/5);i++){ |
| 16 | peoplelist.push({ | 16 | peoplelist.push({ |
| 17 | + list:[] | ||
| 18 | + }) | ||
| 19 | + } | ||
| 20 | + for(let i=4;i<=30;i++){ | ||
| 21 | + let thiscurrent=Math.floor((i-4)/5); | ||
| 22 | + peoplelist[thiscurrent]['list'].push({ | ||
| 17 | count:i, | 23 | count:i, |
| 18 | isactive:false | 24 | isactive:false |
| 19 | }) | 25 | }) |
| 26 | + | ||
| 20 | } | 27 | } |
| 21 | this.setData({ | 28 | this.setData({ |
| 22 | peoplelist:peoplelist | 29 | peoplelist:peoplelist |
| @@ -34,16 +41,19 @@ Component({ | @@ -34,16 +41,19 @@ Component({ | ||
| 34 | }, | 41 | }, |
| 35 | editpeoplelist(count){ | 42 | editpeoplelist(count){ |
| 36 | let peoplelist=this.data.peoplelist,setdata={}; | 43 | let peoplelist=this.data.peoplelist,setdata={}; |
| 37 | - peoplelist.forEach((v,i)=>{ | ||
| 38 | - if(v.isactive){ | ||
| 39 | - v.isactive=false; | ||
| 40 | - let setprevkey='peoplelist['+i+'].isactive'; | ||
| 41 | - setdata[setprevkey]=false; | ||
| 42 | - } | ||
| 43 | - if(v.count==count && !v.isactive){ | ||
| 44 | - let setcurrentkey='peoplelist['+i+'].isactive'; | ||
| 45 | - setdata[setcurrentkey]=true; | ||
| 46 | - } | 44 | + peoplelist.forEach((r,n)=>{ |
| 45 | + r.list.forEach((v,i)=>{ | ||
| 46 | + if(v.isactive){ | ||
| 47 | + v.isactive=false; | ||
| 48 | + let setprevkey='peoplelist['+n+'].list['+i+'].isactive'; | ||
| 49 | + setdata[setprevkey]=false; | ||
| 50 | + } | ||
| 51 | + if(v.count==count && !v.isactive){ | ||
| 52 | + let setcurrentkey='peoplelist['+n+'].list['+i+'].isactive'; | ||
| 53 | + setdata[setcurrentkey]=true; | ||
| 54 | + } | ||
| 55 | + }) | ||
| 56 | + | ||
| 47 | }) | 57 | }) |
| 48 | this.setData(setdata) | 58 | this.setData(setdata) |
| 49 | } | 59 | } |
| 1 | -<swiper class="people-list" display-multiple-items="5" next-margin="46rpx"> | ||
| 2 | - <block wx:for="{{peoplelist}}" wx:key="{{index}}"> | 1 | +<swiper class="people-list" display-multiple-items="1" next-margin="46rpx" circular="{{true}}"> |
| 2 | + <block wx:for="{{peoplelist}}" wx:key="{{index}}" wx:for-item="itemlist"> | ||
| 3 | <swiper-item> | 3 | <swiper-item> |
| 4 | - <view class="people {{item.isactive ? 'white-font active' : 'black-font'}} font30r font-bold flex-cc" catchtap="selectpeople" data-count="{{item.count}}">{{item.count}} 位</view> | 4 | + <view class="flex-ll"> |
| 5 | + <block wx:for="{{itemlist.list}}" wx:key="{{index}}"> | ||
| 6 | + <view class="people {{item.isactive ? 'white-font active' : 'black-font'}} font30r font-bold flex-cc" catchtap="selectpeople" data-count="{{item.count}}" style="margin-left:{{index==0 ? 0 : 18}}rpx;">{{item.count}} 位</view> | ||
| 7 | + </block> | ||
| 8 | + </view> | ||
| 5 | </swiper-item> | 9 | </swiper-item> |
| 6 | </block> | 10 | </block> |
| 7 | </swiper> | 11 | </swiper> |
| @@ -7,7 +7,8 @@ | @@ -7,7 +7,8 @@ | ||
| 7 | } | 7 | } |
| 8 | .people{ | 8 | .people{ |
| 9 | width:120rpx; | 9 | width:120rpx; |
| 10 | - height:100%; | 10 | + height:100rpx; |
| 11 | + margin-left:30rpx; | ||
| 11 | } | 12 | } |
| 12 | .people.active{ | 13 | .people.active{ |
| 13 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ | 14 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ |
| @@ -509,7 +509,7 @@ | @@ -509,7 +509,7 @@ | ||
| 509 | padding-bottom: 120rpx; | 509 | padding-bottom: 120rpx; |
| 510 | } | 510 | } |
| 511 | .reserve-time{ | 511 | .reserve-time{ |
| 512 | - padding: 82rpx 0 38rpx 30rpx; | 512 | + padding: 60rpx 0 38rpx 30rpx; |
| 513 | font-size: 32rpx; | 513 | font-size: 32rpx; |
| 514 | } | 514 | } |
| 515 | .hasFullHouse{ | 515 | .hasFullHouse{ |
-
Please register or login to post a comment