fix: 修复学生头像可能为undefined的问题并调整签到页面布局
修复myClassPage.vue中学生头像可能为undefined时导致的显示问题,使用可选链操作符确保安全访问 调整IndexCheckInPage.vue中签到卡片的布局比例,优化头像和用户信息区域的宽度分配
Showing
2 changed files
with
6 additions
and
5 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-25 09:30:55 | 4 | + * @LastEditTime: 2025-09-26 11:27:26 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -22,6 +22,7 @@ | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | ||
| 23 | <!-- 可滚动的内容区域 --> | 23 | <!-- 可滚动的内容区域 --> |
| 24 | <div class="scrollable-content"> | 24 | <div class="scrollable-content"> |
| 25 | + <!-- TODO: 作业描述暂时没有字段数据 --> | ||
| 25 | <div class="text-wrapper"> | 26 | <div class="text-wrapper"> |
| 26 | <div class="text-header">作业描述</div> | 27 | <div class="text-header">作业描述</div> |
| 27 | </div> | 28 | </div> |
| ... | @@ -92,10 +93,10 @@ | ... | @@ -92,10 +93,10 @@ |
| 92 | <div class="post-card" v-for="post in checkinDataList" :key="post.id"> | 93 | <div class="post-card" v-for="post in checkinDataList" :key="post.id"> |
| 93 | <div class="post-header"> | 94 | <div class="post-header"> |
| 94 | <van-row> | 95 | <van-row> |
| 95 | - <van-col span="4"> | 96 | + <van-col span="3"> |
| 96 | <van-image round width="2.5rem" height="2.5rem" :src="post.user.avatar || 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg'" fit="cover" /> | 97 | <van-image round width="2.5rem" height="2.5rem" :src="post.user.avatar || 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg'" fit="cover" /> |
| 97 | </van-col> | 98 | </van-col> |
| 98 | - <van-col span="17"> | 99 | + <van-col span="18"> |
| 99 | <div class="user-info"> | 100 | <div class="user-info"> |
| 100 | <div class="username">{{ post.user.name }}</div> | 101 | <div class="username">{{ post.user.name }}</div> |
| 101 | <div class="post-time">{{ post.user.time }}</div> | 102 | <div class="post-time">{{ post.user.time }}</div> | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2025-01-20 10:00:00 | 3 | * @Date: 2025-01-20 10:00:00 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2025-06-30 13:24:15 | 5 | + * @LastEditTime: 2025-09-26 11:31:09 |
| 6 | * @FilePath: /mlaj/src/views/teacher/myClassPage.vue | 6 | * @FilePath: /mlaj/src/views/teacher/myClassPage.vue |
| 7 | * @Description: 我的班级页面 | 7 | * @Description: 我的班级页面 |
| 8 | --> | 8 | --> |
| ... | @@ -99,7 +99,7 @@ | ... | @@ -99,7 +99,7 @@ |
| 99 | @click="handleStudentClick(student)"> | 99 | @click="handleStudentClick(student)"> |
| 100 | <div class="flex items-center flex-1"> | 100 | <div class="flex items-center flex-1"> |
| 101 | <van-image round width="2.5rem" height="2.5rem" | 101 | <van-image round width="2.5rem" height="2.5rem" |
| 102 | - :src="student.avatar || 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg'" fit="cover" class="mr-3" /> | 102 | + :src="student?.avatar || 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg'" fit="cover" class="mr-3" /> |
| 103 | <div class="flex-1"> | 103 | <div class="flex-1"> |
| 104 | <div class="flex items-center"> | 104 | <div class="flex items-center"> |
| 105 | <span class="font-medium text-gray-800 mr-2">{{ student.name }}</span> | 105 | <span class="font-medium text-gray-800 mr-2">{{ student.name }}</span> | ... | ... |
-
Please register or login to post a comment