From a0ea24f8f91b0ed221ec8da13c656c33233d0f1d Mon Sep 17 00:00:00 2001 From: yangzhe Date: Thu, 19 Mar 2026 15:41:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E8=81=8A=E5=A4=A9=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index 39fc0e9..4054a1b 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -663,11 +663,11 @@ export default { }); }, isLiveAgentChat() { - if (!this.vuex_isTransferChat) return false; - const current = this.currentDMid || ""; - const active = - this.vuex_msgUser && this.vuex_msgUser.dialogueManagementId; - return !!(current && active && String(active) === String(current)); + return !!( + this.vuex_isTransferChat && + this.vuex_msgUser?.dialogueManagementId && + this.vuex_msgUser?.receiverId + ); }, }, From af1a29c0711191431d267f52acd75234cc34ec0b Mon Sep 17 00:00:00 2001 From: yangzhe Date: Thu, 19 Mar 2026 16:13:33 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix(=E8=81=8A=E5=A4=A9=E7=95=8C=E9=9D=A2):?= =?UTF-8?q?=20=E4=BF=AE=E6=AD=A3=E6=95=99=E5=B8=88=E5=92=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=B6=88=E6=81=AF=E7=9A=84=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index 4054a1b..4d767c4 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -160,6 +160,7 @@ + {{ message.message }} @@ -229,10 +230,13 @@ + @@ -361,10 +365,11 @@ - + + From f043ee6fa3ef9d96bb5f67bba110c3e09ac2ca5d Mon Sep 17 00:00:00 2001 From: yangzhe Date: Thu, 19 Mar 2026 16:36:40 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat(=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86):?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0sendUserType=E5=AD=97=E6=AE=B5=E5=88=B0?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 51 +++++++++++++++++++++++++------------------------- store/index.js | 1 + 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/App.vue b/App.vue index 2c75b91..2d1d766 100644 --- a/App.vue +++ b/App.vue @@ -230,33 +230,34 @@ export default { receiverId: data.ReceiverId, sendDate: data.SendDate, message: data.Message, + sendUserType: 2, }; const id = data.Id || data.id || Math.random().toString(36).substring(2); - const msg = { - ...processData, - messageType: 0, - filePath: "", - id, - }; - const storeState = (this.$store && this.$store.state) || {}; - const isTransferChat = !!storeState.vuex_isTransferChat; - const activeDialogueId = - storeState.vuex_msgUser?.dialogueManagementId || - storeState.vuex_msgUser?.friendId || - storeState.vuex_msgUser?.id; - const isActiveChat = - activeDialogueId && - String(activeDialogueId) === String(processData.dialogueManagementId); - - if (isTransferChat) { - if (isActiveChat) { - this.$store.commit("push_AiLiveAgentMsg", msg); - } - } else { - if (isActiveChat) { - this.$store.commit("push_Msg", msg); - } - } + const msg = { + ...processData, + messageType: 0, + filePath: "", + id, + }; + const storeState = (this.$store && this.$store.state) || {}; + const isTransferChat = !!storeState.vuex_isTransferChat; + const activeDialogueId = + storeState.vuex_msgUser?.dialogueManagementId || + storeState.vuex_msgUser?.friendId || + storeState.vuex_msgUser?.id; + const isActiveChat = + activeDialogueId && + String(activeDialogueId) === String(processData.dialogueManagementId); + + if (isTransferChat) { + if (isActiveChat) { + this.$store.commit("push_AiLiveAgentMsg", msg); + } + } else { + if (isActiveChat) { + this.$store.commit("push_Msg", msg); + } + } // 更新会话列表的未读数 / 文案 / 时间,保持实时展示 if (processData.dialogueManagementId) { diff --git a/store/index.js b/store/index.js index add4ed5..84c3476 100644 --- a/store/index.js +++ b/store/index.js @@ -223,6 +223,7 @@ const store = new Vuex.Store({ isRead: true, interactMode: isSelf ? 0 : 8, messageType: msg.messageType || msg.MessageType || 0, + sendUserType: msg.sendUserType, timeLabel: 0, displayTime: "", }); From 28c617a33d5537fd96b7c389412f55a03aacf4c2 Mon Sep 17 00:00:00 2001 From: yangzhe Date: Thu, 19 Mar 2026 17:00:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix(=E6=B6=88=E6=81=AF=E5=A4=B4=E5=83=8F):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E6=8E=A5=E6=94=B6=E8=80=85=E5=A4=B4=E5=83=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 12 +++++++----- pages/home/index/index.vue | 15 +++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/App.vue b/App.vue index 2d1d766..06344cc 100644 --- a/App.vue +++ b/App.vue @@ -230,9 +230,10 @@ export default { receiverId: data.ReceiverId, sendDate: data.SendDate, message: data.Message, - sendUserType: 2, + sendUserType: data.SendUserType, // 0 AI 1 学生 2 教师 3 提示 }; - const id = data.Id || data.id || Math.random().toString(36).substring(2); + const id = + data.Id || data.id || Math.random().toString(36).substring(2); const msg = { ...processData, messageType: 0, @@ -403,9 +404,10 @@ uni-page-body { body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", - "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", - "Microsoft Yahei", sans-serif; + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", + "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Microsoft Yahei", + sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; // max-width: 1536rpx; diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index 4d767c4..ceabb05 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -245,7 +245,7 @@ @@ -375,7 +375,7 @@ Date: Thu, 19 Mar 2026 17:29:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(chat):=20=E4=BF=AE=E5=A4=8D=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=91=E9=80=81=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/index.vue | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pages/chat/index.vue b/pages/chat/index.vue index 7278db6..e1c078c 100644 --- a/pages/chat/index.vue +++ b/pages/chat/index.vue @@ -118,10 +118,18 @@ {{ formatShowTime(message.sendDate) }} + + + + {{ message.message }} + + @@ -137,7 +145,11 @@ { - console.log(res, "发送消息成功"); if (res.succeed) { // 添加到消息列表 const msgUserData = { @@ -331,6 +342,14 @@ export default { // this.$nextTick(() => { // this.scrollToBottom(); // }); + } else { + // 清空输入框 + this.messageValue = ""; + // 发送失败 + uni.showToast({ + title: res.error || "发送失败", + icon: "none", + }); } }) .catch((error) => { @@ -568,6 +587,12 @@ export default { color: #999999; padding: 20rpx; } + .message-tip { + text-align: center; + font-size: 24rpx; + color: #999999; + padding-bottom: 40rpx; + } .message-left, .message-right {