From 0a5e75c40cb593c5fea9c8e6e762e3e6b216b760 Mon Sep 17 00:00:00 2001 From: Eamon <17516219072@163.com> Date: Thu, 20 Aug 2026 15:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=85=85=E5=80=BC=E5=92=8C=E7=AB=8B=E5=8D=B3=E5=85=85=E5=80=BC?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/home/ipLine/index.tsx | 4 ++-- src/home/product/http.tsx | 28 +++++++++++++++------------- src/home/product/routeros.tsx | 14 +------------- src/home/softDownload/index.tsx | 6 +++--- 4 files changed, 21 insertions(+), 31 deletions(-) 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({ 支持购买任意套餐 onPay(Number(amount) || 1)} className="w-full rounded-md bg-linear-to-r from-blue-500 to-cyan-400 text-white hover:opacity-90" > 自定义充值 @@ -657,7 +659,7 @@ function PrepaidCard({ onPay, }: { plan: { amount: number; bonus: string; total: number; tag: string } - onPay: () => void + onPay: (amount: number) => void }) { return ( @@ -677,7 +679,7 @@ function PrepaidCard({ 支持购买任意套餐 onPay(plan.amount)} className="w-full rounded-md bg-linear-to-r from-blue-500 to-cyan-400 text-white hover:opacity-90" > 立即充值 @@ -692,7 +694,7 @@ function PrepaidCardLarge({ onPay, }: { plan: { amount: number; bonus: string; total: number; tag: string } - onPay: () => void + onPay: (amount: number) => void }) { return ( @@ -703,7 +705,7 @@ function PrepaidCardLarge({ ¥{plan.amount} 实到{plan.total}H币 onPay(plan.amount)} className="rounded-md bg-linear-to-r from-blue-500 to-cyan-400 text-white hover:opacity-90 px-10" > 立即充值 diff --git a/src/home/product/routeros.tsx b/src/home/product/routeros.tsx index 54edb98..c90bdf4 100644 --- a/src/home/product/routeros.tsx +++ b/src/home/product/routeros.tsx @@ -1,7 +1,4 @@ -import { zodResolver } from "@hookform/resolvers/zod" -import { useEffect, useState } from "react" -import { Controller, useForm } from "react-hook-form" -import { z } from "zod" +import { useState } from "react" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" @@ -12,7 +9,6 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog" -import { FieldError } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Separator } from "@/components/ui/separator" @@ -22,14 +18,6 @@ import alipay from "../_assets/alipay.svg" import balance from "../_assets/balance.svg" import wechat from "../_assets/wechat.svg" -const shippingSchema = z.object({ - name: z.string().trim().min(1, "请输入收货人"), - phone: z.string().regex(/^1\d{10}$/, "请输入正确的手机号"), - address: z.string().trim().min(1, "请输入地址"), -}) - -type ShippingValues = z.infer - const PRODUCT_VARIANTS = [ { id: 1, diff --git a/src/home/softDownload/index.tsx b/src/home/softDownload/index.tsx index 289f245..f5fcf9a 100644 --- a/src/home/softDownload/index.tsx +++ b/src/home/softDownload/index.tsx @@ -24,17 +24,17 @@ export default function SoftDownloadPage() { return ( - + 软件下载 - 下载客户端 + IP线路表
- 本次支付H币:{totalPrice.toFixed(2)} + 本次支付H币:{payAmount.toFixed(2)}
实到{plan.total}H币