From 0c587f2e58bfed29cf054d05072ecdf5d749951c Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 22 May 2026 10:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E8=BD=A6=E4=BD=8D=E4=B8=8B=E5=8D=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/park/book.vue | 79 ++++++++++++++++++++++++++------------------ pages/park/index.vue | 8 ++--- 2 files changed, 50 insertions(+), 37 deletions(-) diff --git a/pages/park/book.vue b/pages/park/book.vue index 531ef8d..48091d7 100644 --- a/pages/park/book.vue +++ b/pages/park/book.vue @@ -8,14 +8,14 @@ - - + + {{(form.time?timeFormat(formTime, 'yyyy年MM月DD日 HH:mm'):'请选择入场时间>')}} - @@ -150,8 +150,8 @@ activity_order_id: "", visit_order_id: "" }, - formTime: Number(new Date()), - minDate:'', + formTime: Number(new Date()), + minDate:'', maxDate:'', listOrder: [], listActivtyOrder: [], @@ -162,7 +162,7 @@ } }, onLoad(options) { - let that = this; + let that = this; that.showInfo = true; if (!that.util.isNull(options.id)) { @@ -184,12 +184,12 @@ // else // this.form.visit_order_id = bookinfo.orderid // this.orderid = bookinfo.orderid - // } - that.form.time = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() - that.formTime = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() - console.log(that.form.time) - this.minDate = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() - this.maxDate = this.$moment(this.$moment().add('days',6).format('YYYY-MM-DD') + ' 16:00:00').valueOf() + // } + that.form.time = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() + that.formTime = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() + console.log(that.form.time) + this.minDate = this.$moment(this.$moment().format('YYYY-MM-DD HH:mm:ss')).valueOf() + this.maxDate = this.$moment(this.$moment().add('days',6).format('YYYY-MM-DD') + ' 16:00:00').valueOf() console.log("this.minDate",this.minDate,this.maxDate) that.loadConfigInfo(); @@ -326,16 +326,16 @@ }) }, confirmTime(e) { - console.log(e) - this.form.time = e.value - this.formTime = e.value - let choosetime = parseInt(this.$moment(this.form.time).format("HH")) - let chooseMin = parseInt(this.$moment(this.form.time).format("mm")) - // let nowtime = parseInt(this.$moment().format("HH")) - // console.log(chooseMin) - if(choosetime<9 || choosetime>16 || (choosetime==16 && chooseMin>0)){ - this.util.toast("请选择正确的入场时间"); - return false; + console.log(e) + this.form.time = e.value + this.formTime = e.value + let choosetime = parseInt(this.$moment(this.form.time).format("HH")) + let chooseMin = parseInt(this.$moment(this.form.time).format("mm")) + // let nowtime = parseInt(this.$moment().format("HH")) + // console.log(chooseMin) + if(choosetime<9 || choosetime>16 || (choosetime==16 && chooseMin>0)){ + this.util.toast("请选择正确的入场时间"); + return false; } this.showSelecttime = false; }, @@ -350,16 +350,29 @@ }, handleSelectTime() { this.showSelecttime = true; - }, + }, submitOrder() { // if (this.util.isNull(this.orderid)) { // this.util.toast("请选择参观预约或者活动预约"); // return false; - // } - if(this.$moment(this.form.time).format("HH")<9 || this.$moment(this.form.time).format("HH")>16){ - this.util.toast("请选择正确的入场时间"); - return false; + // } + if(this.$moment(this.form.time).format("HH")<9 || this.$moment(this.form.time).format("HH")>16){ + this.util.toast("请选择正确的入场时间"); + return false; + } + // 大中型车按入场时间区分上午(type=2)/下午(type=4) + if (this.form.type == 2 || this.form.type == 4 || this.form.type == '2' || this.form.type == '4') { + const hour = parseInt(this.$moment(this.form.time).format('HH')) + const minute = parseInt(this.$moment(this.form.time).format('mm')) + if (hour >= 13) { + this.form.type = 4 + } else if (hour < 12 || (hour === 12 && minute === 0)) { + this.form.type = 2 + } else { + this.util.toast("12:00-13:00 为非入场时段,请选择上午或下午时间"); + return false; + } } if (this.form.plate.length != 7 && this.form.plate.length != 8) { this.util.toast("请正确填写车牌号"); @@ -382,10 +395,10 @@ if (!this.form.checkUser) { this.util.toast("请阅读预约通知"); return false; - } + } - this.form.time = this.timeFormat(this.form.time, 'yyyy-MM-DD HH:mm') - console.log(this.form.time) + this.form.time = this.timeFormat(this.form.time, 'yyyy-MM-DD HH:mm') + console.log(this.form.time) // return var that = this; this.util.request({ @@ -515,4 +528,4 @@ .richp { margin-bottom: 10rpx } - + diff --git a/pages/park/index.vue b/pages/park/index.vue index 106d0c4..e1ab14d 100644 --- a/pages/park/index.vue +++ b/pages/park/index.vue @@ -38,7 +38,7 @@ + v-if="remain_big_park>0 || remain_big_park2>0"> @@ -86,7 +86,7 @@ + v-if="remain_special_park<=0&&remain_big_park<=0&&remain_big_park2<=0&&remain_small_park<=0"> @@ -138,7 +138,7 @@ + v-if="remain_big_park>0 || remain_big_park2>0"> @@ -186,7 +186,7 @@ + v-if="remain_special_park<=0&&remain_big_park<=0&&remain_big_park2<=0&&remain_small_park<=0">