feat: 更新了权益的样式
This commit is contained in:
1 parent
e675ecc3d7
commit
8f8ca96a82
9 files changed
+97
-450
No files matched your search
@@ -36,6 +36,14 @@ export const priceText = (val) => {
|
||||
return Number.isInteger(n) ? String(n) : n.toFixed(2).replace(/0+$/, "").replace(/\.$/, "");
|
||||
};
|
||||
|
||||
/** 折扣率文案(接口直给折扣,如 8 → 8 折;缺失或非法为空) */
|
||||
export const rateText = (val) => {
|
||||
if (val === null || val === undefined || val === "") return "";
|
||||
const n = Number(val);
|
||||
if (Number.isNaN(n) || n <= 0) return "";
|
||||
return `${priceText(n)} 折`;
|
||||
};
|
||||
|
||||
/**
|
||||
* 手机号中间四位打码
|
||||
* 接口只回 `phone_masked`(形如 `+86138****8000`),先去掉 +86 国码;
|
||||
@@ -80,6 +88,7 @@ export default {
|
||||
unique,
|
||||
discountLabel,
|
||||
priceText,
|
||||
rateText,
|
||||
maskPhone,
|
||||
cnDate,
|
||||
uid,
|
||||
|
||||
Reference in new issue
Block a user