fix:导航栏跳转闪屏优化

This commit is contained in:
JiXinHui 2025-12-19 09:58:52 +08:00
parent 3322089431
commit e99120c34e
2 changed files with 21 additions and 0 deletions

View File

@ -240,6 +240,10 @@ export default {
this.chatList = this.normalizeDialogueList(list);
// 便
this.$store.commit("set_UserMsgList", this.chatList);
this.$store.commit("upsert_DialogueTypeMap", {
list: this.chatList,
type: 1,
});
this.totalCount = res?.data?.item2 || list.length;
} catch (error) {
console.error("[在线咨询] 获取会话列表失败", error);

View File

@ -51,6 +51,8 @@ const store = new Vuex.Store({
vuex_msgUser: lifeData.vuex_msgUser ? lifeData.vuex_msgUser : {},
// 消息窗口滚动位置
vuex_msgScrollTop: 0,
// 记录会话ID与在线咨询类型的映射区分在线咨询/人工转接
vuex_dialogueTypeMap: {},
// 自定义tabbar数据
vuex_iPhone: lifeData.vuex_iPhone ? lifeData.vuex_iPhone : false,
// tabbar相关配置
@ -271,6 +273,21 @@ const store = new Vuex.Store({
saveLifeData("vuex_teacherInfo", state.vuex_teacherInfo);
saveLifeData("vuex_user", state.vuex_user);
},
// 合并会话类型映射(在线咨询类型)
upsert_DialogueTypeMap(state, { list = [], type }) {
if (!type) return;
const next = { ...(state.vuex_dialogueTypeMap || {}) };
list.forEach((item) => {
const id =
item?.dialogueManagementId ||
item?.DialogueManagementId ||
item?.dialogueId ||
item?.friendId ||
item?.id;
if (id) next[id] = type;
});
state.vuex_dialogueTypeMap = next;
},
},
actions: {
// 获取聊天列表(最近联系人)