|
|
|
|
@ -75,13 +75,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}" :key="index"
|
|
|
|
|
@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>
|
|
|
|
|
@ -195,8 +198,7 @@
|
|
|
|
|
this.showCalendar = false;
|
|
|
|
|
},
|
|
|
|
|
handleSelectDate(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
if (e.length != 0 && (e[0] != this.currentDate.date)) {
|
|
|
|
|
if (e.length != 0) {
|
|
|
|
|
this.load3Day(e[0]);
|
|
|
|
|
this.showCalendar = false;
|
|
|
|
|
}
|
|
|
|
|
@ -242,26 +244,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) {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
this.currentDate.rules[index].checked = true;
|
|
|
|
|
this.currentTime = this.currentDate.rules[index];
|
|
|
|
|
mod.checked = true;
|
|
|
|
|
this.currentTime = mod;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
openActivity() {
|
|
|
|
|
@ -317,6 +317,15 @@
|
|
|
|
|
this.showBook = false;
|
|
|
|
|
},
|
|
|
|
|
tobook(type) {
|
|
|
|
|
|
|
|
|
|
if (this.util.isNull(this.currentDate.date)) {
|
|
|
|
|
this.util.toast("请选择预约的日期");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (this.util.isNull(this.currentTime.id)) {
|
|
|
|
|
this.util.toast("请选择预约的时段");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: "/pages/visit/book?from=" + type + "¤tDate=" + JSON.stringify(this.currentDate) +
|
|
|
|
|
"¤tTime=" + JSON.stringify(this.currentTime)
|
|
|
|
|
@ -381,23 +390,44 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m.date == selectDate) {
|
|
|
|
|
if (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;
|
|
|
|
|
mod.checked = idx == 0;
|
|
|
|
|
if (mod.checked) {
|
|
|
|
|
that.currentTime = mod;
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
idx++;
|
|
|
|
|
}, 2000)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
loadCalendar(sdate, edate, cb) {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.util.request({
|
|
|
|
|
@ -422,7 +452,9 @@
|
|
|
|
|
@import url("@/static/css/bookbox.css");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.timeitem-none {
|
|
|
|
|
color: #ccc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
|