From e99120c34e76f13551eae770a7ebc9f7989f2c3a Mon Sep 17 00:00:00 2001 From: JiXinHui <985276981@qq.com> Date: Fri, 19 Dec 2025 09:58:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AF=BC=E8=88=AA=E6=A0=8F=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AA=E5=B1=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consultation/index.vue | 4 ++++ store/index.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/pages/consultation/index.vue b/pages/consultation/index.vue index f9592f8..3b0247e 100644 --- a/pages/consultation/index.vue +++ b/pages/consultation/index.vue @@ -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); diff --git a/store/index.js b/store/index.js index 58cf0d5..60ed024 100644 --- a/store/index.js +++ b/store/index.js @@ -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: { // 获取聊天列表(最近联系人)