优化UI,修复群BUG
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user