From 0fe0c5f9784d227af1accdeb3795774d180dd38c Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 29 Jun 2023 17:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AA=20optimize:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/redPackets/rules.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/redPackets/rules.js b/src/components/redPackets/rules.js index cbf53db9..022e74f2 100644 --- a/src/components/redPackets/rules.js +++ b/src/components/redPackets/rules.js @@ -159,13 +159,13 @@ export function additionalRules(params, computeMin, computeMax) { if (model.cash_amount_type === "2") { /* TODO: 2:微信 1:支付宝 */ if (model.channel === 2) { - if (!rulesRandom(model, 0.1)) { + if (rulesRandom(model, 0.1)) { return false } } if (model.channel === 1) { - if (!rulesRandom(model, 0.01)) { + if (rulesRandom(model, 0.01)) { return false } } @@ -210,13 +210,13 @@ export function additionalRules(params, computeMin, computeMax) { if (model.cash_amount_type === "1") { /* TODO: 2:微信 1:支付宝 */ if (model.channel === 2) { - if (!rulesFixed(model, 0.1)) { + if (rulesFixed(model, 0.1)) { return false } } if (model.channel === 1) { - if (!rulesFixed(model, 0.01)) { + if (rulesFixed(model, 0.01)) { return false } } @@ -243,13 +243,11 @@ function rulesRandom(model, num) { ) { if (model.min_denomination > model.max_denomination) { Notify.error("随机红包最小面额不得大于最大面额") - return false + return true } else { Notify.error(`请输入${num} ~ 200的面额且保留2位小数`) - return false + return true } - } else { - return true } } @@ -257,8 +255,6 @@ function rulesRandom(model, num) { function rulesFixed(model, num) { if (model.denomination < num || model.denomination > 200 || !fP.test(model.denomination)) { Notify.error(`请输入${num} ~ 200的面额且保留2位小数`) - return false - } else { return true } }