From 7763abd5913285647550ea9751be4c0f3699bbad Mon Sep 17 00:00:00 2001 From: pikachu <1321288662@qq.com> Date: Wed, 11 Aug 2021 21:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E6=B4=BB=E5=8A=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/promotion/pintuan/newPintuan.vue | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/seller/src/views/promotion/pintuan/newPintuan.vue b/seller/src/views/promotion/pintuan/newPintuan.vue index 412954b4..181518ca 100644 --- a/seller/src/views/promotion/pintuan/newPintuan.vue +++ b/seller/src/views/promotion/pintuan/newPintuan.vue @@ -3,7 +3,7 @@
- +
活动名称将显示在对人拼团活动列表中,方便商家管理使用,最多输入25个字符
@@ -21,11 +21,11 @@
- + 建议参团人数不少于2人,不超过20人。参团人数不少于2人,不得超过10人。 @@ -54,6 +54,7 @@ type="textarea" :rows="4" clearable + maxlength="255" style="width: 260px" />
@@ -94,7 +95,7 @@ export default { requiredNum: [ { required: true, message: "参团人数不能为空" }, { - pattern: /^(1|[1-9]\d?|100)$/, + pattern: /^([2-9]|10)?$/, message: "参团人数不合法", }, ], @@ -135,13 +136,25 @@ export default { this.$refs.form.validate((valid) => { if (valid) { this.submitLoading = true; - let params = JSON.parse(JSON.stringify(this.form)); + let params = JSON.parse(JSON.stringify(this.form)) params.startTime = this.$options.filters.unixToDate( this.form.rangeTime[0] / 1000 ); + params.endTime = this.$options.filters.unixToDate( this.form.rangeTime[1] / 1000 ); + if(params.startTime === '' || params.endTime ===''){ + this.$Message.error("活动时间不能为空"); + this.submitLoading = false; + return + } + if(params.startTime < new Date()){ + this.$Message.error("拼团活动开始时间不能小于当前时间"); + this.submitLoading = false; + return + } + delete params.rangeTime if (!this.id) { // 添加 避免编辑后传入id等数据 记得删除