|
|
|
|
@ -80,16 +80,22 @@
|
|
|
|
|
|
|
|
|
|
<view class="book-box-timerow">
|
|
|
|
|
<view class="book-box-row-timeitem" v-for="(item,index) in currentDate.rules"
|
|
|
|
|
:class="{'book-box-row-timeitem-on':item.checked,'timeitem-none':item.remain_count==0}"
|
|
|
|
|
:class="{'book-box-row-timeitem-on':item.checked,'timeitem-none':item.remain_count==0,'timeitem-none':item.isCanbook==false}"
|
|
|
|
|
:key="index" @click="handleSelectTime(index)">
|
|
|
|
|
<view class="book-box-row-timeitem-status" v-if="item.checked">
|
|
|
|
|
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
|
|
|
|
|
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0">
|
|
|
|
|
{{item.remain_count}}张
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-box-row-timeitem-txt" v-else>售罄</view>
|
|
|
|
|
|
|
|
|
|
<block v-if="item.isCanbook">
|
|
|
|
|
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0">
|
|
|
|
|
{{item.remain_count}}张
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-box-row-timeitem-txt" v-else>售罄</view>
|
|
|
|
|
</block>
|
|
|
|
|
<block v-else>
|
|
|
|
|
<view class="book-box-row-timeitem-txt" >不可预约</view>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -274,14 +280,17 @@
|
|
|
|
|
}
|
|
|
|
|
cdate.checked = true;
|
|
|
|
|
|
|
|
|
|
this.loadDefaultTime(cdate.rules);
|
|
|
|
|
|
|
|
|
|
this.currentDate = cdate;
|
|
|
|
|
this.loadDefaultTime(cdate.rules);
|
|
|
|
|
this.listDatePrice = list;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
handleSelectTime(index) {
|
|
|
|
|
var mod = this.currentDate.rules[index];
|
|
|
|
|
var mod = this.currentDate.rules[index];
|
|
|
|
|
if (!mod.isCanbook) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (mod.remain_count == 0) {
|
|
|
|
|
this.util.toast("该时段已售罄");
|
|
|
|
|
return false
|
|
|
|
|
@ -452,12 +461,15 @@
|
|
|
|
|
},
|
|
|
|
|
loadDefaultTime(rules) {
|
|
|
|
|
var that = this;
|
|
|
|
|
var nt = new Date();
|
|
|
|
|
that.currentTime = {};
|
|
|
|
|
let isDefault = false;
|
|
|
|
|
for (var mod of rules) {
|
|
|
|
|
mod.checked = false;
|
|
|
|
|
|
|
|
|
|
if (!isDefault && mod.remain_count > 0) {
|
|
|
|
|
mod.endtime = that.currentDate.date + " " + mod.end_time;
|
|
|
|
|
var isCanbook = that.$moment(nt).isBefore(mod.endtime);
|
|
|
|
|
mod.isCanbook = isCanbook;
|
|
|
|
|
if (!isDefault && mod.remain_count > 0 && isCanbook) {
|
|
|
|
|
isDefault = true;
|
|
|
|
|
mod.checked = true;
|
|
|
|
|
that.currentTime = mod;
|
|
|
|
|
|