no message

cyl/master-0822
jscyl13849007907 3 months ago
parent 81d7ae175c
commit c1c8cb8441

@ -147,7 +147,7 @@ const lastMsgContent = computed(() => {
if (sendingState === V2NIMConst.V2NIMMessageSendingState.V2NIM_MESSAGE_SENDING_STATE_FAILED) { if (sendingState === V2NIMConst.V2NIMMessageSendingState.V2NIM_MESSAGE_SENDING_STATE_FAILED) {
return t("conversationSendFailText"); return t("conversationSendFailText");
} }
console.log("lastMsg", lastMsg); console.log("lastMsglastMsglastMsg", lastMsg);
let _str = "[多媒体]"; let _str = "[多媒体]";
if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw) { if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw) {
@ -164,7 +164,6 @@ const lastMsgContent = computed(() => {
_str = "[图片]"; _str = "[图片]";
} }
console.log("lastMsg.text", lastMsg.text, " -- ", _str);
return getMsgContentTipByType({ return getMsgContentTipByType({
messageType: lastMsg.messageType, messageType: lastMsg.messageType,
text: lastMsg.text ? lastMsg.text : _str, text: lastMsg.text ? lastMsg.text : _str,

@ -5,7 +5,15 @@
<div class="conversation-list-wrapper " v-if="conversationList && conversationList.length > 0"> <div class="conversation-list-wrapper " v-if="conversationList && conversationList.length > 0">
<!-- 此处的key如果用session.id会在ios上渲染存在问题会出现会话列表显示undefined --> <!-- 此处的key如果用session.id会在ios上渲染存在问题会出现会话列表显示undefined -->
<div v-for="(conversation, index) in conversationList" class="" style="min-height:72px" :key="conversation.renderKey"> <div v-for="(conversation, index) in conversationList" class="" style="min-height:72px" :key="conversation.renderKey">
<ConversationItem :key="conversation.renderKey" :loading="loading" :showMoreActions="currentMoveSessionId === conversation.conversationId" :conversation="conversation" @delete="handleSessionItemDeleteClick" :heihei="'mmp' + index" @stickyToTop="handleSessionItemStickTopChange" @click="handleSessionItemClick" @leftSlide="handleSessionItemLeftSlide" /> <ConversationItem :key="conversation.renderKey" :loading="loading"
:showMoreActions="currentMoveSessionId === conversation.conversationId"
:conversation="conversation"
@delete="handleSessionItemDeleteClick"
:heihei="'mmp' + index"
@stickyToTop="handleSessionItemStickTopChange"
@click="handleSessionItemClick"
@leftSlide="handleSessionItemLeftSlide"
/>
</div> </div>
</div> </div>
<!-- <div style="height: 48px; background-color: #ededed" v-if="conversationList && conversationList.length > 0"></div> --> <!-- <div style="height: 48px; background-color: #ededed" v-if="conversationList && conversationList.length > 0"></div> -->
@ -63,8 +71,16 @@ const handleSessionItemClick = async (conversation: V2NIMConversation) => {
flag = true; flag = true;
await uni.$UIKitStore.uiStore.selectConversation(conversation.conversationId); await uni.$UIKitStore.uiStore.selectConversation(conversation.conversationId);
console.log("handleSessionItemClick", conversation);
const itemUserInfo = await uni.$UIKitStore.userStore.getUserActive(conversation.conversationId.split('|')[2])
let _title = '';
if(itemUserInfo.serverExtension){
_title = '@' + JSON.parse(itemUserInfo.serverExtension).fullName;
}else{
_title = '';
}
customNavigateTo({ customNavigateTo({
url: "/pages/Chat/index", url: "/pages/Chat/index?ctitle=" + _title,
}); });
} catch { } catch {
uni.showToast({ uni.showToast({

@ -397,10 +397,14 @@ const scrollToBottom = () => {
}, 300); }, 300);
}; };
onLoad(() => { onLoad((options) => {
uni.$on(events.HANDLE_MOVE_THROUGH, (flag) => { uni.$on(events.HANDLE_MOVE_THROUGH, (flag) => {
moveThrough.value = flag; moveThrough.value = flag;
}); });
uni.setNavigationBarTitle({
title: options.ctitle,
});
}); });
const msgHeight = ref(0); const msgHeight = ref(0);
onMounted(() => { onMounted(() => {
@ -420,6 +424,8 @@ onMounted(() => {
uni.$UIKitNIM.V2NIMTeamService.on("onTeamLeft", handleRemoveTeamMembers); uni.$UIKitNIM.V2NIMTeamService.on("onTeamLeft", handleRemoveTeamMembers);
uni.$on(events.GET_HISTORY_MSG, loadMoreMsgs); uni.$on(events.GET_HISTORY_MSG, loadMoreMsgs);
}); });
onUnmounted(() => { onUnmounted(() => {

Loading…
Cancel
Save