From 17a5a736dd513828db0b558e684b85421f7cf465 Mon Sep 17 00:00:00 2001 From: JiXinHui <985276981@qq.com> Date: Tue, 16 Dec 2025 14:31:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=95=99=E5=B8=88=E7=AB=AF=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E5=92=A8=E8=AF=A2=E4=BC=9A=E8=AF=9D=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consultation/index.vue | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/pages/consultation/index.vue b/pages/consultation/index.vue index b298f6d..3ba6393 100644 --- a/pages/consultation/index.vue +++ b/pages/consultation/index.vue @@ -62,7 +62,7 @@ export default { PageHeader, }, computed: { - // 补充展示字段,模板直接使用 + // 补充展示字段,便于模板直接使用 displayChatList() { return (this.chatList || []).map((item) => ({ ...item, @@ -102,10 +102,16 @@ export default { // 打开聊天页面 openChat(item) { - console.log('打开聊天:', item); - uni.navigateTo({ - url: `/pages/chat/chat-detail?userId=${item.userId}&name=${item.name}` - }); + // console.log('打开聊天:', item); + // uni.navigateTo({ + // url: `/pages/chat/chat-detail?userId=${item.userId}&name=${item.name}` + // }); + const dialogueManagementId = item.dialogueManagementId + const receiverId = item.receiverId + this.$store.dispatch("selectTeacherChatItem", { + dialogueManagementId, + receiverId, + }); }, // 加载聊天列表 @@ -134,10 +140,9 @@ export default { refreshChatList() { this.loadChatList(); }, - + // 规范化接口返回的会话列表数据 normalizeDialogueList(list = []) { - // 后续接口字段若变更,仅需调整此处映射 return list.map((item, index) => { const unread = typeof item?.unReadCount === "number" @@ -264,23 +269,19 @@ export default { /* ===== 聊天列表项 ===== */ .chat-item { display: flex; - align-items: center; - padding: 14px 16px; - background-color: #fff; - border-bottom: 1rpx solid #f1f1f1; + padding: 15px; + background: #fff; + border-bottom: 1rpx solid #f0f0f0; transition: background-color 0.2s; } .chat-item:active { - background-color: #f8f8f8; + background-color: #f5f5f5; } .chat-avatar-wrapper { position: relative; margin-right: 12px; - width: 50px; - height: 50px; - flex-shrink: 0; } .chat-avatar { @@ -324,8 +325,8 @@ export default { .chat-name { font-size: 16px; font-weight: 500; - color: #1f1f1f; - max-width: 70%; + color: #333; + max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -333,7 +334,7 @@ export default { .chat-time { font-size: 12px; - color: #9b9b9b; + color: #999; flex-shrink: 0; } @@ -344,7 +345,7 @@ export default { .preview-text { font-size: 13px; - color: #9b9b9b; + color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;