优化UI,修复群BUG

This commit is contained in:
cbb
2026-01-24 16:49:47 +08:00
parent c508b1fcb4
commit a55a1593bb
11 changed files with 555 additions and 445 deletions

View File

@@ -128,7 +128,10 @@
{{ conversation.getGroupAtInfo() }}
</span>
<view class="middle-box-content">
{{ conversation.getLastMessage('text') }}
{{
isFirstCreateGroup(conversation) ||
conversation.getLastMessage('text')
}}
</view>
</view>
</view>
@@ -366,7 +369,7 @@
const redEnvelopeText = (item: IConversationModel) => {
const payload = JSON.parse(item.lastMessage?.payload?.data)
const text = item.getLastMessage('text')?.split(':')
console.log(text)
if (text && text.length > 1) {
return `${text[0]}:[积分红包] ${payload.title}`
} else {
@@ -374,6 +377,17 @@
}
}
/** 是否最开始创建群聊 */
const isFirstCreateGroup = (item: IConversationModel) => {
if (item.type === 'GROUP' && item?.lastMessage?.payload?.data) {
const data = JSON.parse(item?.lastMessage?.payload?.data)
return data.content === 'Create Group'
? `${item.getLastMessage('text')?.split(':')[0]}:创建群聊`
: ''
}
return ''
}
function onConversationListUpdated(list: IConversationModel[]) {
conversationList.value = list
}