diff --git a/pages/im/components/friendApplyCell.vue b/pages/im/components/friendApplyCell.vue
index 65b89f6..b962aa9 100644
--- a/pages/im/components/friendApplyCell.vue
+++ b/pages/im/components/friendApplyCell.vue
@@ -36,7 +36,6 @@
methods: {
resolve() {
resolveFriend(this.message.sourceUserId).then(res => {
- this.clearMessages()
uni.showToast({
icon: 'none',
title: '通过好友申请'
@@ -47,6 +46,8 @@
icon: 'none',
title: err.message
})
+ }).finally(() => {
+ this.clearMessages()
})
},
reject() {
@@ -67,12 +68,12 @@
})
},
// 不管是通过还是拒绝,都要把相关的信息清理
- clearMessages() {
+ clearMessages() {
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
this.$emit('success')
- uni.$emit('onNewContactConversation', message)
- uni.$emit('onNewContactFriends', message)
- uni.$emit('onNewContactPendings', message)
+ uni.$emit('onNewContactConversation')
+ uni.$emit('onNewContactFriends')
+ uni.$emit('onNewContactPendings')
}
}
}
diff --git a/pages/im/friends/index.vue b/pages/im/friends/index.vue
index 7179b89..e563914 100644
--- a/pages/im/friends/index.vue
+++ b/pages/im/friends/index.vue
@@ -10,25 +10,33 @@
我的群聊
-
+
-
-
-
- {{ contact(friendItem.targetId).name }}
+
+
+
+
+ {{ contact(friendItem.targetId).name }}
+
-
-
- 暂无好友列表~
+
+
+ 暂无好友列表~
@@ -159,19 +165,20 @@
font-size: 14px;
line-height: 24px;
background-color: #fff;
- }
- .no-lists {
- padding-top: $padding * 3;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- font-size: $title-size-m;
- color: $text-gray-m;
-
- span {
- padding-top: $padding;
- }
+ }
+
+ .no-lists {
+ padding-top: $padding * 3;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ font-size: $title-size-m;
+ color: $text-gray-m;
+
+ span {
+ padding-top: $padding;
+ }
}
diff --git a/pages/im/index.vue b/pages/im/index.vue
index ef370a6..c514884 100644
--- a/pages/im/index.vue
+++ b/pages/im/index.vue
@@ -57,7 +57,11 @@
// 好友申请数量
this.checkNewFriendPending()
// 监听新的好友申请
- uni.$on('onNewContactConversation', this.checkNewFriendPending)
+ uni.$on('onNewContactConversation', () => {
+ console.log('更新好友申请数量');
+ // 更新好友申请数量
+ this.checkNewFriendPending()
+ })
},
onShow() {
if (this.$store.state.token !== '') {