feat: 佣金提现和备注功能

This commit is contained in:
speakeloudest 2025-09-16 04:51:27 -07:00
parent 5db1e8b15a
commit 6c40fde269
2 changed files with 28 additions and 9 deletions

View File

@ -59,6 +59,25 @@ export default function Page() {
accessorKey: 'title',
header: t('title'),
},
{
accessorKey: 'status',
header: t('status.0'),
cell: ({ row }) => (
<span
className={cn(
'flex items-center gap-2 before:block before:size-1.5 before:animate-pulse before:rounded-full before:ring-2 before:ring-opacity-50',
{
'before:bg-rose-500 before:ring-rose-500': row.original.status === 1,
'before:bg-yellow-500 before:ring-yellow-500': row.original.status === 2,
'before:bg-green-500 before:ring-green-500': row.original.status === 3,
'before:bg-zinc-500 before:ring-zinc-500': row.original.status === 4,
},
)}
>
{row.original.status === 4 ? t(`status.${row.original.status}`) : t(`status.1`)}
</span>
),
},
{
accessorKey: 'user_id',
header: t('user'),
@ -70,7 +89,7 @@ export default function Page() {
cell: ({ row }) => formatDate(row.getValue('updated_at')),
},
]}
/* params={[
/*params={[
{
key: 'status',
placeholder: t('status.0'),

View File

@ -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'