代码优化,变量名称调整

This commit is contained in:
2022-02-10 13:56:01 +08:00
parent e2243bcc99
commit 13aed4abf5
20 changed files with 258 additions and 452 deletions

View File

@@ -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) {