From 5663fecb7135af1536586c0527aa9927184a04cb Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Fri, 18 Oct 2024 17:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/coupon/coupon-add-or-update.vue | 22 +- src/views/modules/coupon/coupon.vue | 66 ++- src/views/modules/coupon/userCouponList.vue | 8 +- .../modules/course/course-add-or-update.vue | 3 +- src/views/modules/shop/proCouponList.vue | 412 ++++++++++++++++++ src/views/modules/shop/shopproduct.vue | 25 +- 6 files changed, 508 insertions(+), 28 deletions(-) create mode 100644 src/views/modules/shop/proCouponList.vue diff --git a/src/views/modules/coupon/coupon-add-or-update.vue b/src/views/modules/coupon/coupon-add-or-update.vue index 2614926..53777c6 100644 --- a/src/views/modules/coupon/coupon-add-or-update.vue +++ b/src/views/modules/coupon/coupon-add-or-update.vue @@ -105,7 +105,7 @@ - + + 请选择绑定类目 @@ -271,6 +272,7 @@ export default { baseUrl: global.baseUrl, data() { return { + showCateError: false, requesturl:'', // 课程的请求地址 showSelectPro:false, baseUrl: global.baseUrl, @@ -404,6 +406,7 @@ export default { changeCate(e) { console.log("e", e); this.cateSelectLinkList = e; + this.showCateError = false // this.dataForm.rangeInfo = e.join(","); }, async changeRange(e) { @@ -434,9 +437,13 @@ export default { return list; }, init(id) { + if(!id){ + console.log('没有传值') + this.visible = true; + return + } this.dataForm.id = id || 0; - this.getCouponInfoLoad = true; - + this.getCouponInfoLoad = true; this.$nextTick(() => { this.$refs["dataForm"].resetFields(); if (this.dataForm.id) { @@ -558,6 +565,7 @@ export default { couponRange: "", //优惠卷范围 0无限制 1课程卷 2课程品类卷 rangeInfo: "" //范围详情(课程卷是课程id,分割 课程品类卷是课程分类根id,分割) }; + this.proSelectLinkList = [] this.cateSelectLinkList = [] this.selectLinkList = [] this.fileList = [] @@ -566,9 +574,9 @@ export default { // 表单提交 dataFormSubmit() { this.$refs["dataForm"].validate(valid => { - if (valid) { - if(this.dataForm.effectTime < new Date().getTime()) return this.$message.error("生效时间不能小于当前时间") - if (this.dataForm.effectType == 2) { + if (valid) { + if(!this.dataForm.id && this.dataForm.effectType == 2 && this.dataForm.effectTime < new Date().getTime()) return this.$message.error("生效时间不能小于当前时间") + if (this.dataForm.effectType == 2 ) { if ( this.dataForm.effectTime == null || this.dataForm.effectTime == "" @@ -601,7 +609,7 @@ export default { } if (this.dataForm.couponRange == 2) { - if(this.cateSelectLinkList.length == 0) return this.$message.error("请选择课程品类"); + if(this.cateSelectLinkList.length == 0) {this.showCateError = true; return this.$message.error("请选择课程品类");} this.dataForm.rangeInfo = this.cateSelectLinkList.join(',') // if ( // this.dataForm.rangeInfo == null || diff --git a/src/views/modules/coupon/coupon.vue b/src/views/modules/coupon/coupon.vue index 7441f62..365cccb 100644 --- a/src/views/modules/coupon/coupon.vue +++ b/src/views/modules/coupon/coupon.vue @@ -1,6 +1,7 @@