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
@@ -5,6 +5,7 @@ import PageShell from '../../components/PageShell';
import SubPageHeader from '../../components/SubPageHeader';
import { request, toast } from '../../lib/api';
import { formatShanghaiDateTime } from '../../lib/datetime';
import { formatMoney } from '../../lib/money';
const LAST_REDEEM_RESULT_KEY = 'lastRedeemResult';
@@ -17,15 +18,6 @@ type RedeemRecord = {
createdAt: string;
};
function formatMoney(amount: number) {
const n = Number(amount);
if (!Number.isFinite(n)) return '0.00';
const fixed = n.toFixed(2);
const [intPart, dec] = fixed.split('.');
const withComma = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
return `${withComma}.${dec}`;
}
/** 与权益「历史记录」一致:2026-08-03 13:53:03Asia/Shanghai */
function formatChinaDateTime(input?: string | null) {
return formatShanghaiDateTime(input ?? new Date());