diff --git a/src/views/superFusionPlatform/messageProcessing/message/Conversation/ConversationItem.vue b/src/views/superFusionPlatform/messageProcessing/message/Conversation/ConversationItem.vue index fe8c5ab..b0aa6c8 100644 --- a/src/views/superFusionPlatform/messageProcessing/message/Conversation/ConversationItem.vue +++ b/src/views/superFusionPlatform/messageProcessing/message/Conversation/ConversationItem.vue @@ -75,9 +75,6 @@ export default { }, }, mounted() { - // this.target_name = this.latestMessage.expansion - // ? this.latestMessage.expansion.target_name - // : ""; this.data = this.value; this.getConversationItem(); console.log(this.value, "会话列表"); @@ -90,7 +87,14 @@ export default { }, methods: { handelDel() { - alert(); + console.log(this.data.type, this.data.targetId, "del"); + confirm(this.data.type, this.data.targetId, "del").then(() => { + const conversation = this.RongIMClient.Conversation.get({ + targetId: this.data.targetId, + type: this.data.type, + }); + conversation.destory().then(() => console.log("删除会话成功")); + }); }, mouseenter(e) { this.delConversationShow = e; @@ -129,6 +133,7 @@ export default { // 点击会话列表方法 setConversationIndex() { // 列表页发送当前索引 + this.$emit("update:nowIndex", this.ind); // 列表页发送当前targetId this.$emit("update:targetId", this.value.targetId); @@ -138,17 +143,6 @@ export default { targetId: this.value.targetId, type: this.value.type, }); - // 存入本地存储 - const conversation_info = { - person_name: this.name, - avatar: this.avatar, - targetId: this.value.targetId, - type: this.value.type, - }; - localStorage.setItem( - "conversation_info", - JSON.stringify(conversation_info) - ); }, // 获取当前名称、头像 diff --git a/src/views/superFusionPlatform/messageProcessing/message/Conversation/index.vue b/src/views/superFusionPlatform/messageProcessing/message/Conversation/index.vue index eba0760..1e4ab77 100644 --- a/src/views/superFusionPlatform/messageProcessing/message/Conversation/index.vue +++ b/src/views/superFusionPlatform/messageProcessing/message/Conversation/index.vue @@ -57,14 +57,15 @@ export default { }, props: ["getTargetId"], mounted() { + console.log(this, "this111111"); this.rongyunIMCGetList(); this.$bus.on("rongyunIMCGetList", this.rongyunIMCGetList); }, watch: { // 根据列表页面发回的targetid获取聊天记录 - targetId(e) { - this.$bus.emit("getList", e, 1); - }, + // targetId(e) { + // this.$bus.emit("getList", e, 1); + // }, nowInfo(e) { // console.log(e, "nowInfo"); diff --git a/src/views/superFusionPlatform/messageProcessing/message/MessageList/index.vue b/src/views/superFusionPlatform/messageProcessing/message/MessageList/index.vue index 747430b..aa2190e 100644 --- a/src/views/superFusionPlatform/messageProcessing/message/MessageList/index.vue +++ b/src/views/superFusionPlatform/messageProcessing/message/MessageList/index.vue @@ -149,12 +149,12 @@ export default { }, methods: { // 渲染 并 发送 ==> 信息 type= 自己发送, - handelSendMessage(type = 0, message = {}) { + handelSendMessage(sendType = 0, message = {}) { const user_info = JSON.parse(localStorage.getItem("user_info")); const conversation_info = JSON.parse( localStorage.getItem("conversation_info") ); - if (type == 0) { + if (sendType == 0) { message = { content: { content: this.textdata }, expansion: { @@ -178,7 +178,7 @@ export default { console.log(message, "message 未发送"); this.rongYunSend(message); } - console.log(message, type, "handelSendMessage"); + console.log(message, sendType, "handelSendMessage"); // push进数组数据 this.messageResult.push(message); // console.log(conversation_info, "conversation_info");