新增:优惠券、积分明细

This commit is contained in:
2025-08-08 08:55:42 +08:00
parent 5dd0e97e3c
commit c82a56eef7
18 changed files with 1105 additions and 9 deletions

View File

@@ -108,6 +108,20 @@ export function truncateText(text: string, maxLength: number = 30): string {
return text.substring(0, maxLength);
}
/**
* 格式化货币
* @param amount
* @param currency
*/
export function formatCurrency(amount: number, currency: string = 'CNY'): string {
return new Intl.NumberFormat('zh-CN', {
style: 'currency',
currency: currency,
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(amount);
}
/**
* 生成订单标题
* @param goodsNames 商品名称数组