diff --git a/src/home/ipLine/index.tsx b/src/home/ipLine/index.tsx index 36e275a..76dd415 100644 --- a/src/home/ipLine/index.tsx +++ b/src/home/ipLine/index.tsx @@ -193,8 +193,8 @@ export default function IpLinePage() { return ( <> - -
+ +

IP线路表 diff --git a/src/home/product/http.tsx b/src/home/product/http.tsx index ce81017..17c5bfe 100644 --- a/src/home/product/http.tsx +++ b/src/home/product/http.tsx @@ -84,6 +84,7 @@ export default function HttpPage() { // 支付弹窗状态 const [payDialogOpen, setPayDialogOpen] = useState(false) + const [payAmount, setPayAmount] = useState(0) const [payMethod, setPayMethod] = useState("2") const [isRecharge] = useState(true) const [isLoading, setIsLoading] = useState(false) @@ -94,10 +95,9 @@ export default function HttpPage() { let price = 0 switch (activeTab) { case "prepaid": - price = Number(customAmount) || 0 + price = Number(customAmount) || 1 break case "unlimited": - // 简化计算 price = whitelistCount * periodCount * 0.5 break case "daily": @@ -124,16 +124,18 @@ export default function HttpPage() { setTimeout(() => { setIsLoading(false) setPayDialogOpen(false) - toast.success(`支付成功!支付金额:¥${totalPrice.toFixed(2)}`) + toast.success(`支付成功!支付金额:¥${payAmount.toFixed(2)}`) }, 1500) } // 打开支付弹窗 - const openPayDialog = () => { - if (totalPrice <= 0) { + const openPayDialog = (amount?: number) => { + const effectivePrice = Number(amount ?? totalPrice) + if (effectivePrice <= 0) { toast.error("请输入有效的充值金额") return } + setPayAmount(effectivePrice) setPayDialogOpen(true) } @@ -541,7 +543,7 @@ export default function HttpPage() { - 待支付:¥{totalPrice.toFixed(2)}元 + 待支付:¥{payAmount.toFixed(2)}元 @@ -585,7 +587,7 @@ export default function HttpPage() {

- 本次支付H币:{totalPrice.toFixed(2)} + 本次支付H币:{payAmount.toFixed(2)}

)} @@ -614,7 +616,7 @@ function PrepaidCardCustom({ }: { amount: string onAmountChange: (v: string) => void - onPay: () => void + onPay: (amount: number) => void }) { return ( @@ -643,7 +645,7 @@ function PrepaidCardCustom({
  • 支持购买任意套餐