|
|
|
|
@ -44,12 +44,16 @@
|
|
|
|
|
|
|
|
|
|
<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}" @click="handleSelectTime(index)">
|
|
|
|
|
:class="{'book-box-row-timeitem-on':item.checked,'timeitem-none':item.remain_count==0}"
|
|
|
|
|
: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">{{item.remain_count}}张</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>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -340,8 +344,8 @@
|
|
|
|
|
} else {
|
|
|
|
|
that.maxCount = res.team_max_count;
|
|
|
|
|
that.minCount = res.team_min_count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.form.total = that.minCount;
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
@ -549,7 +553,7 @@
|
|
|
|
|
this.showCalendar = false;
|
|
|
|
|
},
|
|
|
|
|
handleSelectDate(e) {
|
|
|
|
|
if (this.showCalendar && e.length != 0 && e[0] != this.currentDate.date) {
|
|
|
|
|
if (this.showCalendar && e.length != 0 ) {
|
|
|
|
|
this.load3Day(e[0]);
|
|
|
|
|
this.showCalendar = false;
|
|
|
|
|
}
|
|
|
|
|
@ -601,27 +605,24 @@
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
cdate.checked = true;
|
|
|
|
|
let i = 0;
|
|
|
|
|
for (var m of cdate.rules) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
|
|
|
|
|
m.checked = i == 0
|
|
|
|
|
if (m.checked) {
|
|
|
|
|
this.currentTime = m;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.loadDefaultTime(cdate.rules);
|
|
|
|
|
|
|
|
|
|
this.currentDate = cdate;
|
|
|
|
|
this.listDatePrice = list;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
handleSelectTime(index) {
|
|
|
|
|
for (var m of this.currentDate.rules) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
this.currentDate.rules[index].checked = true;
|
|
|
|
|
this.currentTime = this.currentDate.rules[index];
|
|
|
|
|
var mod = this.currentDate.rules[index];
|
|
|
|
|
if (mod.remain_count == 0) {
|
|
|
|
|
this.util.toast("该时段已售罄");
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
for (var m of this.currentDate.rules) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
mod.checked = true;
|
|
|
|
|
this.currentTime = mod;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
load3Day(sdate) { //加载7天数据
|
|
|
|
|
@ -653,27 +654,25 @@
|
|
|
|
|
m.week = week;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m.date == selectDate && m.is_open == 1) {
|
|
|
|
|
m.checked = true;
|
|
|
|
|
that.currentDate = m;
|
|
|
|
|
that.currentIndex = i;
|
|
|
|
|
let idx = 0;
|
|
|
|
|
for (var mod of m.rules) {
|
|
|
|
|
mod.checked = false;
|
|
|
|
|
if (that.bcurrentTime) {
|
|
|
|
|
if (mod.id == that.bcurrentTime.id)
|
|
|
|
|
mod.checked = true;
|
|
|
|
|
that.currentTime = that.bcurrentTime;
|
|
|
|
|
} else {
|
|
|
|
|
mod.checked = idx == 0
|
|
|
|
|
if (mod.checked) {
|
|
|
|
|
that.currentTime = mod;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
idx++;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
selectDate = that.$moment(selectDate).add('days', 1).format("yyyy-MM-DD");
|
|
|
|
|
if (m.date == selectDate) {
|
|
|
|
|
if (m.is_open == 1) {
|
|
|
|
|
m.checked = true;
|
|
|
|
|
that.currentDate = m;
|
|
|
|
|
that.currentIndex = i;
|
|
|
|
|
that.loadDefaultTime(m.rules);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: selectDate + "不可以预约",
|
|
|
|
|
complete() {
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
that.load3Day(that.$moment(selectDate).add('days', 1)
|
|
|
|
|
.format("yyyy-MM-DD"))
|
|
|
|
|
}, 2000)
|
|
|
|
|
}
|
|
|
|
|
}, 2000)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
@ -695,6 +694,21 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
loadDefaultTime(rules) {
|
|
|
|
|
var that = this;
|
|
|
|
|
that.currentTime = {};
|
|
|
|
|
let isDefault = false;
|
|
|
|
|
for (var mod of rules) {
|
|
|
|
|
mod.checked = false;
|
|
|
|
|
|
|
|
|
|
if (!isDefault && mod.remain_count > 0) {
|
|
|
|
|
isDefault = true;
|
|
|
|
|
mod.checked = true;
|
|
|
|
|
that.currentTime = mod;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
closeAdd() {
|
|
|
|
|
this.showAdd = false
|
|
|
|
|
},
|
|
|
|
|
@ -716,6 +730,10 @@
|
|
|
|
|
<style>
|
|
|
|
|
@import url("@/static/css/bookbox.css");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.timeitem-none {
|
|
|
|
|
color: #ccc;
|
|
|
|
|
}
|
|
|
|
|
.box-visitor-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|