Skip to content

Let's use AI to Earn!

Revert "is 1"

gaoSir3fe2979eb8f2
diff --git a/src/app/[lng]/income/page.tsx b/src/app/[lng]/income/page.tsx
index 6df84bdd..073ff598 100644
--- a/src/app/[lng]/income/page.tsx
+++ b/src/app/[lng]/income/page.tsx
@@ -18,7 +18,7 @@ const { Option } = Select;
export default function IncomePage() {
const router = useRouter();
const { userInfo, token } = useUserStore();
- const { t } = useTransClient('income' as any);
+ const { t } = useTransClient('income');
// 收入记录相关状态
const [incomeRecords, setIncomeRecords] = useState<IncomeRecord[]>([]);
@@ -53,10 +53,10 @@ export default function IncomePage() {
setIncomePagination({
current: page,
pageSize,
- total: (response.data as any).total || 0
+ total: response.data.total || 0
});
} else {
- message.error(t('messages.getIncomeRecordsFailed' as any));
+ message.error(t('messages.getIncomeRecordsFailed'));
}
} catch (error) {
message.error(t('messages.getIncomeRecordsFailed'));
@@ -78,7 +78,7 @@ export default function IncomePage() {
total: response.data.total || 0
});
} else {
- message.error(t('messages.getWithdrawRecordsFailed' as any));
+ message.error(t('messages.getWithdrawRecordsFailed'));
}
} catch (error) {
message.error(t('messages.getWithdrawRecordsFailed'));
@@ -101,13 +101,13 @@ export default function IncomePage() {
try {
const response = await apiSubmitWithdraw(selectedIncomeRecord._id);
if (response) {
- message.success(t('messages.withdrawSubmitted' as any));
+ message.success(t('messages.withdrawSubmitted'));
setWithdrawModalVisible(false);
setSelectedIncomeRecord(null);
// 刷新提现记录
fetchWithdrawRecords(withdrawPagination.current, withdrawPagination.pageSize);
} else {
- message.error(t('messages.withdrawFailed' as any));
+ message.error(t('messages.withdrawFailed'));
}
} catch (error) {
message.error(t('messages.withdrawFailed'));
@@ -119,9 +119,9 @@ export default function IncomePage() {
// 获取收入类型显示文本
const getIncomeTypeText = (type: string) => {
const typeMap: { [key: string]: { color: string; text: string } } = {
- 'task': { color: 'green', text: t('incomeTypes.task' as any) },
- 'task_back': { color: 'orange', text: t('incomeTypes.task_back' as any) },
- 'reward_back': { color: 'blue', text: t('incomeTypes.reward_back' as any) }
+ 'task': { color: 'green', text: t('incomeTypes.task') },
+ 'task_back': { color: 'orange', text: t('incomeTypes.task_back') },
+ 'reward_back': { color: 'blue', text: t('incomeTypes.reward_back') }
};
const config = typeMap[type] || { color: 'default', text: type };
return <Tag color={config.color}>{config.text}</Tag>;
@@ -130,9 +130,9 @@ export default function IncomePage() {
// 获取提现状态显示
const getWithdrawStatusTag = (status: WithdrawRecordStatus) => {
const statusMap = {
- [WithdrawRecordStatus.WAIT]: { color: 'orange', text: t('withdrawStatus.wait' as any), icon: <ClockCircleOutlined /> },
- [WithdrawRecordStatus.SUCCESS]: { color: 'green', text: t('withdrawStatus.success' as any), icon: <CheckCircleOutlined /> },
- [WithdrawRecordStatus.FAIL]: { color: 'red', text: t('withdrawStatus.fail' as any), icon: <CloseCircleOutlined /> }
+ [WithdrawRecordStatus.WAIT]: { color: 'orange', text: t('withdrawStatus.wait'), icon: <ClockCircleOutlined /> },
+ [WithdrawRecordStatus.SUCCESS]: { color: 'green', text: t('withdrawStatus.success'), icon: <CheckCircleOutlined /> },
+ [WithdrawRecordStatus.FAIL]: { color: 'red', text: t('withdrawStatus.fail'), icon: <CloseCircleOutlined /> }
};
const config = statusMap[status] || { color: 'default', text: '未知状态', icon: null };
return (
@@ -145,14 +145,14 @@ export default function IncomePage() {
// 收入记录表格列
const incomeColumns = [
{
- title: t('incomeId' as any),
+ title: t('incomeId'),
dataIndex: '_id',
key: '_id',
ellipsis: true,
width: 200,
},
{
- title: t('amount' as any),
+ title: t('amount'),
dataIndex: 'amount',
key: 'amount',
render: (amount: number) => (
@@ -162,25 +162,25 @@ export default function IncomePage() {
),
},
{
- title: t('type' as any),
+ title: t('type'),
dataIndex: 'type',
key: 'type',
render: (type: string) => getIncomeTypeText(type),
},
{
- title: t('description' as any),
+ title: t('description'),
dataIndex: 'desc',
key: 'desc',
ellipsis: true,
},
{
- title: t('createTime' as any),
+ title: t('createTime'),
dataIndex: 'createdAt',
key: 'createdAt',
render: (date: Date) => new Date(date).toLocaleString(),
},
{
- title: t('actions' as any),
+ title: t('actions'),
key: 'action',
render: (_: any, record: IncomeRecord) => (
<Space>
@@ -190,7 +190,7 @@ export default function IncomePage() {
onClick={() => handleWithdraw(record)}
disabled={record.type !== 'task'} // 只有任务收入可以提现
>
- {t('applyWithdraw' as any)}
+ {t('applyWithdraw')}
</Button>
</Space>
),
@@ -200,14 +200,14 @@ export default function IncomePage() {
// 提现记录表格列
const withdrawColumns = [
{
- title: t('withdrawId' as any),
+ title: t('withdrawId'),
dataIndex: '_id',
key: '_id',
ellipsis: true,
width: 200,
},
{
- title: t('amount' as any),
+ title: t('amount'),
dataIndex: 'amount',
key: 'amount',
render: (amount: number) => (
@@ -217,25 +217,25 @@ export default function IncomePage() {
),
},
{
- title: t('status' as any),
+ title: t('status'),
dataIndex: 'status',
key: 'status',
render: (status: WithdrawRecordStatus) => getWithdrawStatusTag(status),
},
{
- title: t('description' as any),
+ title: t('description'),
dataIndex: 'desc',
key: 'desc',
ellipsis: true,
},
{
- title: t('createTime' as any),
+ title: t('createTime'),
dataIndex: 'createdAt',
key: 'createdAt',
render: (date: Date) => new Date(date).toLocaleString(),
},
{
- title: t('updateTime' as any),
+ title: t('updateTime'),
dataIndex: 'updatedAt',
key: 'updatedAt',
render: (date: Date) => new Date(date).toLocaleString(),
@@ -244,7 +244,7 @@ export default function IncomePage() {
useEffect(() => {
if (!token) {
- message.error(t('messages.pleaseLoginFirst' as any));
+ message.error(t('messages.pleaseLoginFirst'));
router.push('/login');
return;
}
@@ -264,8 +264,8 @@ export default function IncomePage() {
<DollarOutlined />
</div>
<div className={styles.headerText}>
- <h1 className={styles.headerTitle}>{t('title' as any)}</h1>
- <p className={styles.headerSubtitle}>{t('subtitle' as any)}</p>
+ <h1 className={styles.headerTitle}>{t('title')}</h1>
+ <p className={styles.headerSubtitle}>{t('subtitle')}</p>
</div>
</div>
<div className={styles.headerRight}>
@@ -274,8 +274,8 @@ export default function IncomePage() {
<WalletOutlined />
</div>
<div className={styles.balanceInfo}>
- <div className={styles.balanceLabel}>{t('currentBalance' as any)}</div>
- <div className={styles.balanceAmount}>¥ {userInfo?.income || 0}</div>
+ <div className={styles.balanceLabel}>{t('currentBalance')}</div>
+ <div className={styles.balanceAmount}>${userInfo?.income || 0}</div>
</div>
</div>
</div>
@@ -289,7 +289,7 @@ export default function IncomePage() {
tab={
<span>
<DollarOutlined />
- {t('incomeRecords' as any)}
+ {t('incomeRecords')}
</span>
}
key="income"
@@ -309,12 +309,12 @@ export default function IncomePage() {
},
showSizeChanger: true,
showQuickJumper: true,
- showTotal: (total) => t('messages.totalRecords' as any, { total }),
+ showTotal: (total) => t('messages.totalRecords', { total }),
pageSizeOptions: ['10', '20', '50'],
}}
scroll={{ x: 800 }}
locale={{
- emptyText: incomeLoading ? t('messages.loading' as any) : t('messages.noIncomeRecords' as any)
+ emptyText: incomeLoading ? t('messages.loading') : t('messages.noIncomeRecords')
}}
/>
</Card>
@@ -324,7 +324,7 @@ export default function IncomePage() {
tab={
<span>
<HistoryOutlined />
- {t('withdrawRecords' as any)}
+ {t('withdrawRecords')}
</span>
}
key="withdraw"
@@ -344,12 +344,12 @@ export default function IncomePage() {
},
showSizeChanger: true,
showQuickJumper: true,
- showTotal: (total) => t('messages.totalRecords' as any, { total }),
+ showTotal: (total) => t('messages.totalRecords', { total }),
pageSizeOptions: ['10', '20', '50'],
}}
scroll={{ x: 800 }}
locale={{
- emptyText: withdrawLoading ? t('messages.loading' as any) : t('messages.noWithdrawRecords' as any)
+ emptyText: withdrawLoading ? t('messages.loading') : t('messages.noWithdrawRecords')
}}
/>
</Card>
@@ -359,7 +359,7 @@ export default function IncomePage() {
{/* 提现确认弹窗 */}
<Modal
- title={t('confirmWithdraw' as any)}
+ title={t('confirmWithdraw')}
open={withdrawModalVisible}
onCancel={() => {
setWithdrawModalVisible(false);
@@ -370,7 +370,7 @@ export default function IncomePage() {
setWithdrawModalVisible(false);
setSelectedIncomeRecord(null);
}}>
- {t('cancel' as any)}
+ {t('cancel')}
</Button>,
<Button
key="confirm"
@@ -378,7 +378,7 @@ export default function IncomePage() {
loading={withdrawSubmitting}
onClick={handleConfirmWithdraw}
>
- {t('confirm' as any)}
+ {t('confirm')}
</Button>
]}
width={500}
@@ -388,27 +388,27 @@ export default function IncomePage() {
<div className={styles.withdrawModalContent}>
<div className={styles.withdrawInfo}>
<div className={styles.withdrawItem}>
- <span className={styles.withdrawLabel}>{t('incomeId' as any)}:</span>
+ <span className={styles.withdrawLabel}>{t('incomeId')}:</span>
<span className={styles.withdrawValue}>{selectedIncomeRecord._id}</span>
</div>
<div className={styles.withdrawItem}>
- <span className={styles.withdrawLabel}>{t('withdrawAmount' as any)}:</span>
+ <span className={styles.withdrawLabel}>{t('withdrawAmount')}:</span>
<span className={styles.withdrawAmount}>${selectedIncomeRecord.amount.toFixed(2)}</span>
</div>
<div className={styles.withdrawItem}>
- <span className={styles.withdrawLabel}>{t('incomeType' as any)}:</span>
+ <span className={styles.withdrawLabel}>{t('incomeType')}:</span>
<span>{getIncomeTypeText(selectedIncomeRecord.type)}</span>
</div>
{selectedIncomeRecord.desc && (
<div className={styles.withdrawItem}>
- <span className={styles.withdrawLabel}>{t('description' as any)}:</span>
+ <span className={styles.withdrawLabel}>{t('description')}:</span>
<span className={styles.withdrawValue}>{selectedIncomeRecord.desc}</span>
</div>
)}
</div>
<div className={styles.withdrawWarning}>
- <p>{t('withdrawWarning' as any)}</p>
- <p>{t('withdrawWarning2' as any)}</p>
+ <p>{t('withdrawWarning')}</p>
+ <p>{t('withdrawWarning2')}</p>
</div>
</div>
)}