修复(#14): 调整 USDT 提现方式枚举口径

This commit is contained in:
2026-06-09 03:30:57 -07:00
parent 3aae43f539
commit 883ffab1a6
2 changed files with 9 additions and 20 deletions
+2 -4
View File
@@ -44,8 +44,7 @@ const WITHDRAWAL_METHOD_MAP: Record<number, string> = {
0: "其他", 0: "其他",
1: "支付宝", 1: "支付宝",
2: "微信", 2: "微信",
3: "银行卡", 3: "USDT(TRC20)",
4: "USDT(TRC20)",
}; };
const rejectSchema = z.object({ const rejectSchema = z.object({
@@ -144,8 +143,7 @@ export default function WithdrawalPage() {
const methodOptions = [ const methodOptions = [
{ value: "1", label: "支付宝" }, { value: "1", label: "支付宝" },
{ value: "2", label: "微信" }, { value: "2", label: "微信" },
{ value: "3", label: "银行卡" }, { value: "3", label: "USDT(TRC20)" },
{ value: "4", label: "USDT(TRC20)" },
{ value: "0", label: "其他" }, { value: "0", label: "其他" },
]; ];
@@ -63,8 +63,7 @@ import { useGlobalStore } from "@/stores/global";
const WITHDRAWAL_METHODS = [ const WITHDRAWAL_METHODS = [
{ value: 1, label: "支付宝" }, { value: 1, label: "支付宝" },
{ value: 2, label: "微信" }, { value: 2, label: "微信" },
{ value: 3, label: "银行卡" }, { value: 3, label: "USDT(TRC20)" },
{ value: 4, label: "USDT(TRC20)" },
{ value: 0, label: "其他" }, { value: 0, label: "其他" },
] as const; ] as const;
@@ -158,14 +157,11 @@ const withdrawalFormSchema = z
path: ["qr_code_url"], path: ["qr_code_url"],
}); });
} }
} else if (data.method === 3 || data.method === 4) { } else if (data.method === 3) {
if (!data.account) { if (!data.account) {
ctx.addIssue({ ctx.addIssue({
code: z.ZodIssueCode.custom, code: z.ZodIssueCode.custom,
message: message: "USDT(TRC20) 地址为必填",
data.method === 4
? "USDT(TRC20) 地址为必填"
: "银行卡收款账号为必填",
path: ["account"], path: ["account"],
}); });
} }
@@ -466,9 +462,7 @@ export default function Affiliate() {
/> />
)} )}
{(watchedMethod === 3 || {(watchedMethod === 3 || watchedMethod === 0) && (
watchedMethod === 4 ||
watchedMethod === 0) && (
<FormField <FormField
control={withdrawalForm.control} control={withdrawalForm.control}
name="account" name="account"
@@ -476,8 +470,7 @@ export default function Affiliate() {
<FormItem> <FormItem>
<FormLabel> <FormLabel>
{(watchedMethod === 3 || {watchedMethod === 3 && (
watchedMethod === 4) && (
<span className="ml-1 text-destructive"> <span className="ml-1 text-destructive">
* *
</span> </span>
@@ -486,11 +479,9 @@ export default function Affiliate() {
<FormControl> <FormControl>
<Input <Input
placeholder={ placeholder={
watchedMethod === 4 watchedMethod === 3
? "请输入 USDT(TRC20) 收款地址" ? "请输入 USDT(TRC20) 收款地址"
: watchedMethod === 3 : "请输入收款账号(与备注至少填一项)"
? "请输入银行卡号或账户信息"
: "请输入收款账号(与备注至少填一项)"
} }
{...field} {...field}
/> />