From 6a21f9589ac545a77d362ceefe0d8d8faf8692af Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Thu, 21 Aug 2025 16:59:40 +0800 Subject: [PATCH] no message --- pages/NEUIKit/components/Appellation.vue | 2 +- .../conversation-list/conversation-item.vue | 1 + root/NEUIKit/pages/Chat/message/message-item.vue | 42 ++++++++++++++++------ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/pages/NEUIKit/components/Appellation.vue b/pages/NEUIKit/components/Appellation.vue index abfe441..90d8434 100644 --- a/pages/NEUIKit/components/Appellation.vue +++ b/pages/NEUIKit/components/Appellation.vue @@ -20,7 +20,7 @@ import { import { deepClone } from '../utils' -const appellation = ref('') +const appellation = ref('-') const { pid,account, teamId, ignoreAlias, nickFromMsg } = withDefaults( defineProps<{ diff --git a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue index 3a4ac74..19ad718 100644 --- a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue +++ b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue @@ -273,6 +273,7 @@ function handleTouchMove(event: TouchEvent) { } function handleConversationItemClick() { + uni.setStorageSync("selectopenimid", props.conversation.conversationId); if (props.showMoreActions) { emit("leftSlide", null); return; diff --git a/root/NEUIKit/pages/Chat/message/message-item.vue b/root/NEUIKit/pages/Chat/message/message-item.vue index 2c2f442..03c83c6 100644 --- a/root/NEUIKit/pages/Chat/message/message-item.vue +++ b/root/NEUIKit/pages/Chat/message/message-item.vue @@ -115,7 +115,7 @@ " :goto-user-card="true" />
- {{ appellation }} + {{ appellation }} {{ subtitle }}
@@ -436,7 +436,7 @@ }) // 昵称 - const appellation = ref('') + const appellation = ref('-') const accountId = uni.$UIKitStore?.userStore?.myUserInfo.accountId // 会话类型 @@ -503,20 +503,40 @@ const handleReeditMsg = (msg : V2NIMMessageForUI) => { uni.$emit(events.ON_REEDIT_MSG, msg) } + const subtitle = ref('') // 监听昵称变化 const uninstallAppellationWatch = autorun(() => { // 昵称展示顺序 群昵称 > 备注 > 个人昵称 > 帐号 - appellation.value = deepClone( - uni.$UIKitStore.uiStore.getAppellation({ - account: props.msg.senderId, - teamId: - conversationType === - V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM - ? to - : '', + if(uni.getStorageSync('selectopenimid')){ + async function getUserInfo() { + try { + const res = await uni.$UIKitStore.userStore.getUserActive(uni.getStorageSync('selectopenimid').split('|')[2]) + return res + } catch (error) { + console.error('getUserInfo error:', error) + } + } + getUserInfo().then(res => { + if(res.serverExtension){ + subtitle.value = '@' + JSON.parse(res.serverExtension).fullName; + }else{ + subtitle.value = ''; + } + appellation.value = res.name; }) - ) + }else{ + appellation.value = deepClone( + uni.$UIKitStore.uiStore.getAppellation({ + account: props.msg.senderId, + teamId: + conversationType === + V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM + ? to + : '', + }) + ) + } }) onUnmounted(() => {