成功
This commit is contained in:
@@ -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 ,
|
||||
|
||||
Reference in New Issue
Block a user