|
@@ -325,7 +325,6 @@ export default {
|
|
}, 2000);
|
|
}, 2000);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // console.log("qxj qwUserId:"+JSON.stringify(this.qwUser));
|
|
|
|
this.isFromLogin=this.$route.query.isFromLogin;
|
|
this.isFromLogin=this.$route.query.isFromLogin;
|
|
console.log("qxj isFromLogin:"+this.isFromLogin);
|
|
console.log("qxj isFromLogin:"+this.isFromLogin);
|
|
if(!this.qwIm.hasLogin){
|
|
if(!this.qwIm.hasLogin){
|
|
@@ -376,14 +375,6 @@ export default {
|
|
conversationData.sort((a1, a2) => {
|
|
conversationData.sort((a1, a2) => {
|
|
return a2.lastSendTime - a1.lastSendTime;
|
|
return a2.lastSendTime - a1.lastSendTime;
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
- // IMUI.initContacts(ContactsData);
|
|
|
|
- // IMUI.initConversations(conversationData);
|
|
|
|
- // setTimeout(() => {
|
|
|
|
- // IMUI.changeContact(1688856679458971);
|
|
|
|
- // }, 500);
|
|
|
|
-
|
|
|
|
this.getContacts(); //获取联系人信息
|
|
this.getContacts(); //获取联系人信息
|
|
this.getConversation(); //获取会话信息
|
|
this.getConversation(); //获取会话信息
|
|
|
|
|
|
@@ -441,7 +432,6 @@ export default {
|
|
isBottom: true,
|
|
isBottom: true,
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
-
|
|
|
|
IMUI.initEmoji(EmojiData);
|
|
IMUI.initEmoji(EmojiData);
|
|
|
|
|
|
},
|
|
},
|
|
@@ -490,20 +480,22 @@ export default {
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
that.appendMessageAction(msgData);
|
|
that.appendMessageAction(msgData);
|
|
- let queryParams={conversationId:msgData.toContactId,userId:that.qwUser.userId};
|
|
|
|
- getConversation(queryParams).then(response => {
|
|
|
|
- if(response.code==200){
|
|
|
|
- var conversation=response.data;
|
|
|
|
- var unread=conversation.unread;
|
|
|
|
- if(!unread){
|
|
|
|
- conversation.unread=1;
|
|
|
|
- }else{
|
|
|
|
- conversation.unread+=1;
|
|
|
|
- }
|
|
|
|
- IMUI.topPopConversations(conversation);
|
|
|
|
|
|
+ let conversation=IMUI.findConversation(msgData.toContactId);
|
|
|
|
+ IMUI.topPopConversations(conversation);
|
|
|
|
+ // let queryParams={conversationId:msgData.toContactId,userId:that.qwUser.userId};
|
|
|
|
+ // getConversation(queryParams).then(response => {
|
|
|
|
+ // if(response.code==200){
|
|
|
|
+ // var conversation=response.data;
|
|
|
|
+ // var unread=conversation.unread;
|
|
|
|
+ // if(!unread){
|
|
|
|
+ // conversation.unread=1;
|
|
|
|
+ // }else{
|
|
|
|
+ // conversation.unread+=1;
|
|
|
|
+ // }
|
|
|
|
+ // IMUI.topPopConversations(conversation);
|
|
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -520,7 +512,6 @@ export default {
|
|
this.roomInfo=response.detail;
|
|
this.roomInfo=response.detail;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
getContacts(){
|
|
getContacts(){
|
|
getContactsByUser(this.qwUser.userId).then(response => {
|
|
getContactsByUser(this.qwUser.userId).then(response => {
|
|
this.contactData = response.data;
|
|
this.contactData = response.data;
|
|
@@ -546,7 +537,6 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
messageTimeFormat(time) {
|
|
messageTimeFormat(time) {
|
|
- //console.log("qxj messageTimeFormat:"+time);
|
|
|
|
return this.friendlyDate(time);
|
|
return this.friendlyDate(time);
|
|
},
|
|
},
|
|
changeTheme() {
|
|
changeTheme() {
|
|
@@ -603,7 +593,7 @@ export default {
|
|
this.queryParams.pageNum=pages[conversation.conversationId];
|
|
this.queryParams.pageNum=pages[conversation.conversationId];
|
|
this.queryParams.conversationId=conversation.conversationId;
|
|
this.queryParams.conversationId=conversation.conversationId;
|
|
if(conversation.unread>0){
|
|
if(conversation.unread>0){
|
|
- conversation.unread==0;
|
|
|
|
|
|
+ conversation.unread=0;
|
|
instance.updateContact(conversation);
|
|
instance.updateContact(conversation);
|
|
}
|
|
}
|
|
instance.closeDrawer();
|
|
instance.closeDrawer();
|
|
@@ -659,7 +649,6 @@ export default {
|
|
handleSend(message, next, file) {
|
|
handleSend(message, next, file) {
|
|
const IMUI = this.$refs.IMUI;
|
|
const IMUI = this.$refs.IMUI;
|
|
var params={};
|
|
var params={};
|
|
- console.log("qxj message:"+JSON.stringify(message));
|
|
|
|
if(message.type=="text"){ //text image voice video
|
|
if(message.type=="text"){ //text image voice video
|
|
params={"conversationId":message.toContactId,"deviceId":this.qwUser.deviceId,"userId":this.qwUser.userId,"content":message.content};
|
|
params={"conversationId":message.toContactId,"deviceId":this.qwUser.deviceId,"userId":this.qwUser.userId,"content":message.content};
|
|
sendTextMsg(params).then(response => {
|
|
sendTextMsg(params).then(response => {
|
|
@@ -712,7 +701,7 @@ export default {
|
|
},
|
|
},
|
|
handleMessageClick(e, key, message, instance) {
|
|
handleMessageClick(e, key, message, instance) {
|
|
console.log("点击了消息", e, key, message);
|
|
console.log("点击了消息", e, key, message);
|
|
- console.log("qxj message:"+JSON.stringify(message));
|
|
|
|
|
|
+ //console.log("qxj message:"+JSON.stringify(message));
|
|
if(message.type=="image"){
|
|
if(message.type=="image"){
|
|
var url=!!message.url?message.url:message.content;
|
|
var url=!!message.url?message.url:message.content;
|
|
this.handlePicturePreview(url);
|
|
this.handlePicturePreview(url);
|