From 3aae43f539cfd2db3148fbfcdc4f5ac13e9b19d3 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Tue, 9 Jun 2026 02:14:51 -0700 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(#14):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20USDT=20=E6=8F=90=E7=8E=B0=E6=96=B9=E5=BC=8F=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/sections/withdrawal/index.tsx | 2 + .../src/sections/user/affiliate/index.tsx | 59 +++++++++++-------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/apps/admin/src/sections/withdrawal/index.tsx b/apps/admin/src/sections/withdrawal/index.tsx index 779f72c..48a2415 100644 --- a/apps/admin/src/sections/withdrawal/index.tsx +++ b/apps/admin/src/sections/withdrawal/index.tsx @@ -45,6 +45,7 @@ const WITHDRAWAL_METHOD_MAP: Record = { 1: "支付宝", 2: "微信", 3: "银行卡", + 4: "USDT(TRC20)", }; const rejectSchema = z.object({ @@ -144,6 +145,7 @@ export default function WithdrawalPage() { { value: "1", label: "支付宝" }, { value: "2", label: "微信" }, { value: "3", label: "银行卡" }, + { value: "4", label: "USDT(TRC20)" }, { value: "0", label: "其他" }, ]; diff --git a/apps/user/src/sections/user/affiliate/index.tsx b/apps/user/src/sections/user/affiliate/index.tsx index 989770d..ff09378 100644 --- a/apps/user/src/sections/user/affiliate/index.tsx +++ b/apps/user/src/sections/user/affiliate/index.tsx @@ -64,6 +64,7 @@ const WITHDRAWAL_METHODS = [ { value: 1, label: "支付宝" }, { value: 2, label: "微信" }, { value: 3, label: "银行卡" }, + { value: 4, label: "USDT(TRC20)" }, { value: 0, label: "其他" }, ] as const; @@ -111,13 +112,21 @@ function QrCodeView({ url }: { url: string }) { 收款码 {zoomOpen && ( - 收款码 + 收款码 )} @@ -149,22 +158,23 @@ const withdrawalFormSchema = z path: ["qr_code_url"], }); } - } else if (data.method === 3) { + } else if (data.method === 3 || data.method === 4) { if (!data.account) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: "银行卡收款账号为必填", - path: ["account"], - }); - } - } else if (data.method === 0) { - if (!data.account && !data.content) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: "收款账号和备注至少填一项", + message: + data.method === 4 + ? "USDT(TRC20) 地址为必填" + : "银行卡收款账号为必填", path: ["account"], }); } + } else if (data.method === 0 && !(data.account || data.content)) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: "收款账号和备注至少填一项", + path: ["account"], + }); } }); @@ -421,9 +431,7 @@ export default function Affiliate() { 收款码 - - * - + * {watchedQrCodeUrl ? (
@@ -446,7 +454,9 @@ export default function Affiliate() { returnType="file" >
- {qrUploading ? "上传中..." : "点击上传\n收款码"} + {qrUploading + ? "上传中..." + : "点击上传\n收款码"}
)} @@ -456,7 +466,9 @@ export default function Affiliate() { /> )} - {(watchedMethod === 3 || watchedMethod === 0) && ( + {(watchedMethod === 3 || + watchedMethod === 4 || + watchedMethod === 0) && ( 收款账号 - {watchedMethod === 3 && ( + {(watchedMethod === 3 || + watchedMethod === 4) && ( * @@ -473,9 +486,11 @@ export default function Affiliate() { @@ -519,9 +534,7 @@ export default function Affiliate() {