wangxia 3 months ago
commit 952f4790fe

@ -2,7 +2,10 @@
<span
class="appellation"
:style="{ color: color, fontSize: fontSize + 'px' }"
>{{ appellation }}</span
>
{{ appellation }}
<span v-if="subtitle" style="color: orange;">{{ subtitle }}</span>
</span
>
</template>
@ -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()

@ -23,7 +23,7 @@
</div>
<div class="conversation-item-right">
<div class="conversation-item-top">
<Appellation class="conversation-item-title u-skeleton-fillet" fontSize="17" v-if="conversation.type === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P" :account="to" />
<Appellation :pid="props.conversation.conversationId" class="conversation-item-title u-skeleton-fillet" fontSize="17" v-if="conversation.type === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P" :account="to" />
<span v-else class="conversation-item-title u-skeleton-fillet">
{{ sessionName }}
</span>
@ -273,6 +273,7 @@ function handleTouchMove(event: TouchEvent) {
}
function handleConversationItemClick() {
uni.setStorageSync("selectopenimid", props.conversation.conversationId);
if (props.showMoreActions) {
emit("leftSlide", null);
return;

@ -1,5 +1,5 @@
<template>
<div v-if="!isConnected && text " class="network-alert">
<div v-if="!isConnected && text && false " class="network-alert">
{{ text }}
</div>
</template>

@ -93,7 +93,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 1" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<div :class="props.msg.isSelf ? 'self-msg-recall' : 'msg-recall'">
@ -114,8 +114,8 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
{{ appellation }}
<div class="msg-name 2" v-if="!props.msg.isSelf">
{{ appellation }} <span v-if="subtitle" style="color: orange;">{{ subtitle }}</span>
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true">
<ReplyMessage v-if="!!replyMsg" :replyMsg="replyMsg"></ReplyMessage>
@ -135,7 +135,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 3" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true" style="cursor: pointer">
@ -161,7 +161,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 4" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true" style="cursor: pointer">
@ -187,7 +187,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 5" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true">
@ -206,7 +206,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 6" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="false">
@ -228,7 +228,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 7" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true" style="cursor: pointer">
@ -355,7 +355,7 @@
: ''
" :goto-user-card="true" />
<div class="msg-content">
<div class="msg-name" v-if="!props.msg.isSelf">
<div class="msg-name 8" v-if="!props.msg.isSelf">
{{ appellation }}
</div>
<MessageBubble :msg="props.msg" :tooltip-visible="true" :bg-visible="true">
@ -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(() => {

@ -21,10 +21,10 @@
顶部聊天区域高度传过来{{msgKeyHeight}} 本页面{{screenHeight1}} {{rell}}-->
</div>
<!-- 底部往上推paddingBottom + {{paddingBottom}}
<!-- 滚动条位置scrollTop + {{scrollTop}}
底部往上推paddingBottom + {{paddingBottom}}
聊天内容高度msgKeyHeight + {{msgKeyHeight}}
-->
-->
</view>
</scroll-view>
@ -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);
})

Loading…
Cancel
Save