feat: 在线支付限制输入金额

This commit is contained in:
1808837298@qq.com 2024-02-23 17:04:42 +08:00
parent 81167c4322
commit 05beade3ad
2 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@douyinfe/semi-ui": "^2.46.1",
"@douyinfe/semi-icons": "^2.46.1",
"@visactor/vchart": "~1.8.8",
"@visactor/react-vchart": "~1.8.8",
"@visactor/vchart-semi-theme": "~1.8.8",

View File

@ -8,8 +8,10 @@ const TopUp = () => {
const [redemptionCode, setRedemptionCode] = useState('');
const [topUpCode, setTopUpCode] = useState('');
const [topUpCount, setTopUpCount] = useState(10);
const [minTopupCount, setMinTopUpCount] = useState(1);
const [amount, setAmount] = useState(0.0);
const [topUpLink, setTopUpLink] = useState('');
const [enableOnlineTopUp, setEnableOnlineTopUp] = useState(false);
const [userQuota, setUserQuota] = useState(0);
const [isSubmitting, setIsSubmitting] = useState(false);
const [open, setOpen] = useState(false);
@ -233,7 +235,16 @@ const TopUp = () => {
name='redemptionCount'
type={'number'}
value={topUpCount}
suffix={'$'}
min={1}
max={100000}
onChange={async (value) => {
if (value < 1) {
value = 1;
}
if (value > 100000) {
value = 100000;
}
setTopUpCount(value);
await getAmount(value);
}}