Commit 65e1251b by chenwq

feat(attendanceDetail): 为考勤详情页添加姓名头像显示功能

- 当用户无头像时,使用姓名的最后两个字符作为头像占位符
- 添加圆形背景样式和文字样式以提升视觉效果
- 移除默认头像图片,改用文字头像显示
1 parent f0bf8592
......@@ -60,6 +60,7 @@ Page({
console.log(res);
let { code, data, message } = res;
if (code == "0") {
data.nameAvatar = data.name.slice(-2) || ''
this.setData({
summaryInfo: data,
});
......
......@@ -26,11 +26,17 @@ page {
}
.avatar {
width: 76rpx;
height: 76rpx;
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
border-radius: 50%;
margin-right: 24rpx;
flex-shrink: 0;
background: #d5e4ff;
color: #2c66f7;
font-size: 28rpx;
font-weight: 600;
}
.name {
......
......@@ -2,7 +2,8 @@
<view class="container">
<!-- User Info Card -->
<view class="card user-card">
<image class="avatar" src="{{IMG_URL}}default-avatar.png" />
<!-- <image class="avatar" src="{{IMG_URL}}default-avatar.png" /> -->
<view class="avatar">{{ summaryInfo.nameAvatar }}</view>
<view class="user-info">
<view class="name ellipsis">{{summaryInfo.name}}</view>
<view class="position ellipsis">{{summaryInfo.positionName}}</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!