feat: v3.4.18 门店体验与登录态优化
- mini-user 门店座机电话中间四位脱敏(保留区号与前后位) - mini-user 套餐详情图增加 1/N 计数与自动轮播 - h5-partner 账号暂停(DISABLED)禁止登录并提示客服 - h5-shop 提现/筛选栏左右留白与页面一致 - h5-shop 休息中核销改为弹「是否开启营业」并支持开张后继续 Co-Authored-By: WorkBuddy <workbuddy@tencent.com>
This commit is contained in:
@@ -26,7 +26,7 @@ function normalizeContactPhone(raw: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* 脱敏展示:手机 138****8000;座机保留区号,如 0379-****888。
|
||||
* 脱敏展示:手机 138****8000;座机隐藏本地号中间四位,如 0379-12****78。
|
||||
* 门店详情电话展示用(拨号仍走 toDialablePhone 明文)。
|
||||
*/
|
||||
export function maskPhone(phone: string) {
|
||||
@@ -45,9 +45,16 @@ export function maskPhone(phone: string) {
|
||||
const areaLen = digits.startsWith('01') || digits.startsWith('02') ? 3 : 4;
|
||||
const area = digits.slice(0, areaLen);
|
||||
const local = digits.slice(areaLen);
|
||||
const keepTail = Math.min(4, Math.max(2, local.length - 4));
|
||||
const maskedLocal =
|
||||
local.length <= 4 ? '*'.repeat(local.length) : `${'*'.repeat(local.length - keepTail)}${local.slice(-keepTail)}`;
|
||||
// 隐藏本地号中间四位(保留区号,本号前后各留若干位):0379-12345678 → 0379-12****78
|
||||
let maskedLocal: string;
|
||||
if (local.length <= 4) {
|
||||
maskedLocal = '*'.repeat(local.length);
|
||||
} else {
|
||||
const keep = local.length - 4;
|
||||
const head = Math.max(1, Math.floor(keep / 2));
|
||||
const tail = keep - head;
|
||||
maskedLocal = `${local.slice(0, head)}${'*'.repeat(4)}${local.slice(local.length - tail)}`;
|
||||
}
|
||||
const joiner = main.includes('-') ? '-' : '';
|
||||
return ext ? `${area}${joiner}${maskedLocal}-${ext}` : `${area}${joiner}${maskedLocal}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user