Compare commits

..

5 Commits

Author SHA1 Message Date
shanshanzhong147 a6246c2453 修复(#14): 过滤提现查询非法用户ID 2026-06-09 07:19:00 -07:00
shanshanzhong147 09c5216f60 修复(#14): 调整 USDT 提现方式枚举口径
PR Check / Lint, Check, Test and Build (push) Has been cancelled
Build and Release / Build (push) Has been cancelled
2026-06-09 06:37:15 -07:00
shanshanzhong147 4d84095af2 修复(#14): 支持 USDT 提现方式展示 2026-06-09 06:37:14 -07:00
shanshanzhong147 d66b664198 修复(#122): 补齐促销价档位提交
PR Check / Lint, Check, Test and Build (push) Has been cancelled
Build and Release / Build (push) Has been cancelled
2026-05-29 02:36:30 -07:00
shanshanzhong147 a7d89acc7f 新功能(#113): 发布促销管理后台页面到main
PR Check / Lint, Check, Test and Build (push) Has been cancelled
Build and Release / Build (push) Has been cancelled
2026-05-29 00:40:33 -07:00
2 changed files with 34 additions and 24 deletions
+11 -5
View File
@@ -44,7 +44,7 @@ const WITHDRAWAL_METHOD_MAP: Record<number, string> = {
0: "其他",
1: "支付宝",
2: "微信",
3: "银行卡",
3: "USDT(TRC20)",
};
const rejectSchema = z.object({
@@ -55,6 +55,12 @@ const rejectSchema = z.object({
.max(500, "拒绝原因不能超过 500 个字符"),
});
function toOptionalNumber(value?: string) {
if (!value) return;
const parsed = Number(value);
return Number.isFinite(parsed) ? parsed : undefined;
}
function QrCodeCell({ url }: { url?: string }) {
const [zoomOpen, setZoomOpen] = useState(false);
if (!url) return <span>--</span>;
@@ -143,7 +149,7 @@ export default function WithdrawalPage() {
const methodOptions = [
{ value: "1", label: "支付宝" },
{ value: "2", label: "微信" },
{ value: "3", label: "银行卡" },
{ value: "3", label: "USDT(TRC20)" },
{ value: "0", label: "其他" },
];
@@ -309,9 +315,9 @@ export default function WithdrawalPage() {
const { data } = await getWithdrawalList({
page: pagination.page,
size: pagination.size,
status: filter.status ? Number(filter.status) : undefined,
method: filter.method ? Number(filter.method) : undefined,
user_id: filter.user_id ? Number(filter.user_id) : undefined,
status: toOptionalNumber(filter.status),
method: toOptionalNumber(filter.method),
user_id: toOptionalNumber(filter.user_id),
});
return {
+23 -19
View File
@@ -63,7 +63,7 @@ import { useGlobalStore } from "@/stores/global";
const WITHDRAWAL_METHODS = [
{ value: 1, label: "支付宝" },
{ value: 2, label: "微信" },
{ value: 3, label: "银行卡" },
{ value: 3, label: "USDT(TRC20)" },
{ value: 0, label: "其他" },
] as const;
@@ -111,13 +111,21 @@ function QrCodeView({ url }: { url: string }) {
<img
alt="收款码"
className="h-16 w-16 cursor-zoom-in object-cover"
height={64}
src={url}
width={64}
/>
</button>
{zoomOpen && (
<Dialog onOpenChange={setZoomOpen} open={zoomOpen}>
<DialogContent className="max-w-sm">
<img alt="收款码" className="w-full" src={url} />
<img
alt="收款码"
className="w-full"
height={320}
src={url}
width={320}
/>
</DialogContent>
</Dialog>
)}
@@ -153,18 +161,16 @@ const withdrawalFormSchema = z
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: "USDT(TRC20) 地址为必填",
path: ["account"],
});
}
} else if (data.method === 0 && !(data.account || data.content)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: "收款账号和备注至少填一项",
path: ["account"],
});
}
});
@@ -421,9 +427,7 @@ export default function Affiliate() {
<FormItem>
<FormLabel>
<span className="ml-1 text-destructive">
*
</span>
<span className="ml-1 text-destructive">*</span>
</FormLabel>
{watchedQrCodeUrl ? (
<div className="relative inline-block">
@@ -446,7 +450,9 @@ export default function Affiliate() {
returnType="file"
>
<div className="flex h-24 w-24 flex-col items-center justify-center rounded border-2 border-dashed text-muted-foreground text-xs">
{qrUploading ? "上传中..." : "点击上传\n收款码"}
{qrUploading
? "上传中..."
: "点击上传\n收款码"}
</div>
</UploadImage>
)}
@@ -474,7 +480,7 @@ export default function Affiliate() {
<Input
placeholder={
watchedMethod === 3
? "请输入银行卡号或账户信息"
? "请输入 USDT(TRC20) 收款地址"
: "请输入收款账号(与备注至少填一项)"
}
{...field}
@@ -519,9 +525,7 @@ export default function Affiliate() {
</Button>
<Button
disabled={
submitting ||
qrUploading ||
availableCommission <= 0
submitting || qrUploading || availableCommission <= 0
}
form="withdrawal-form"
type="submit"