diff --git a/pages/im/index.vue b/pages/im/index.vue index c9f48ad..301c6ee 100644 --- a/pages/im/index.vue +++ b/pages/im/index.vue @@ -30,13 +30,13 @@ - + - + @@ -99,15 +99,12 @@ } }, onLoad() { - if (this.isShown) { - uni.$on('onReceiveMessage', (msg) => { - console.log(msg); - this.getConversationList() - }) - uni.$on('onConnectionStatusChange', (status) => { - this.connection = status - }) - } + uni.$on('onReceiveMessage', (msg) => { + this.getConversationList() + }) + uni.$on('onConnectionStatusChange', (status) => { + this.connection = status + }) }, onShow() { if (this.$store.state.token !== '') { @@ -199,9 +196,10 @@ toDetail(item) { this.hidePop() uni.navigateTo({ - url: '/pages/im/private/chat?targetId=' + item.targetId + '&conversationType=' + item.conversationType - }) - + url: '/pages/im/private/chat?targetId=' + item.targetId + '&conversationType=' + item + .conversationType + }) + // url: '/pages/im/private/index?targetId=' + item.targetId + '&conversationType=' + item.conversationType }, // 点击按钮 @@ -358,8 +356,8 @@ color: $text-gray-m; padding-top: $padding - 20; padding-bottom: $padding; - font-size: $title-size-m; - height: 40rpx; + font-size: $title-size-m; + height: 40rpx; line-height: 40rpx; width: 500rpx; @extend .nowrap; @@ -417,7 +415,8 @@ } } } - .u-border-bottom{ + + .u-border-bottom { border-bottom: solid 1rpx #f9f9f9 !important; } diff --git a/utils/im/index.js b/utils/im/index.js index 2131e2c..d65a54e 100644 --- a/utils/im/index.js +++ b/utils/im/index.js @@ -117,7 +117,8 @@ const addListeners = () => { RongIMLib.addReceiveMessageListener((res) => { console.log('收到消息', res.data.message); const message = res.data.message - if (inArray(message.objectName, notifyMsgTypes)) { + if (inArray(message.objectName, notifyMsgTypes)) { + console.log('new Message'); newMessage(message) } })