大屏显示优化
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-08-20 13:41:50 +08:00
parent 0a36188b35
commit 8b5bb6a981
2 changed files with 13 additions and 5 deletions
+13 -4
View File
@@ -41,11 +41,20 @@ function formatOrderTime(iso: string): string {
}
}
// function formatAmount(n: number): string {
// return Number(n || 0).toLocaleString('zh-CN', {
// minimumFractionDigits: 0,
// maximumFractionDigits: 0,
// });
// }
function formatAmount(n: number): string {
return Number(n || 0).toLocaleString('zh-CN', {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
const num = Number(n || 0);
// 先保留两位小数,再分割处理
const fixed = num.toFixed(2);
const [intStr, decStr] = fixed.split('.');
const intFormatted = Number(intStr).toLocaleString('zh-CN');
return decStr === '00' ? intFormatted : `${intFormatted}.${decStr}`;
}
function amountCssClass(payAmount: number, base: string): string {
@@ -32,7 +32,6 @@ export class AdminOrdersService {
startOfToday.setHours(0, 0, 0, 0);
const orders = await this.prisma.order.findMany({
where: {
payAmount: { gte: 100 },
payStatus: 'PAID',
paidAt: { gte: startOfToday },
},