feat(mini-user): show masked phone under nickname on mine page

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-29 11:31:02 +08:00
parent b0ff254cd8
commit 2ccadce34a
+5 -5
View File
@@ -23,6 +23,7 @@ import {
} from '../../lib/mini-wechat-profile'; } from '../../lib/mini-wechat-profile';
import { isLoggedIn, logout, request, toast, type UserProfile } from '../../lib/api'; import { isLoggedIn, logout, request, toast, type UserProfile } from '../../lib/api';
import { isWechatEnv } from '../../lib/weixin'; import { isWechatEnv } from '../../lib/weixin';
import { maskPhone } from '../../lib/phone';
import { import {
DEFAULT_SHARE_DESC, DEFAULT_SHARE_DESC,
DEFAULT_SHARE_TITLE, DEFAULT_SHARE_TITLE,
@@ -349,13 +350,12 @@ export default function MinePage() {
const nickname = display.nickname || '用户'; const nickname = display.nickname || '用户';
const needProfileFill = isWeapp && needsWxProfileFill(display); const needProfileFill = isWeapp && needsWxProfileFill(display);
const avatarProfileReady = isWeapp ? !needProfileFill : hasWechat; const avatarProfileReady = isWeapp ? !needProfileFill : hasWechat;
const maskedPhone = profile?.phone ? maskPhone(String(profile.phone)) : '';
const memberLabel = needProfileFill const memberLabel = needProfileFill
? '点击头像完善资料' ? '点击头像完善资料'
: isWeapp || hasWechat : !isWeapp && !hasWechat && canWxAuth
? '好客会员' ? '点击头像授权'
: canWxAuth : maskedPhone || '未绑定手机';
? '点击头像授权'
: '好客会员';
const avatarClickable = isWeapp || (!hasWechat && canWxAuth); const avatarClickable = isWeapp || (!hasWechat && canWxAuth);
const previewAvatar = draftAvatarUrl || display.avatarUrl; const previewAvatar = draftAvatarUrl || display.avatarUrl;