From 09b735e82a10fdbb11ec977c4afb46384a8c3f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com> Date: Tue, 28 Jul 2026 10:29:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(buyer):=20=E5=A2=9E=E5=8A=A0=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81=E5=8F=91=E9=80=81=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=AE=A1=E7=90=86=20-=20=E6=96=B0=E5=A2=9E=20codeSent?= =?UTF-8?q?=20=E7=8A=B6=E6=80=81=E4=BB=A5=E8=B7=9F=E8=B8=AA=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81=E6=98=AF=E5=90=A6=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E9=80=81=20-=20=E5=9C=A8=E7=99=BB=E5=BD=95=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E7=94=A8=E6=88=B7=E5=AE=8C=E6=88=90=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=AA=8C=E8=AF=81=E5=92=8C=E8=8E=B7=E5=8F=96=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=20-=20=E4=BC=98=E5=8C=96=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=8F=91=E9=80=81=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/pages/Login.vue | 25 ++++++++-- .../flash-discount/flash-discount-add.vue | 49 ++++++++++++++++--- .../nth-item-discount-add.vue | 29 +++++++++-- 3 files changed, 89 insertions(+), 14 deletions(-) diff --git a/buyer/src/pages/Login.vue b/buyer/src/pages/Login.vue index 98cb7762..da9db604 100644 --- a/buyer/src/pages/Login.vue +++ b/buyer/src/pages/Login.vue @@ -197,6 +197,7 @@ export default { mobile: "", }, verifyStatus: false, // 是否图片验证通过 + codeSent: false, // 是否已成功发送短信验证码 ruleInline: { // 验证规则 username: [{required: true, message: "请输入用户名"}], @@ -237,7 +238,15 @@ export default { if (this.type) { this.$refs.verify?.init(); } else { - let data = JSON.parse(JSON.stringify(this.formSms)); + if (!this.verifyStatus) { + Message.warning("请先完成安全验证"); + return; + } + if (!this.codeSent) { + Message.warning("请先获取短信验证码"); + return; + } + const data = JSON.parse(JSON.stringify(this.formSms)); apiLogin.smsLogin(data).then((res) => { this.hideVerify(); if (res.success) { @@ -262,7 +271,7 @@ export default { } else { Message.error(res.message); } - }); + }).catch(() => {}); } } }); @@ -285,6 +294,7 @@ export default { sendSms(params).then((res) => { if (res.success) { Message.success("验证码发送成功"); + this.codeSent = true; let that = this; this.interval = setInterval(() => { that.time--; @@ -292,6 +302,7 @@ export default { that.time = 60; that.codeMsg = "重新发送"; that.verifyStatus = false; + that.codeSent = false; clearInterval(that.interval); } else { that.codeMsg = that.time; @@ -300,7 +311,7 @@ export default { } else { Message.warning(res.message); } - }); + }).catch(() => {}); } }, verifyChange(con) { @@ -453,11 +464,19 @@ export default { this.$refs.formSms.resetFields(); } this.verifyStatus = false; + this.codeSent = false; this.hideVerify(); clearInterval(this.interval); this.codeMsg = "发送验证码"; this.time = 60; }, + "formSms.mobile"() { + this.codeSent = false; + this.verifyStatus = false; + clearInterval(this.interval); + this.codeMsg = "发送验证码"; + this.time = 60; + }, }, }; diff --git a/seller/src/views/promotion/flash-discount/flash-discount-add.vue b/seller/src/views/promotion/flash-discount/flash-discount-add.vue index 6eb37899..76dd3826 100644 --- a/seller/src/views/promotion/flash-discount/flash-discount-add.vue +++ b/seller/src/views/promotion/flash-discount/flash-discount-add.vue @@ -6,7 +6,14 @@ - + 0 表示不限 @@ -16,12 +23,17 @@ 选择商品 - - - - + + + + @@ -83,9 +95,18 @@ export default { submit() { const payload = { ...this.form }; if (payload.rangeTime && payload.rangeTime.length === 2) { - payload.startTime = payload.rangeTime[0]; - payload.endTime = payload.rangeTime[1]; + const start = + payload.rangeTime[0] instanceof Date + ? payload.rangeTime[0] + : new Date(payload.rangeTime[0]); + const end = + payload.rangeTime[1] instanceof Date + ? payload.rangeTime[1] + : new Date(payload.rangeTime[1]); + payload.startTime = this.$filters.unixToDate(start.getTime() / 1000); + payload.endTime = this.$filters.unixToDate(end.getTime() / 1000); } + delete payload.rangeTime; const req = payload.id ? editFlashDiscount(payload) : saveFlashDiscount(payload); req.then((res) => { if (res.success) { @@ -101,4 +122,16 @@ export default { diff --git a/seller/src/views/promotion/nth-item-discount/nth-item-discount-add.vue b/seller/src/views/promotion/nth-item-discount/nth-item-discount-add.vue index d4c7b0aa..8171cf06 100644 --- a/seller/src/views/promotion/nth-item-discount/nth-item-discount-add.vue +++ b/seller/src/views/promotion/nth-item-discount/nth-item-discount-add.vue @@ -6,7 +6,14 @@ - + @@ -92,9 +99,18 @@ export default { submit() { const payload = { ...this.form }; if (payload.rangeTime && payload.rangeTime.length === 2) { - payload.startTime = payload.rangeTime[0]; - payload.endTime = payload.rangeTime[1]; + const start = + payload.rangeTime[0] instanceof Date + ? payload.rangeTime[0] + : new Date(payload.rangeTime[0]); + const end = + payload.rangeTime[1] instanceof Date + ? payload.rangeTime[1] + : new Date(payload.rangeTime[1]); + payload.startTime = this.$filters.unixToDate(start.getTime() / 1000); + payload.endTime = this.$filters.unixToDate(end.getTime() / 1000); } + delete payload.rangeTime; const req = payload.id ? editNthItemDiscount(payload) : saveNthItemDiscount(payload); req.then((res) => { if (res.success) { @@ -110,4 +126,11 @@ export default {