刘翔宇-旅管家 4 years ago
parent ef936a7eca
commit efd0c3fc05

@ -75,12 +75,13 @@
<view class="book-box-timerow"> <view class="book-box-timerow">
<view class="book-box-row-timeitem" v-for="(item,index) in currentDate.rules" <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}" :key="index"
@click="handleSelectTime(index)">
<view class="book-box-row-timeitem-status" v-if="item.checked"> <view class="book-box-row-timeitem-status" v-if="item.checked">
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon> <u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view> </view>
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view> <view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<view class="book-box-row-timeitem-txt">{{item.total}}</view> <view class="book-box-row-timeitem-txt">{{item.remain_count}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -230,6 +231,13 @@
this.util.toast("请提前一天预约"); this.util.toast("请提前一天预约");
return; return;
} }
if (cdate.is_open === 0) {
uni.showToast({
icon: "none",
title: "该日期已经售罄"
})
return;
}
for (var m of list) { for (var m of list) {
m.checked = false; m.checked = false;
} }
@ -370,8 +378,9 @@
m.week = "后天"; m.week = "后天";
} else { } else {
m.week = week; m.week = week;
} }
if (m.date == selectDate) {
if (m.date == selectDate ) {
m.checked = true; m.checked = true;
that.currentDate = m; that.currentDate = m;
that.currentIndex = i; that.currentIndex = i;
@ -384,7 +393,7 @@
} }
idx++; idx++;
} }
} }
i++; i++;
} }
}) })

@ -49,7 +49,7 @@
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon> <u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view> </view>
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view> <view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<view class="book-box-row-timeitem-txt">{{item.total}}</view> <view class="book-box-row-timeitem-txt">{{item.remain_count}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -316,7 +316,6 @@
title: (options.from == 'user' ? "个人预约" : "团队预约") title: (options.from == 'user' ? "个人预约" : "团队预约")
}) })
this.form.total = this.minCount; //= (type == 'user' ? 1 : 8);
//this.maxCount = (type == 'user' ? 5 : 50); //this.maxCount = (type == 'user' ? 5 : 50);
var that = this; var that = this;
that.util.getUserInfo(function(r) { that.util.getUserInfo(function(r) {
@ -341,7 +340,9 @@
} else { } else {
that.maxCount = res.team_max_count; that.maxCount = res.team_max_count;
that.minCount = res.team_min_count; that.minCount = res.team_min_count;
} }
that.form.total = that.minCount;
}, },
utilFail: function(res) { utilFail: function(res) {
@ -548,10 +549,12 @@
this.showCalendar = false; this.showCalendar = false;
}, },
handleSelectDate(e) { handleSelectDate(e) {
if (e.length != 0 && (e[0] != this.currentDate.date)) { if (this.showCalendar && e.length != 0 && e[0] != this.currentDate.date) {
this.load3Day(e[0]); this.load3Day(e[0]);
this.showCalendar = false; this.showCalendar = false;
} }
}, },
openCalendar() { openCalendar() {
var that = this; var that = this;
@ -586,6 +589,14 @@
}) })
return; return;
} }
console.log("cdate", cdate)
if (cdate.is_open === 0) {
uni.showToast({
icon: "none",
title: "该日期已经售罄"
})
return;
}
for (var m of list) { for (var m of list) {
m.checked = false; m.checked = false;
} }
@ -623,6 +634,7 @@
var mt = this.$moment().add('days', 1).format("yyyy-MM-DD"); var mt = this.$moment().add('days', 1).format("yyyy-MM-DD");
var ht = this.$moment().add('days', 2).format("yyyy-MM-DD"); var ht = this.$moment().add('days', 2).format("yyyy-MM-DD");
var selectDate = (nt == sdate) ? ndate : sdate; var selectDate = (nt == sdate) ? ndate : sdate;
this.loadCalendar(sdate, edate, function(res) { this.loadCalendar(sdate, edate, function(res) {
that.listDatePrice = res; that.listDatePrice = res;
@ -640,7 +652,8 @@
} else { } else {
m.week = week; m.week = week;
} }
if (m.date == selectDate) {
if (m.date == selectDate && m.is_open == 1) {
m.checked = true; m.checked = true;
that.currentDate = m; that.currentDate = m;
that.currentIndex = i; that.currentIndex = i;
@ -648,8 +661,6 @@
for (var mod of m.rules) { for (var mod of m.rules) {
mod.checked = false; mod.checked = false;
if (that.bcurrentTime) { if (that.bcurrentTime) {
console.log(that.bcurrentTime)
console.log("mod", mod)
if (mod.id == that.bcurrentTime.id) if (mod.id == that.bcurrentTime.id)
mod.checked = true; mod.checked = true;
that.currentTime = that.bcurrentTime; that.currentTime = that.bcurrentTime;
@ -661,6 +672,8 @@
} }
idx++; idx++;
} }
} else {
selectDate = that.$moment(selectDate).add('days', 1).format("yyyy-MM-DD");
} }
i++; i++;
} }

Loading…
Cancel
Save