Showing
6 changed files
with
16 additions
and
11 deletions
| @@ -8,7 +8,7 @@ prev='{{nextNum}}' | @@ -8,7 +8,7 @@ prev='{{nextNum}}' | ||
| 8 | next='{{next}}' | 8 | next='{{next}}' |
| 9 | speciallist="{{speciallist}}" | 9 | speciallist="{{speciallist}}" |
| 10 | closelaststyle="{{closelaststyle}}" | 10 | closelaststyle="{{closelaststyle}}" |
| 11 | -colored="#999999" | 11 | +colored="#e0e0e0" |
| 12 | circle_show="{{false}}" | 12 | circle_show="{{false}}" |
| 13 | weekheight="100" | 13 | weekheight="100" |
| 14 | txt_style="txt_style" | 14 | txt_style="txt_style" |
| @@ -15,6 +15,9 @@ Component({ | @@ -15,6 +15,9 @@ Component({ | ||
| 15 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') | 15 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') |
| 16 | } | 16 | } |
| 17 | }, | 17 | }, |
| 18 | + data:{ | ||
| 19 | + current:0 | ||
| 20 | + }, | ||
| 18 | attached(){ | 21 | attached(){ |
| 19 | 22 | ||
| 20 | }, | 23 | }, |
| @@ -73,7 +76,8 @@ Component({ | @@ -73,7 +76,8 @@ Component({ | ||
| 73 | }) | 76 | }) |
| 74 | this.setData({ | 77 | this.setData({ |
| 75 | durlist:duritem, | 78 | durlist:duritem, |
| 76 | - time:durlist.length>0 ? duritem[0].list[0].showdur : '' | 79 | + time:durlist.length>0 ? duritem[0].list[0].showdur : '', |
| 80 | + current:0 | ||
| 77 | }) | 81 | }) |
| 78 | this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'}) | 82 | this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'}) |
| 79 | }, | 83 | }, |
| 1 | -<swiper class="dur-list" display-multiple-items="1"> | 1 | +<swiper class="dur-list" display-multiple-items="1" current="{{current}}"> |
| 2 | <block wx:for="{{durlist}}" wx:key="{{index}}" wx:for-item="itemlist"> | 2 | <block wx:for="{{durlist}}" wx:key="{{index}}" wx:for-item="itemlist"> |
| 3 | <swiper-item> | 3 | <swiper-item> |
| 4 | <view class="flex-ll"> | 4 | <view class="flex-ll"> |
| @@ -8,17 +8,17 @@ Component({ | @@ -8,17 +8,17 @@ Component({ | ||
| 8 | } | 8 | } |
| 9 | }, | 9 | }, |
| 10 | data:{ | 10 | data:{ |
| 11 | - | 11 | + current:0 |
| 12 | }, | 12 | }, |
| 13 | attached(){ | 13 | attached(){ |
| 14 | let peoplelist=[] | 14 | let peoplelist=[] |
| 15 | - for(let i=0;i<Math.ceil((30-4)/5);i++){ | 15 | + for(let i=0;i<Math.ceil((30-4)/3);i++){ |
| 16 | peoplelist.push({ | 16 | peoplelist.push({ |
| 17 | list:[] | 17 | list:[] |
| 18 | }) | 18 | }) |
| 19 | } | 19 | } |
| 20 | for(let i=4;i<=30;i++){ | 20 | for(let i=4;i<=30;i++){ |
| 21 | - let thiscurrent=Math.floor((i-4)/5); | 21 | + let thiscurrent=Math.floor((i-4)/3); |
| 22 | peoplelist[thiscurrent]['list'].push({ | 22 | peoplelist[thiscurrent]['list'].push({ |
| 23 | count:i, | 23 | count:i, |
| 24 | isactive:false | 24 | isactive:false |
| @@ -28,7 +28,6 @@ Component({ | @@ -28,7 +28,6 @@ Component({ | ||
| 28 | this.setData({ | 28 | this.setData({ |
| 29 | peoplelist:peoplelist | 29 | peoplelist:peoplelist |
| 30 | }) | 30 | }) |
| 31 | - console.log(peoplelist) | ||
| 32 | }, | 31 | }, |
| 33 | ready(){ | 32 | ready(){ |
| 34 | this.editpeoplelist(this.data.count); | 33 | this.editpeoplelist(this.data.count); |
| @@ -37,6 +36,9 @@ Component({ | @@ -37,6 +36,9 @@ Component({ | ||
| 37 | methods:{ | 36 | methods:{ |
| 38 | selectpeople(e){ | 37 | selectpeople(e){ |
| 39 | const target=e.currentTarget.dataset; | 38 | const target=e.currentTarget.dataset; |
| 39 | + this.setData({ | ||
| 40 | + current:target.idx | ||
| 41 | + }) | ||
| 40 | this.editpeoplelist(target.count); | 42 | this.editpeoplelist(target.count); |
| 41 | this.triggerEvent('selectpeople',{people:target.count,action:'click'}); | 43 | this.triggerEvent('selectpeople',{people:target.count,action:'click'}); |
| 42 | }, | 44 | }, |
| 1 | -<swiper class="people-list" display-multiple-items="1" next-margin="46rpx"> | ||
| 2 | - <block wx:for="{{peoplelist}}" wx:key="{{index}}" wx:for-item="itemlist"> | 1 | +<swiper class="people-list" display-multiple-items="1" next-margin="315rpx" current="{{current}}"> |
| 2 | + <block wx:for="{{peoplelist}}" wx:key="{{index}}" wx:for-item="itemlist" wx:for-index="indexlist"> | ||
| 3 | <swiper-item> | 3 | <swiper-item> |
| 4 | <view class="flex-ll"> | 4 | <view class="flex-ll"> |
| 5 | <block wx:for="{{itemlist.list}}" wx:key="{{index}}"> | 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> | 6 | + <view class="people {{item.isactive ? 'white-font active' : 'black-font'}} font30r font-bold flex-cc" catchtap="selectpeople" data-count="{{item.count}}" data-idx="{{indexlist}}" style="margin-right:15rpx;">{{item.count}} 位</view> |
| 7 | </block> | 7 | </block> |
| 8 | </view> | 8 | </view> |
| 9 | </swiper-item> | 9 | </swiper-item> |
| @@ -8,7 +8,6 @@ | @@ -8,7 +8,6 @@ | ||
| 8 | .people{ | 8 | .people{ |
| 9 | width:120rpx; | 9 | width:120rpx; |
| 10 | height:100rpx; | 10 | height:100rpx; |
| 11 | - margin-left:30rpx; | ||
| 12 | } | 11 | } |
| 13 | .people.active{ | 12 | .people.active{ |
| 14 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ | 13 | background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ |
-
Please register or login to post a comment