删除公告,消息撤回优化

This commit is contained in:
2022-02-24 10:56:16 +08:00
parent 8b7a259c00
commit e72d6b3a91
8 changed files with 87 additions and 80 deletions

View File

@@ -75,20 +75,19 @@
})
}
})
uni.$on('onRecallMessage', (res) => {
if (res.targetId == this.targetId) {
this.messages = this.messages.map(item => {
if (res.messageId == item.messageId) {
return res
} else {
return item
}
})
}
uni.$on('onRecallMessage_' + this.targetId, (message) => {
this.messages = this.messages.map(item => {
if (message.messageId == item.messageId) {
return message
} else {
return item
}
})
})
},
onUnload() {
uni.$off('onReceiveMessage_' + this.targetId)
uni.$off('onRecallMessage_' + this.targetId)
uni.$off('onRecallMessage')
uni.$off('onReadReceiptReceived')
},