update
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-alert type="warning" v-if="connection != 0" description="网络似乎断开了" :show-icon="true" />
|
||||
<view v-for="(item, index) in conversations" :key="index"
|
||||
:class="['message', { 'is-top': item.isTop }]" @tap="toDetail(item)"
|
||||
@longpress="onLongPress" :data-item="item">
|
||||
<view v-for="(item, index) in conversations" :key="index" :class="['message', { 'is-top': item.isTop }]"
|
||||
@tap="toDetail(item)" @longpress="onLongPress" :data-item="item">
|
||||
<view class="avatar">
|
||||
<u-badge numberType="ellipsis" max="99" shape="horn" absolute :offset="[-5, -5]"
|
||||
:value="item.unreadMessageCount" />
|
||||
<u-avatar :src="friend(item.targetId).portraitUrl || require('@/static/user/cover.png')" shape="square" size="46" />
|
||||
<u-avatar :src="friend(item.targetId).portraitUrl || require('@/static/user/cover.png')"
|
||||
shape="square" size="46" />
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
@@ -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;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user