feat: 佣金提现和备注功能

This commit is contained in:
2025-09-16 04:51:27 -07:00
parent 5db1e8b15a
commit 6c40fde269
2 changed files with 28 additions and 9 deletions
@@ -55,7 +55,7 @@ const WalletDialog: WalletDialogProps = (props) => {
const { currency } = common;
// 定义支持的账户类型
const ACCOUNT_TYPE = ['USDT', '微信', '支付宝'] as const;
const ACCOUNT_TYPE = ['USDT(TRC20)', '微信', '支付宝'] as const;
// 根据账户类型定义 Zod 验证模式
const formSchema = z
@@ -76,11 +76,11 @@ const WalletDialog: WalletDialogProps = (props) => {
})
.superRefine((data, ctx) => {
// 根据提现方式进行条件验证
if (data.type === 'USDT') {
if (data.type === 'USDT(TRC20)') {
if (!data.account || data.account.trim().length === 0) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'USDT 账号不能为空',
message: 'USDT(TRC20) 账号不能为空',
path: ['account'],
});
}
@@ -111,7 +111,7 @@ const WalletDialog: WalletDialogProps = (props) => {
// 构建 title 和 description
const title = `提现金额-${data.money}`;
let description = '';
if (data.type === 'USDT') {
if (data.type === 'USDT(TRC20)') {
description = `${data.type}-${data.account || ''}`;
} else if (data.type === '微信' || data.type === '支付宝') {
description = `${data.type}-${data.avatar || ''}`;
@@ -181,7 +181,7 @@ const WalletDialog: WalletDialogProps = (props) => {
// 根据提现方式动态生成弹窗描述
const getModalDescription = () => {
if (currentType === 'USDT') {
if (currentType === 'USDT(TRC20)') {
const accountInfo = account || '未知地址';
return `请确认您的提现地址及金额无误,您将提现${money}RMB至${accountInfo}地址账号。`;
} else {
@@ -214,7 +214,7 @@ const WalletDialog: WalletDialogProps = (props) => {
</DialogHeader>
<div className={'pt-4'}>
<div className={'pb-2 text-sm font-semibold text-[#7A7A7A]'}>
{currentType === 'USDT'
{currentType === 'USDT(TRC20)'
? '将佣金提现至您的个人数字钱包,无手续费'
: '该提现方式需10%手续费,该费率由支付平台收取'}
</div>
@@ -250,8 +250,8 @@ const WalletDialog: WalletDialogProps = (props) => {
)}
/>
{/* 提现账号输入(仅当选择USDT时显示) */}
{currentType === 'USDT' && (
{/* 提现账号输入(仅当选择USDT(TRC20)时显示) */}
{currentType === 'USDT(TRC20)' && (
<FormField
control={form.control}
name='account'