From cc53604f84ba0538779f5cae8ff57f2f63f8bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?= <153298343@qq.com> Date: Tue, 5 Jul 2022 19:14:13 +0800 Subject: [PATCH] up --- pages/index/index.vue | 4 ++-- pages/park/book.vue | 2 +- pages/park/index.vue | 32 ++++++++++++++++++++++---------- pages/visit/book.vue | 19 ++++++++++++------- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 7ca3f10..a194a4c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -91,7 +91,7 @@ {{item.remain_count}}张 - 不可预约 + 已约满 不可预约 @@ -301,7 +301,7 @@ return false } if (mod.remain_count == 0) { - this.util.toast("该时段已不可预约"); + this.util.toast("该时段已约满了"); return false } for (var m of this.currentDate.rules) { diff --git a/pages/park/book.vue b/pages/park/book.vue index e108e55..8c9dce4 100644 --- a/pages/park/book.vue +++ b/pages/park/book.vue @@ -8,7 +8,7 @@ - + {{(form.time?$u.timeFormat(_formTime, 'yyyy年mm月dd日 hh:MM'):'请选择入场时间>')}} (充电桩空闲0) + + + + + + + + 残疾人车位:{{remain_special_park}} + + - - - + v-if="remain_special_park<=0&&remain_big_park<=0&&remain_small_park<=0"> + - 残疾人车位:{{remain_special_park}} + 暂无可选停车位 @@ -140,7 +149,7 @@ distance: 0, info: {}, covers: [], - currentPark: 1, + currentPark: 0, btnDisabled: false, showSelectorder: false, listOrder: [], @@ -153,8 +162,8 @@ userlongitude: 120.626022 }, remain_big_park: 0, - remain_small_park: 0, - remain_special_park:0 + remain_small_park: 0, + remain_special_park: 0 } }, onLoad() { @@ -285,7 +294,7 @@ that.info.latitude = parseFloat(res.detail.latitude); that.info.longitude = parseFloat(res.detail.longitude); that.remain_big_park = res.remain_big_park; - that.remain_small_park = res.remain_small_park; + that.remain_small_park = res.remain_small_park; that.remain_special_park = res.remain_special_park; var mod = { latitude: that.info.latitude, @@ -309,6 +318,9 @@ if (this.selectInfo.orderid === 0) { this.util.toast("请选择预约的活动或者预约的参观"); return false; + } else if (this.currentPark === 0) { + this.util.toast("请选择停车位"); + return false; } else { var json = escape(JSON.stringify(this.selectInfo)); uni.navigateTo({ diff --git a/pages/visit/book.vue b/pages/visit/book.vue index b609ef8..8118873 100644 --- a/pages/visit/book.vue +++ b/pages/visit/book.vue @@ -48,7 +48,7 @@ @@ -57,7 +57,7 @@ {{item.remain_count}}张 - 不可预约 + 已约满 @@ -1001,6 +1001,7 @@ }, loadDefaultTime(rules) { var that = this; + var nt = new Date(); that.currentTime = {}; let isDefault = false; for (var mod of rules) { @@ -1011,11 +1012,15 @@ mod.checked = true; that.currentTime = that.bcurrentTime; } - } else { - if (!isDefault && mod.remain_count > 0) { - isDefault = true; - mod.checked = true; - that.currentTime = mod; + } else { + + 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; } }