Showing
5 changed files
with
11 additions
and
5 deletions
| @@ -63,7 +63,7 @@ Component({ | @@ -63,7 +63,7 @@ Component({ | ||
| 63 | ddate_solt:-1, | 63 | ddate_solt:-1, |
| 64 | timeDur:'0-0' | 64 | timeDur:'0-0' |
| 65 | }) | 65 | }) |
| 66 | - }; | 66 | + } |
| 67 | this.triggerEvent('event',{ | 67 | this.triggerEvent('event',{ |
| 68 | time:this.dur_list[this.dur_list_checked].time, | 68 | time:this.dur_list[this.dur_list_checked].time, |
| 69 | ddate_solt:parseInt(this.ddate_solt)+1, | 69 | ddate_solt:parseInt(this.ddate_solt)+1, |
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <view bindtap="calendarClose">{{ddate_solt==1?'午市':ddate_solt==2?'晚市':'早市'}}</view> | 13 | <view bindtap="calendarClose">{{ddate_solt==1?'午市':ddate_solt==2?'晚市':'早市'}}</view> |
| 14 | </view> | 14 | </view> |
| 15 | <view class="flex-ll" style="flex-wrap:wrap"> | 15 | <view class="flex-ll" style="flex-wrap:wrap"> |
| 16 | - <view class="time-item {{index==dur_list_checked?'checked':''}}" | 16 | + <view class="time-item {{index==dur_list_checked?'checked':''}} {{item.disabled?'disabled':''}}" |
| 17 | style="{{(index+1)%3==0?'margin-right:0;':''}}" | 17 | style="{{(index+1)%3==0?'margin-right:0;':''}}" |
| 18 | wx:for="{{dur_list}}" wx:key="listkey" | 18 | wx:for="{{dur_list}}" wx:key="listkey" |
| 19 | catchtap="bindTimePickerChange" | 19 | catchtap="bindTimePickerChange" |
| @@ -35,6 +35,11 @@ | @@ -35,6 +35,11 @@ | ||
| 35 | background-color: #199095; | 35 | background-color: #199095; |
| 36 | color:#fefefe; | 36 | color:#fefefe; |
| 37 | } | 37 | } |
| 38 | +.timePicker .time-item.disabled{ | ||
| 39 | + background-color:#999999; | ||
| 40 | + color: #efefef; | ||
| 41 | + border: 2rpx solid #999999; | ||
| 42 | +} | ||
| 38 | .timePicker .close{ | 43 | .timePicker .close{ |
| 39 | width: 50rpx; | 44 | width: 50rpx; |
| 40 | height: 50rpx; | 45 | height: 50rpx; |
| @@ -148,18 +148,19 @@ Component({ | @@ -148,18 +148,19 @@ Component({ | ||
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | - let dur,timeCheckedIndex=0,list=[]; | 151 | + let dur,timeCheckedIndex=this.type==2?-1:0,list=[]; |
| 152 | for(dur=parseInt(min);dur<=max;dur+=1800){ | 152 | for(dur=parseInt(min);dur<=max;dur+=1800){ |
| 153 | let t={ | 153 | let t={ |
| 154 | hasChecked:time<=dur, | 154 | hasChecked:time<=dur, |
| 155 | time:dur, | 155 | time:dur, |
| 156 | - disabled:this.dateIndex==0,//disabled 今天过期时间? | 156 | + disabled:this.dateIndex==0 && this.type==1 && time>dur,//disabled 今天过期时间? |
| 157 | } | 157 | } |
| 158 | list.push(t) | 158 | list.push(t) |
| 159 | if(dur<=time){ | 159 | if(dur<=time){ |
| 160 | timeCheckedIndex++ | 160 | timeCheckedIndex++ |
| 161 | } | 161 | } |
| 162 | } | 162 | } |
| 163 | + timeCheckedIndex=timeCheckedIndex>=list.length?list.length-1:timeCheckedIndex | ||
| 163 | console.log('add-time-dur.tindex',list,timeCheckedIndex) | 164 | console.log('add-time-dur.tindex',list,timeCheckedIndex) |
| 164 | return {list:list,listIndex:timeCheckedIndex} | 165 | return {list:list,listIndex:timeCheckedIndex} |
| 165 | }, | 166 | }, |
| @@ -569,7 +569,7 @@ | @@ -569,7 +569,7 @@ | ||
| 569 | "scene": null | 569 | "scene": null |
| 570 | }, | 570 | }, |
| 571 | { | 571 | { |
| 572 | - "id": -1, | 572 | + "id": 70, |
| 573 | "name": "无参数 pack-book/pages/book/b_addnew", | 573 | "name": "无参数 pack-book/pages/book/b_addnew", |
| 574 | "pathName": "pack-book/pages/book/b_addnew", | 574 | "pathName": "pack-book/pages/book/b_addnew", |
| 575 | "query": "", | 575 | "query": "", |
-
Please register or login to post a comment