消息列表刷新

This commit is contained in:
2022-02-07 17:46:07 +08:00
parent f7495257fa
commit 0bfdcdf6af
2 changed files with 7 additions and 8 deletions

View File

@@ -103,9 +103,6 @@
}
},
onLoad() {
uni.$on('onReceiveMessage', (msg) => {
this.getConversationList()
})
uni.$on('onConnectionStatusChange', (status) => {
this.connection = status
})
@@ -113,10 +110,15 @@
onShow() {
if (this.$store.state.token !== '') {
this.getConversationList()
}
}
uni.$on('onReceiveMessage', (msg) => {
console.log('收到消息,刷新列表');
this.getConversationList()
})
this.isShown = true
},
onHide() {
onHide() {
uni.$off('onReceiveMessage')
this.isShown = false
},
onNavigationBarButtonTap(e) {

View File

@@ -108,9 +108,6 @@
}
})
},
beforeDestroy() {
uni.$off('onReceiveMessage')
},
methods: {
initMessageList() {
this.getMessageList()