hookehuyr

fix(profile): 修复消息中心未读状态显示问题

将未读消息的标识从 isRead 改为 status 字段判断,并确保未读消息数量正确转换为数字
1 <!-- 1 <!--
2 * @Date: 2025-03-24 12:56:07 2 * @Date: 2025-03-24 12:56:07
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-06-12 15:34:41 4 + * @LastEditTime: 2025-06-12 16:07:46
5 * @FilePath: /mlaj/src/views/profile/MessagesPage.vue 5 * @FilePath: /mlaj/src/views/profile/MessagesPage.vue
6 * @Description: 消息中心页面 6 * @Description: 消息中心页面
7 --> 7 -->
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 <div class="p-4"> 24 <div class="p-4">
25 <div class="flex justify-between items-start mb-2"> 25 <div class="flex justify-between items-start mb-2">
26 <h3 class="text-base font-medium flex items-center"> 26 <h3 class="text-base font-medium flex items-center">
27 - <span v-if="!message.isRead" class="w-2 h-2 bg-red-500 rounded-full mr-2"></span> 27 + <span v-if="message.status === 'send'" class="w-2 h-2 bg-red-500 rounded-full mr-2"></span>
28 <!-- {{ message.title }} --> 28 <!-- {{ message.title }} -->
29 消息 29 消息
30 </h3> 30 </h3>
...@@ -80,7 +80,7 @@ const finished = ref(false); ...@@ -80,7 +80,7 @@ const finished = ref(false);
80 const messages = ref([]); 80 const messages = ref([]);
81 const limit = ref(10); 81 const limit = ref(10);
82 const page = ref(0); 82 const page = ref(0);
83 -const finishText = ref('没有更多了'); 83 +const finishText = ref('');
84 84
85 // 加载更多 85 // 加载更多
86 const onLoad = async() => { 86 const onLoad = async() => {
......
...@@ -146,7 +146,7 @@ onMounted(async () => { ...@@ -146,7 +146,7 @@ onMounted(async () => {
146 // 处理消息中心的未读消息数量 146 // 处理消息中心的未读消息数量
147 menuItems3.value.forEach(item => { 147 menuItems3.value.forEach(item => {
148 if (item.path === '/profile/messages') { 148 if (item.path === '/profile/messages') {
149 - item.badge = data.unread_msg_count || 0; 149 + item.badge = +data.unread_msg_count || 0;
150 } 150 }
151 }); 151 });
152 } 152 }
......