优化im
This commit is contained in:
parent
d12e4abdfb
commit
8307ea2402
@ -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) {
|
||||
}
|
||||
//请求总数
|
||||
|
@ -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'}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user