mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
feat: 🎨 在config中新增5个便捷功能选项,更加简单便捷配置以及使用代码。优化部分冗余的代码
This commit is contained in:
@@ -21,6 +21,20 @@ export function unitPrice(val, unit, location) {
|
||||
return (unit || "") + price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化价格 1999 --> [1999,00]
|
||||
* @param {*} val
|
||||
* @returns
|
||||
*/
|
||||
export function goodsFormatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
let valNum = new Number(val);
|
||||
return valNum.toFixed(2).split(".");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 脱敏姓名
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user