hookehuyr

docs: 消息详情页查看后刷新未读消息数

- 消息详情页获取详情后调用 userStore.fetchUserInfo(true)
- 刷新用户信息以更新 unreadMsgCount
- 从而使 TabBar 红点状态同步更新

修改文件:
- src/pages/message-detail/index.vue: 添加 useUserStore 导入和刷新调用
- src/api/news.js: 修复注释格式(全角分号)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
......@@ -7,7 +7,7 @@ const Api = {
/**
* @description 消息详情
* @remark
* @remark
* @param {Object} params 请求参数
* @param {string} params.i 消息ID
* @returns {Promise<{
......@@ -26,10 +26,10 @@ export const detailAPI = (params) => fn(fetch.get(Api.Detail, params));
/**
* @description 我的消息列表
* @remark
* @remark
* @param {Object} params 请求参数
* @param {string} params.page
* @param {string} params.limit
* @param {string} params.page
* @param {string} params.limit
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
......@@ -41,7 +41,7 @@ export const detailAPI = (params) => fn(fetch.get(Api.Detail, params));
status: string; // send=以发送未读取,read=已读取
pk_id: integer; // 计划书订单ID
}>;
total: integer; //
total: integer; //
* };
* }>}
*/
......
......@@ -51,6 +51,7 @@ import { ref, computed } from 'vue'
import { useLoad } from '@tarojs/taro'
import NavHeader from '@/components/navigation/NavHeader.vue'
import { detailAPI } from '@/api/news'
import { useUserStore } from '@/stores/user'
const detail = ref(null)
const loading = ref(true)
......@@ -86,6 +87,10 @@ const fetchDetail = async (id) => {
...res.data,
title: res.data.title || mockTitle
}
// 查看消息后刷新用户信息,更新未读消息数
const userStore = useUserStore()
await userStore.fetchUserInfo(true)
}
} catch (err) {
console.error('获取消息详情失败:', err)
......