Commit 23f8b699 by liangjianmin

feat(mine): 替换头像占位文字为头像图片

将用户头像占位文字替换为默认头像图片,并更新样式以适应新头像。
同时移除计算属性 avatarText,简化代码结构。
parent 01f9a28b
......@@ -59,10 +59,9 @@
justify-content: center;
margin-right: 20rpx;
.avatar-text {
font-size: 40rpx;
font-weight: 500;
color: #ffffff;
.avatar-img {
width: 72rpx;
height: 72rpx;
}
}
......
......@@ -4,7 +4,7 @@
<view class="hero-bg"></view>
<view class="profile-card">
<view class="avatar">
<text class="avatar-text">{{ avatarText }}</text>
<image class="avatar-img" src="/static/default-avatar.svg" mode="aspectFit"></image>
</view>
<view class="profile-meta">
<text class="p-name">{{ info.name || '--' }}</text>
......@@ -45,16 +45,6 @@
]
};
},
computed: {
/**
* 头像占位文字,取姓名末位字
* @return {string}
*/
avatarText() {
var name = this.info.name || '';
return name ? name.slice(-1) : '员';
}
},
onShow() {
this.getUserInfo();
},
......
<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="96" height="96" rx="24" fill="#EFF6FF"/>
<circle cx="48" cy="36" r="16" fill="#60A5FA"/>
<path d="M20 82C23.3 66.2 34.1 56 48 56C61.9 56 72.7 66.2 76 82H20Z" fill="#2563EB"/>
<path d="M27 78C31.2 67.5 38.4 62 48 62C57.6 62 64.8 67.5 69 78H27Z" fill="#3B82F6"/>
</svg>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment