feat: 佣金提现和备注功能
This commit is contained in:
parent
5db1e8b15a
commit
6c40fde269
@ -59,6 +59,25 @@ export default function Page() {
|
|||||||
accessorKey: 'title',
|
accessorKey: 'title',
|
||||||
header: t('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',
|
accessorKey: 'user_id',
|
||||||
header: t('user'),
|
header: t('user'),
|
||||||
@ -70,7 +89,7 @@ export default function Page() {
|
|||||||
cell: ({ row }) => formatDate(row.getValue('updated_at')),
|
cell: ({ row }) => formatDate(row.getValue('updated_at')),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/* params={[
|
/*params={[
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
placeholder: t('status.0'),
|
placeholder: t('status.0'),
|
||||||
|
|||||||
@ -55,7 +55,7 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
const { currency } = common;
|
const { currency } = common;
|
||||||
|
|
||||||
// 定义支持的账户类型
|
// 定义支持的账户类型
|
||||||
const ACCOUNT_TYPE = ['USDT', '微信', '支付宝'] as const;
|
const ACCOUNT_TYPE = ['USDT(TRC20)', '微信', '支付宝'] as const;
|
||||||
|
|
||||||
// 根据账户类型定义 Zod 验证模式
|
// 根据账户类型定义 Zod 验证模式
|
||||||
const formSchema = z
|
const formSchema = z
|
||||||
@ -76,11 +76,11 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
})
|
})
|
||||||
.superRefine((data, ctx) => {
|
.superRefine((data, ctx) => {
|
||||||
// 根据提现方式进行条件验证
|
// 根据提现方式进行条件验证
|
||||||
if (data.type === 'USDT') {
|
if (data.type === 'USDT(TRC20)') {
|
||||||
if (!data.account || data.account.trim().length === 0) {
|
if (!data.account || data.account.trim().length === 0) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
message: 'USDT 账号不能为空',
|
message: 'USDT(TRC20) 账号不能为空',
|
||||||
path: ['account'],
|
path: ['account'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
// 构建 title 和 description
|
// 构建 title 和 description
|
||||||
const title = `提现金额-${data.money}`;
|
const title = `提现金额-${data.money}`;
|
||||||
let description = '';
|
let description = '';
|
||||||
if (data.type === 'USDT') {
|
if (data.type === 'USDT(TRC20)') {
|
||||||
description = `${data.type}-${data.account || ''}`;
|
description = `${data.type}-${data.account || ''}`;
|
||||||
} else if (data.type === '微信' || data.type === '支付宝') {
|
} else if (data.type === '微信' || data.type === '支付宝') {
|
||||||
description = `${data.type}-${data.avatar || ''}`;
|
description = `${data.type}-${data.avatar || ''}`;
|
||||||
@ -181,7 +181,7 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
|
|
||||||
// 根据提现方式动态生成弹窗描述
|
// 根据提现方式动态生成弹窗描述
|
||||||
const getModalDescription = () => {
|
const getModalDescription = () => {
|
||||||
if (currentType === 'USDT') {
|
if (currentType === 'USDT(TRC20)') {
|
||||||
const accountInfo = account || '未知地址';
|
const accountInfo = account || '未知地址';
|
||||||
return `请确认您的提现地址及金额无误,您将提现${money}RMB至${accountInfo}地址账号。`;
|
return `请确认您的提现地址及金额无误,您将提现${money}RMB至${accountInfo}地址账号。`;
|
||||||
} else {
|
} else {
|
||||||
@ -214,7 +214,7 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className={'pt-4'}>
|
<div className={'pt-4'}>
|
||||||
<div className={'pb-2 text-sm font-semibold text-[#7A7A7A]'}>
|
<div className={'pb-2 text-sm font-semibold text-[#7A7A7A]'}>
|
||||||
{currentType === 'USDT'
|
{currentType === 'USDT(TRC20)'
|
||||||
? '将佣金提现至您的个人数字钱包,无手续费'
|
? '将佣金提现至您的个人数字钱包,无手续费'
|
||||||
: '该提现方式需10%手续费,该费率由支付平台收取'}
|
: '该提现方式需10%手续费,该费率由支付平台收取'}
|
||||||
</div>
|
</div>
|
||||||
@ -250,8 +250,8 @@ const WalletDialog: WalletDialogProps = (props) => {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 提现账号输入(仅当选择USDT时显示) */}
|
{/* 提现账号输入(仅当选择USDT(TRC20)时显示) */}
|
||||||
{currentType === 'USDT' && (
|
{currentType === 'USDT(TRC20)' && (
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name='account'
|
name='account'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user