fix(mini-user): 微信小程序补 Intl 兜底并去掉 toLocaleString

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 14:53:54 +08:00
parent 04fd4d50d0
commit a7a0a54688
9 changed files with 93 additions and 26 deletions
@@ -104,9 +104,14 @@ function formatRedeemAmountYuan(amount: number | string) {
function formatRecentRedeemLine(row: RecentRedeem) {
try {
// 优先用服务端拼好的 text,避免客户端时区 / Intl 差异
if (row.text?.trim()) return row.text.trim();
const label = String(row.userLabel || '用户***').trim() || '用户***';
const time = formatRedeemTime(row.createdAt);
const rawTime = String(row.createdAt || '').trim();
const time =
/^\d{4}-\d{2}-\d{2}/.test(rawTime)
? rawTime.slice(0, 19).replace('T', ' ')
: formatRedeemTime(row.createdAt);
const amount = formatRedeemAmountYuan(row.amount);
return `${label} ${time} 核销${amount}`;
} catch {