群解散时,无论在群组中的哪个页面,都退回到会话列表页面

This commit is contained in:
2022-02-23 14:13:38 +08:00
parent 8b10fd95fe
commit 1407d677de
21 changed files with 197 additions and 136 deletions

View File

@@ -21,8 +21,12 @@
import sentMessageBar from '../components/sentMessageBar'
import showMessageCell from '../components/showMessageCell'
import utils from '@/utils/index.js'
export default {
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
export default {
mixins: [
onGroupDismiss
],
components: {
sentMessageBar,
showMessageCell
@@ -59,11 +63,9 @@
})
// 获取历史消息列表
this.getMessageList()
// 监听收到本群的消息,追加消息
uni.$on('onReceiveMessage', (msg) => {
if (msg.targetId == this.targetId) {
this.getNewMessage()
}
// 监听消息
uni.$on('onReceiveMessage_' + this.targetId, (message) => {
this.getNewMessage()
})
uni.$on('onReceiptRequest', (msg) => {
if (msg.targetId == this.targetId) {
@@ -101,6 +103,7 @@
})
},
onUnload() {
uni.$off('onReceiveMessage_' + this.targetId)
uni.$off('onRecallMessage')
uni.$off('onReceiptRequest')
uni.$off('onReceiptResponse')
@@ -164,7 +167,7 @@
},
onHide() {
// console.log(JSON.stringify(this.$refs))
this.$refs.voice.stopPlay()
// this.$refs.voice.stopPlay()
}
}
</script>