feat: 开户备注、账单展示优化与后台代理管理增强

- 新增初始上分备注(日常上分/开户赠金/自定义)及前后台校验与展示

- 优化钱包流水类型与备注显示,区分管理员/代理/玩家上下分

- 修复登录后语言被后端覆盖的问题,登录时同步当前语言到服务端

- 后台代理/玩家表格操作栏重构,充值订单增加备注列

- 前台个人中心、充值、账单与验证码组件体验优化

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-11 17:23:58 +08:00
parent 10485ecfaf
commit 03e72ca9b2
46 changed files with 3721 additions and 1059 deletions

View File

@@ -0,0 +1,21 @@
import {
type InitialDepositRemarkKind,
type InitialDepositOperator,
resolveInitialDepositRemark,
} from '@thebet365/shared';
import { FormValidationError } from '../i18n/form-validation';
export function buildInitialDepositRemark(
initialDeposit: number,
kind: InitialDepositRemarkKind | '',
custom: string,
operator: InitialDepositOperator,
): string | undefined {
if (initialDeposit <= 0) return undefined;
if (!kind) throw new FormValidationError('err.initial_deposit_kind_required');
try {
return resolveInitialDepositRemark(kind, custom, operator);
} catch {
throw new FormValidationError('err.initial_deposit_custom_required');
}
}

View File

@@ -1,6 +1,11 @@
export const TX_KEY_MAP: Record<string, string> = {
MANUAL_DEPOSIT: 'finance.tx.deposit',
ADMIN_DEPOSIT: 'finance.tx.admin_deposit',
AGENT_DEPOSIT: 'finance.tx.agent_deposit',
INITIAL_DEPOSIT: 'finance.tx.admin_deposit',
MANUAL_WITHDRAW: 'finance.tx.withdraw',
ADMIN_WITHDRAW: 'finance.tx.admin_withdraw',
AGENT_WITHDRAW: 'finance.tx.agent_withdraw',
MANUAL_ADJUST: 'finance.tx.adjust',
BET_FREEZE: 'finance.tx.bet_freeze',
BET_DEDUCT: 'finance.tx.bet_deduct',
@@ -16,7 +21,7 @@ export const TX_KEY_MAP: Record<string, string> = {
RESETTLE_REVERSE: 'finance.tx.resettle',
DEPOSIT: 'finance.tx.deposit',
WITHDRAW: 'finance.tx.withdraw',
PLAYER_DEPOSIT: 'finance.tx.deposit',
PLAYER_DEPOSIT: 'finance.tx.player_deposit',
};
export function walletTxTypeKey(type: string): string {
@@ -25,6 +30,9 @@ export function walletTxTypeKey(type: string): string {
export const DEPOSIT_RECHARGE_TYPES = new Set([
'MANUAL_DEPOSIT',
'ADMIN_DEPOSIT',
'AGENT_DEPOSIT',
'INITIAL_DEPOSIT',
'DEPOSIT',
'PLAYER_DEPOSIT',
]);
@@ -49,5 +57,10 @@ export function walletDepositMethodLabel(
const key = DEPOSIT_METHOD_KEY_MAP[row.depositMethodKey];
return key ? t(key) : row.depositMethodKey;
}
const type = row.transactionType.toUpperCase();
if (type === 'ADMIN_DEPOSIT') return t('finance.tx.admin_deposit');
if (type === 'AGENT_DEPOSIT') return t('finance.tx.agent_deposit');
if (type === 'INITIAL_DEPOSIT') return t('finance.tx.admin_deposit');
if (type === 'PLAYER_DEPOSIT') return t('finance.tx.player_deposit');
return '—';
}