This commit is contained in:
wangxulei 2025-01-12 18:04:06 +08:00
parent d12e4abdfb
commit 8307ea2402
2 changed files with 12 additions and 4 deletions

View File

@ -95,10 +95,10 @@ export default {
IMUI.appendMessage(data.body);
IMUI.messageViewToBottom()
const contactId = this.$refs.im.contact.id
if(isNotEmpty(contactId)&&contactId==data.body.toContactId){
if(isNotEmpty(contactId)&&contactId==data.body.toContactId&&this.$refs.im.dialogVisible){
console.log('当前在该用户聊天框 设置为已读')
this.$refs.im.readAuthorMessage(contactId)
}
this.$refs.im.readAuthorMessage(contactId)
}catch (e) {
}
//

View File

@ -56,8 +56,16 @@
open() {
this.dialogVisible = true
this.getAuthorList()
const {IMUI} = this.$refs;
IMUI.messageViewToBottom()
if(isNotEmpty(this.contact.id)){
this.$refs.IMUI.updateContact({
id: this.contact.id,
unread: 0,
});
this.readAuthorMessage(this.contact.id)
const {IMUI} = this.$refs;
IMUI.messageViewToBottom()
this.getUnReadCount()
}
},
getUnReadCount(){
webSocketManager.sendMessage(JSON.stringify({handlerType:'8',authorId:'8'}))