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 } }