From 1b4671bc7eea00542bfbed982de204839ff0b7e4 Mon Sep 17 00:00:00 2001 From: jiangjunjie Date: Mon, 21 Sep 2026 16:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=AE=E5=8F=8A=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat-content.vue | 59 ++++++++++----------------------- src/store/app.js | 19 +++++++++++ 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/components/chat-content.vue b/src/components/chat-content.vue index 7d0e32e..feacfae 100644 --- a/src/components/chat-content.vue +++ b/src/components/chat-content.vue @@ -25,7 +25,7 @@ "> {{ FormatDate(item.timestamp, "yyyy年MM月dd日 hh:mm") - }} + }} -
+
@@ -195,7 +196,8 @@
-
+
@@ -827,51 +829,26 @@
-
+
- -
+ +
{{ item.seatNum }}
-
- -
- - +
diff --git a/src/store/app.js b/src/store/app.js index b3e439a..8266ae7 100644 --- a/src/store/app.js +++ b/src/store/app.js @@ -553,12 +553,20 @@ export const useAppStore = defineStore('app', () => { function pushImageMessage({ localId, imageUrl, fileName = '' } = {}) { if (!localId || !imageUrl) return null + const messageTimestamp = Date.now() const message = { localId, type: 'user', system: 'IMAGE', isSendSuccess: true, uploadStatus: 'uploading', + // liics 协议字段:chat-content 的 v-show 与用户图片分支依赖 msgText/fromFlag/reqAndResType + fromFlag: '1', + reqAndResType: '2', // 1文本 2图片 + msgType: '02', + msgText: imageUrl, // 本地预览(data URL),与 liics 上传时的 base64 预览一致 + timestamp: messageTimestamp, + VIEW_ID: 'msg' + messageTimestamp, imageUrl, imageKey: '', fileName, @@ -579,6 +587,10 @@ export const useAppStore = defineStore('app', () => { } chatArr.value.push(message) + // 与 addSendMessageList 保持一致:记录当前发送的消息并展示上传 loading + timestamp.value = messageTimestamp + sendLoading.value = true + isChatLoading.value = true return message } @@ -590,6 +602,13 @@ export const useAppStore = defineStore('app', () => { if (payload.uploadStatus === 'failed') message.isSendSuccess = false if (payload.uploadStatus === 'success') message.isSendSuccess = true + // 上传结束(成功/失败)关闭气泡上的上传 loading + if (payload.uploadStatus === 'success' || payload.uploadStatus === 'failed') { + message.sendLoading = false + sendLoading.value = false + if (payload.uploadStatus === 'failed') isChatLoading.value = false + } + const options = message.message?.[0]?.options if (options && payload.imageUrl) options.imageUrl = payload.imageUrl if (options && payload.imageKey) options.imageKey = payload.imageKey