hookehuyr

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

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