Browse Source

退群后同时删除会话

master
xsx 2 years ago
parent
commit
3c716caa37
  1. 4
      im-uniapp/App.vue
  2. 2
      im-uniapp/pages/group/group-info.vue
  3. 9
      im-uniapp/store/chatStore.js

4
im-uniapp/App.vue

@ -114,8 +114,8 @@
// #endif // #endif
// //
let delayTime = 100; let delayTime = 100;
if(msg.type == enums.MESSAGE_TYPE.RTC_CALL_VOICE if (msg.type == enums.MESSAGE_TYPE.RTC_CALL_VOICE ||
|| msg.type == enums.MESSAGE_TYPE.RTC_CALL_VIDEO){ msg.type == enums.MESSAGE_TYPE.RTC_CALL_VIDEO) {
let mode = msg.type == enums.MESSAGE_TYPE.RTC_CALL_VIDEO ? "video" : "voice"; let mode = msg.type == enums.MESSAGE_TYPE.RTC_CALL_VIDEO ? "video" : "voice";
let pages = getCurrentPages(); let pages = getCurrentPages();
let curPage = pages[pages.length - 1].route; let curPage = pages[pages.length - 1].route;

2
im-uniapp/pages/group/group-info.vue

@ -112,6 +112,7 @@
url:"/pages/group/group" url:"/pages/group/group"
}); });
this.$store.commit("removeGroup", this.groupId); this.$store.commit("removeGroup", this.groupId);
this.$store.commit("removeGroupChat",this.groupId);
},100) },100)
} }
}) })
@ -141,6 +142,7 @@
url:"/pages/group/group" url:"/pages/group/group"
}); });
this.$store.commit("removeGroup", this.groupId); this.$store.commit("removeGroup", this.groupId);
this.$store.commit("removeGroupChat",this.groupId);
},100) },100)
} }
}) })

9
im-uniapp/store/chatStore.js

@ -133,6 +133,15 @@ export default {
} }
} }
}, },
removeGroupChat(state, groupId) {
let chats = this.getters.findChats();
for (let idx in chats) {
if (chats[idx].type == 'GROUP' &&
chats[idx].targetId == groupId) {
this.commit("removeChat", idx);
}
}
},
moveTop(state, idx) { moveTop(state, idx) {
let chats = this.getters.findChats(); let chats = this.getters.findChats();
let chat = chats[idx]; let chat = chats[idx];

Loading…
Cancel
Save