diff --git a/pages/NEUIKit/components/Appellation.vue b/pages/NEUIKit/components/Appellation.vue index ca82b81..90d8434 100644 --- a/pages/NEUIKit/components/Appellation.vue +++ b/pages/NEUIKit/components/Appellation.vue @@ -2,7 +2,10 @@ {{ appellation }} + {{ appellation }} + {{ subtitle }} + @@ -17,9 +20,9 @@ import { import { deepClone } from '../utils' -const appellation = ref('') +const appellation = ref('-') -const { account, teamId, ignoreAlias, nickFromMsg } = withDefaults( +const { pid,account, teamId, ignoreAlias, nickFromMsg } = withDefaults( defineProps<{ account: string teamId?: string @@ -27,6 +30,7 @@ const { account, teamId, ignoreAlias, nickFromMsg } = withDefaults( nickFromMsg?: string color?: string fontSize?: number + pid?: number }>(), { teamId: undefined, @@ -34,18 +38,38 @@ const { account, teamId, ignoreAlias, nickFromMsg } = withDefaults( nickFromMsg: '-', color: '#333', fontSize: 16, + pid:0 } ) - +const subtitle = ref(''); const uninstallAppellationWatch = autorun(() => { - appellation.value = deepClone( - uni.$UIKitStore.uiStore.getAppellation({ - account, - teamId, - ignoreAlias, - nickFromMsg, + if(pid){ + async function getUserInfo() { + try { + const res = await uni.$UIKitStore.userStore.getUserActive(pid.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, + teamId, + ignoreAlias, + nickFromMsg, + }) + ) + } }) onUnmounted(() => { uninstallAppellationWatch() diff --git a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue index 1d28ccf..19ad718 100644 --- a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue +++ b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue @@ -23,7 +23,7 @@
- + {{ sessionName }} @@ -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/components/NetworkAlert.vue b/root/NEUIKit/components/NetworkAlert.vue index 10a52bb..7a98d7a 100644 --- a/root/NEUIKit/components/NetworkAlert.vue +++ b/root/NEUIKit/components/NetworkAlert.vue @@ -1,5 +1,5 @@ diff --git a/root/NEUIKit/pages/Chat/message/message-item.vue b/root/NEUIKit/pages/Chat/message/message-item.vue index 402f5db..03c83c6 100644 --- a/root/NEUIKit/pages/Chat/message/message-item.vue +++ b/root/NEUIKit/pages/Chat/message/message-item.vue @@ -93,7 +93,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -114,8 +114,8 @@ : '' " :goto-user-card="true" />
-
- {{ appellation }} +
+ {{ appellation }} {{ subtitle }}
@@ -135,7 +135,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -161,7 +161,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -187,7 +187,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -206,7 +206,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -228,7 +228,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -355,7 +355,7 @@ : '' " :goto-user-card="true" />
-
+
{{ appellation }}
@@ -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(() => { diff --git a/root/NEUIKit/pages/Chat/message/message-list.vue b/root/NEUIKit/pages/Chat/message/message-list.vue index c65645e..78c9491 100644 --- a/root/NEUIKit/pages/Chat/message/message-list.vue +++ b/root/NEUIKit/pages/Chat/message/message-list.vue @@ -21,10 +21,10 @@ 顶部聊天区域高度传过来{{msgKeyHeight}} 本页面{{screenHeight1}} {{rell}}-->
- + --> @@ -98,7 +98,7 @@ // .selectViewport() .scrollOffset((res) => { scroll_new = res.scrollHeight; - scrollTop.value = scroll_new - scroll_old; + // scrollTop.value = scroll_new - scroll_old; // // console.log("竖直滚动位置", scroll_new); })