群解散时,无论在群组中的哪个页面,都退回到会话列表页面
This commit is contained in:
@@ -57,24 +57,28 @@
|
||||
// 好友申请数量
|
||||
this.checkNewFriendPending()
|
||||
// 监听新的好友申请
|
||||
uni.$on('onContactNotification', () => {
|
||||
this.checkNewFriendPending()
|
||||
})
|
||||
uni.$on('onNewContactConversation', this.checkNewFriendPending)
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.state.token !== '') {
|
||||
this.getConversationList()
|
||||
}
|
||||
uni.$on('onConnectionStatusChange', (status) => {
|
||||
this.connection = status
|
||||
})
|
||||
// 监听新消息
|
||||
uni.$on('onReceiveMessage', (msg) => {
|
||||
this.getConversationList()
|
||||
})
|
||||
// 监听网络状态变化
|
||||
uni.$on('onConnectionStatusChange', (status) => {
|
||||
this.connection = status
|
||||
if (status == 0) {
|
||||
this.getConversationList()
|
||||
}
|
||||
})
|
||||
},
|
||||
onHide() {
|
||||
// 页面隐藏的时候,不监听了,性能可能会好一点
|
||||
uni.$off('onReceiveMessage')
|
||||
uni.$off('onConnectionStatusChange')
|
||||
},
|
||||
methods: {
|
||||
checkNewFriendPending() {
|
||||
|
||||
Reference in New Issue
Block a user