diff --git a/pages/park/book.vue b/pages/park/book.vue index b8d8c68..cbe4dee 100644 --- a/pages/park/book.vue +++ b/pages/park/book.vue @@ -185,11 +185,11 @@ // this.form.visit_order_id = bookinfo.orderid // this.orderid = bookinfo.orderid // } - that.form.time = new Date() + 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') + ' 23:59:59').valueOf() - + this.minDate = this.$moment(this.$moment().format('YYYY-MM-DD')+' 09:00:00').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(); @@ -328,7 +328,12 @@ confirmTime(e) { console.log(e) this.form.time = e.value - this.formTime = e.value + this.formTime = e.value + let choosetime = parseInt(this.$moment(this.form.time).format("HH")) + if(choosetime<9 || choosetime>16){ + this.util.toast("请选择正确的入场时间"); + return false; + } this.showSelecttime = false; }, cancelTime() { @@ -342,12 +347,17 @@ }, 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.form.plate.length != 7 && this.form.plate.length != 8) { this.util.toast("请正确填写车牌号"); return false; @@ -369,7 +379,8 @@ 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) // return diff --git a/utils/util.js b/utils/util.js index 3891aee..284e6d7 100755 --- a/utils/util.js +++ b/utils/util.js @@ -1,9 +1,9 @@ import md5 from "./md5.min"; const HOSTARR = { - // 'development':'https://leyiyuyue.szgmbwg.org.cn', - // 'production': 'https://leyiyuyue.szgmbwg.org.cn', - 'development':'https://leyitest.ali251.langye.net', - 'production': 'https://leyitest.ali251.langye.net', + 'development':'https://leyiyuyue.szgmbwg.org.cn', + 'production': 'https://leyiyuyue.szgmbwg.org.cn', + // 'development':'https://leyitest.ali251.langye.net', + // 'production': 'https://leyitest.ali251.langye.net', }; // 审核状态