This commit is contained in:
2020-08-08 15:40:48 +08:00
parent 597c92e9cd
commit 9e96eeb575
3 changed files with 262 additions and 39 deletions

View File

@@ -424,30 +424,14 @@ export default {
id : a.rid + "",
name : a.rid + ""
};
that.chatRoomService = getApp().globalData.im
console.log(room,currentUser)
//构造chatRoomService
that.chatRoomService = new ChatRoomService(room, currentUser);
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
that.chatRoomService.connectGoEasyIM();
//获取当前聊天室数据
that.room = that.chatRoomService.room;
setTimeout(function() {
that.chatRoomService.quitRoom();
that.chatRoomService = {}
}, 1000);
setTimeout(function(){
that.chatRoomService = new ChatRoomService(room, currentUser);
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
that.chatRoomService.connectGoEasyIM();
//获取当前聊天室数据
that.room = that.chatRoomService.room;
console.log(that.room.onlineUsers)
}, 2000);
that.chatRoomService.subscribeRoomMessage(room,currentUser)
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
//获取当前聊天室数据
that.room = that.chatRoomService.room;
}
})
} catch (error) {
@@ -465,7 +449,7 @@ export default {
},
methods:{
sendMessage (messageType, content) {//发送消息
console.log(123)
console.log(this.room,this.room.id,messageType, content)
if(content == "" && messageType == 0) return;
var message = {
senderNickname : this.room.currentUser.nickname ,