sync(theme-3): 从 main 同步优胜赛结算态与钱包流水展示优化
- checkout shared/api/admin 自 d3c2114
- player: outright 结算态逻辑、wallet txAmountClass、i18n 新增 key(保留主题 CSS 变量)
This commit is contained in:
@@ -112,6 +112,11 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Cannot unpublish league after outright market is settled',
|
||||
'ms-MY': 'Liga tidak boleh ditarik selepas pasaran juara diselesaikan',
|
||||
},
|
||||
LEAGUE_OUTRIGHT_SETTLED: {
|
||||
'zh-CN': '优胜赛已结算,不可再新增单场',
|
||||
'en-US': 'Outright market is settled; new fixtures cannot be added',
|
||||
'ms-MY': 'Pasaran juara telah diselesaikan; perlawanan baharu tidak boleh ditambah',
|
||||
},
|
||||
MATCH_UNPUBLISH_FORBIDDEN: {
|
||||
'zh-CN': '当前状态不可下架',
|
||||
'en-US': 'Match cannot be unpublished in current status',
|
||||
@@ -747,6 +752,26 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Batch already confirmed',
|
||||
'ms-MY': 'Batch sudah disahkan',
|
||||
},
|
||||
SETTLEMENT_BATCH_STALE: {
|
||||
'zh-CN': '结算批次已过期,请使用最新预览批次',
|
||||
'en-US': 'Settlement batch is stale; use the latest preview batch',
|
||||
'ms-MY': 'Batch penyelesaian lapuk; guna batch pratonton terkini',
|
||||
},
|
||||
SETTLEMENT_BET_UPDATE_FAILED: {
|
||||
'zh-CN': '注单 {betNo} 结算状态更新失败,请重试',
|
||||
'en-US': 'Failed to update bet {betNo} for settlement',
|
||||
'ms-MY': 'Gagal mengemas kini pertaruhan {betNo} untuk penyelesaian',
|
||||
},
|
||||
SETTLEMENT_SCORE_INVALID: {
|
||||
'zh-CN': '比分无效:半场比分不能大于全场比分',
|
||||
'en-US': 'Invalid score: half-time cannot exceed full-time',
|
||||
'ms-MY': 'Skor tidak sah: separuh masa tidak boleh melebihi masa penuh',
|
||||
},
|
||||
SETTLEMENT_MARKET_UNSUPPORTED: {
|
||||
'zh-CN': '盘口 {marketType} 暂不支持结算',
|
||||
'en-US': 'Market type {marketType} is not supported for settlement',
|
||||
'ms-MY': 'Jenis pasaran {marketType} belum disokong untuk penyelesaian',
|
||||
},
|
||||
SCORE_NOT_FOUND: {
|
||||
'zh-CN': '比分不存在',
|
||||
'en-US': 'Score not found',
|
||||
|
||||
@@ -114,6 +114,11 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Cannot unpublish league after outright market is settled',
|
||||
'ms-MY': 'Liga tidak boleh ditarik selepas pasaran juara diselesaikan',
|
||||
},
|
||||
LEAGUE_OUTRIGHT_SETTLED: {
|
||||
'zh-CN': '优胜赛已结算,不可再新增单场',
|
||||
'en-US': 'Outright market is settled; new fixtures cannot be added',
|
||||
'ms-MY': 'Pasaran juara telah diselesaikan; perlawanan baharu tidak boleh ditambah',
|
||||
},
|
||||
MATCH_UNPUBLISH_FORBIDDEN: {
|
||||
'zh-CN': '当前状态不可下架',
|
||||
'en-US': 'Match cannot be unpublished in current status',
|
||||
@@ -749,6 +754,26 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Batch already confirmed',
|
||||
'ms-MY': 'Batch sudah disahkan',
|
||||
},
|
||||
SETTLEMENT_BATCH_STALE: {
|
||||
'zh-CN': '结算批次已过期,请使用最新预览批次',
|
||||
'en-US': 'Settlement batch is stale; use the latest preview batch',
|
||||
'ms-MY': 'Batch penyelesaian lapuk; guna batch pratonton terkini',
|
||||
},
|
||||
SETTLEMENT_BET_UPDATE_FAILED: {
|
||||
'zh-CN': '注单 {betNo} 结算状态更新失败,请重试',
|
||||
'en-US': 'Failed to update bet {betNo} for settlement',
|
||||
'ms-MY': 'Gagal mengemas kini pertaruhan {betNo} untuk penyelesaian',
|
||||
},
|
||||
SETTLEMENT_SCORE_INVALID: {
|
||||
'zh-CN': '比分无效:半场比分不能大于全场比分',
|
||||
'en-US': 'Invalid score: half-time cannot exceed full-time',
|
||||
'ms-MY': 'Skor tidak sah: separuh masa tidak boleh melebihi masa penuh',
|
||||
},
|
||||
SETTLEMENT_MARKET_UNSUPPORTED: {
|
||||
'zh-CN': '盘口 {marketType} 暂不支持结算',
|
||||
'en-US': 'Market type {marketType} is not supported for settlement',
|
||||
'ms-MY': 'Jenis pasaran {marketType} belum disokong untuk penyelesaian',
|
||||
},
|
||||
SCORE_NOT_FOUND: {
|
||||
'zh-CN': '比分不存在',
|
||||
'en-US': 'Score not found',
|
||||
|
||||
@@ -126,4 +126,5 @@ export * from './playerUsername';
|
||||
export * from './initial-depositRemark';
|
||||
export * from './phone-countries';
|
||||
export * from './match-time';
|
||||
export * from './walletTx';
|
||||
export * from './api-errors';
|
||||
|
||||
@@ -130,6 +130,7 @@ export * from './playerUsername';
|
||||
export * from './initial-depositRemark';
|
||||
export * from './phone-countries';
|
||||
export * from './match-time';
|
||||
export * from './walletTx';
|
||||
|
||||
export interface ApiResponse<T = unknown> {
|
||||
success: boolean;
|
||||
|
||||
11
packages/shared/src/walletTx.js
Normal file
11
packages/shared/src/walletTx.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/** 钱包流水展示用金额:输单结算 amount 为 0(可用余额未变),用冻结差额表示亏损 */
|
||||
export function txDisplayAmount(tx) {
|
||||
const type = tx.transactionType.toUpperCase();
|
||||
const amt = parseFloat(tx.amount);
|
||||
if (type === 'BET_SETTLE_LOSE' && amt === 0 && tx.frozenBefore != null && tx.frozenAfter != null) {
|
||||
const frozenDelta = parseFloat(tx.frozenBefore) - parseFloat(tx.frozenAfter);
|
||||
if (frozenDelta > 0)
|
||||
return (-frozenDelta).toString();
|
||||
}
|
||||
return tx.amount;
|
||||
}
|
||||
15
packages/shared/src/walletTx.ts
Normal file
15
packages/shared/src/walletTx.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/** 钱包流水展示用金额:输单结算 amount 为 0(可用余额未变),用冻结差额表示亏损 */
|
||||
export function txDisplayAmount(tx: {
|
||||
transactionType: string;
|
||||
amount: string;
|
||||
frozenBefore?: string;
|
||||
frozenAfter?: string;
|
||||
}): string {
|
||||
const type = tx.transactionType.toUpperCase();
|
||||
const amt = parseFloat(tx.amount);
|
||||
if (type === 'BET_SETTLE_LOSE' && amt === 0 && tx.frozenBefore != null && tx.frozenAfter != null) {
|
||||
const frozenDelta = parseFloat(tx.frozenBefore) - parseFloat(tx.frozenAfter);
|
||||
if (frozenDelta > 0) return (-frozenDelta).toString();
|
||||
}
|
||||
return tx.amount;
|
||||
}
|
||||
Reference in New Issue
Block a user