mirror of
				https://github.com/linux-do/new-api.git
				synced 2025-11-04 21:33:41 +08:00 
			
		
		
		
	feat: 在线支付限制输入金额
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
                                        }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user