From 7d13fc8e850274c4c561621c85748fb9fa3f98a1 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 15 Aug 2020 13:36:16 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/zhibo/index.nvue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/zhibo/index.nvue b/pages/zhibo/index.nvue index eb1ef7c..edbb7e7 100644 --- a/pages/zhibo/index.nvue +++ b/pages/zhibo/index.nvue @@ -445,6 +445,7 @@ export default { that.room = that.chatRoomService.room; that.chatRoomService.initialWhenOnlineUserChange(that.newpeople) that.chatRoomService.initialWhenNewMessage(that.whenNewMessage); + this.$forceUpdate(); console.log(that.room) } }) @@ -467,6 +468,7 @@ export default { }, newpeople(list){ this.room.onlineUsers = list + console.log(list.users.length) this.$forceUpdate(); }, sendMessage (messageType, content) {//发送消息 From be2780fbc4296ab4b07ff48f07d04b5d6f007276 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 15 Aug 2020 13:42:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/imservice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/imservice.js b/static/imservice.js index 688b6fd..bb6be96 100644 --- a/static/imservice.js +++ b/static/imservice.js @@ -800,7 +800,6 @@ IMService.prototype.listenerGroupPresence = function () { this.im.on(GoEasyIM.EVENT.GROUP_PRESENCE, (event) => { //更新在线用户数 this.room.onlineUsers.count = event.groupOnlineCount; - if (event.action == 'join' || event.action == 'online') { let userData = JSON.parse(event.userData); //添加新用户 @@ -887,6 +886,7 @@ IMService.prototype.subscribeRoomMessage = function (room, user) { this.subscribePresence(this.room.id); //订阅聊天室消息 // this.subscribeRoomMessage(this.room.id); + this.initialOnlineUsers(this.room.id) this.im.subscribeGroup([this.room.id]) .then(result => { console.log('消息订阅成功') From 6f0ed8e3f9c71443ba621ecdc2a44b33be43cee5 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 15 Aug 2020 15:37:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?i=E5=B9=B4=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/zhibo/index.nvue | 66 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/pages/zhibo/index.nvue b/pages/zhibo/index.nvue index edbb7e7..ca6e9c8 100644 --- a/pages/zhibo/index.nvue +++ b/pages/zhibo/index.nvue @@ -1,6 +1,6 @@