添加地址功能:手机号需要添加正则验证

This commit is contained in:
cbb
2025-12-25 17:50:11 +08:00
parent 334c0800fa
commit 1aab94bbc3
91 changed files with 13903 additions and 24 deletions

15
utils/index.js Normal file
View File

@@ -0,0 +1,15 @@
/**
* 金额格式化
* @param {*} amount 金额
* @returns
*/
export const formatRMB = amount => {
const formatted = new Intl.NumberFormat('zh-CN', {
style: 'currency',
currency: 'CNY',
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(amount)
return formatted.replace(/^[¥\s]+/, '') // 移除开头的 ¥ 和可能的空格
}