From c5826f41f10287818c222a47b94229e85bf13b73 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Fri, 25 Jul 2025 15:03:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=A5=BD=E5=8F=8B=E5=9C=A8=E7=BA=BF=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/components/chat-item/chat-item.vue | 11 +++++++++-- im-web/src/components/chat/ChatItem.vue | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/im-uniapp/components/chat-item/chat-item.vue b/im-uniapp/components/chat-item/chat-item.vue index 9c9b1c3..d697e87 100644 --- a/im-uniapp/components/chat-item/chat-item.vue +++ b/im-uniapp/components/chat-item/chat-item.vue @@ -3,7 +3,7 @@ - + @@ -45,7 +45,7 @@ export default { methods: { showChatBox() { // 初始化期间进入会话会导致消息不刷新 - if (!getApp().$vm.isInit || this.chatStore.isLoading()) { + if (!this.configStore.appInit || this.chatStore.isLoading()) { uni.showToast({ title: "正在初始化页面,请稍后...", icon: 'none' @@ -86,6 +86,13 @@ export default { nodesText() { let text = this.$str.html2Escape(this.chat.lastContent); return this.$emo.transform(text, 'emoji-small') + }, + online() { + if (this.chat.type == 'PRIVATE') { + let friend = this.friendStore.findFriend(this.chat.targetId); + return friend && friend.online; + } + return false; } } } diff --git a/im-web/src/components/chat/ChatItem.vue b/im-web/src/components/chat/ChatItem.vue index c050020..c997ef4 100644 --- a/im-web/src/components/chat/ChatItem.vue +++ b/im-web/src/components/chat/ChatItem.vue @@ -2,7 +2,7 @@ + :id="chat.type == 'PRIVATE' ? chat.targetId : 0" :isShowUserInfo="false" :online="online"> {{ chat.unreadCount }} @@ -16,7 +16,8 @@ {{ atText }} {{ chat.sendNickName + ': ' }} - + @@ -102,6 +103,13 @@ export default { color: '#F56C6C' }) return items; + }, + online() { + if (this.chat.type == 'PRIVATE') { + let friend = this.friendStore.findFriend(this.chat.targetId); + return friend && friend.online; + } + return false; } } }