代码优化,变量名称调整
This commit is contained in:
@@ -54,7 +54,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShown: true, // 当前页面显示状态
|
||||
showType: 1, // 0 单聊,1 群聊
|
||||
conversations: [], // 会话列表
|
||||
groupConversations: [],
|
||||
@@ -80,7 +79,9 @@
|
||||
if (this.$store.state.token !== '') {
|
||||
this.getPrivateConversationList()
|
||||
this.getGroupConversationList()
|
||||
}
|
||||
}
|
||||
|
||||
console.log('开始监听');
|
||||
// 监听新消息
|
||||
uni.$on('onReceivePrivateMessage', (msg) => {
|
||||
this.getPrivateConversationList()
|
||||
@@ -88,13 +89,11 @@
|
||||
uni.$on('onReceiveGroupMessage', (msg) => {
|
||||
this.getGroupConversationList()
|
||||
})
|
||||
|
||||
this.isShown = true
|
||||
},
|
||||
onHide() {
|
||||
uni.$off('onReceivePrivateMessage')
|
||||
uni.$off('onReceiveGroupMessage')
|
||||
this.isShown = false
|
||||
uni.$off('onReceiveGroupMessage')
|
||||
console.log('index 隐藏');
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (e.index == 0) {
|
||||
|
||||
Reference in New Issue
Block a user