- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态 - 玩家端:已结算 outright 只读展示并高亮冠军 - 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化 - shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
12 lines
540 B
JavaScript
12 lines
540 B
JavaScript
/** 钱包流水展示用金额:输单结算 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;
|
||
}
|