@@ -76,10 +76,10 @@ export default {
privateNewMsg(msg) {
if (this.userIdsMsgObj[msg.privateUserId]) {
Object.assign(this.userIdsMsgObj[msg.privateUserId], msg);
- this.$set(msg, "newMsgTip", true);
+ this.$set(this.userIdsMsgObj[msg.privateUserId], "newMsgTip", true);
} else {
this.list.unshift(msg);
- this.$set(msg, "newMsgTip", true);
+ this.$set(this.userIdsMsgObj[msg.privateUserId], "newMsgTip", true);
}
this.list = this.list.sort((x, y) => {
return (
@@ -113,15 +113,14 @@ export default {
}
this.loading = false;
},
- searchMsg() {
+ async searchMsg() {
+ await this.getPrivateChatList();
if (this.keyword) {
this.filterList = this.list.filter(item => {
const userName =
item.userType !== 2 ? item.privateUserName : item.userName;
return userName.includes(this.keyword);
});
- } else {
- this.filterList = this.list;
}
}
}
diff --git a/src/views/circle/detail/index.vue b/src/views/circle/detail/index.vue
index 3c9b482..2b076ee 100644
--- a/src/views/circle/detail/index.vue
+++ b/src/views/circle/detail/index.vue
@@ -321,10 +321,17 @@ export default {
});
},
toPrivateChat(userInfo) {
- this.privateUserInfo = Object.assign({
- privateUserId: userInfo.userId,
- privateUserName: userInfo.userName
- });
+ this.privateUserInfo = Object.assign(
+ userInfo.userType === 2
+ ? {
+ privateUserId: userInfo.userId,
+ privateUserName: userInfo.userName
+ }
+ : {
+ privateUserId: userInfo.privateUserId,
+ privateUserName: userInfo.privateUserName
+ }
+ );
this.chatType = 2;
},
closePrivateChat() {
@@ -382,7 +389,6 @@ export default {
}
},
handlePrivateChatTopic(msg) {
- debugger;
console.log("handlePrivateChatTopic", msg);
const body = JSON.parse(msg.body);
if ([1].includes(body.type)) {