From e23fb84108eeb3f8ec5a8c64c774396ef32142bc Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 26 Jun 2023 15:48:51 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E7=BA=A2=E5=8C=85=E4=B8=AA?= =?UTF-8?q?=E6=95=B0=E9=99=90=E5=88=B610w=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/redPackets/rules.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/redPackets/rules.js b/src/components/redPackets/rules.js index 0eb2bba4..0398cfcc 100644 --- a/src/components/redPackets/rules.js +++ b/src/components/redPackets/rules.js @@ -18,8 +18,8 @@ export default { { type: "required", message: "请输入红包个数" }, { type: "regExp", - message: "请输入0 ~ 999999999个红包个数", - reg: /^([0-9][0-9]{0,8})$/ + message: "请输入1 ~ 100000个正整数红包", + reg: /^[1-9]\d{0,4}$|^100000$/ } ], denomination: [{ type: "required", message: "请输入0.01 ~ 200面额" }, { ...regObj }], @@ -113,6 +113,11 @@ export function additionalRules({ model, computeMax }) { return false } + if (model.denomination > model.day_budget) { + Notify.error("单天预算发放上限应该大于或等于面额") + return false + } + if (model.receive_every === 1 && model.receive_num > 10) { Notify.error("每日红包最高上限为10个") return false