소스 검색

!138 bug修复
Merge pull request !138 from blue/v_3.0.0

blue 11 달 전
부모
커밋
35c690a82d
2개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 1
      im-uniapp/pages/friend/friend.vue
  2. 6 1
      im-uniapp/pages/group/group.vue

+ 4 - 1
im-uniapp/pages/friend/friend.vue

@@ -8,7 +8,7 @@
 					placeholder="点击搜索好友"></uni-search-bar>
 			</view>
 		</view>
-		<view class="friend-tip" v-if="friendIdx.length == 0">
+		<view class="friend-tip" v-if="!hasFriends">
 			温馨提示:您现在还没有任何好友,快点击右上方'+'按钮添加好友吧~
 		</view>
 		<view class="friend-items" v-else>
@@ -94,6 +94,9 @@ export default {
 		},
 		friendGroups() {
 			return Array.from(this.friendGroupMap.values());
+		},
+		hasFriends() {
+			return this.friendStore.friends.some(f => !f.deleted);
 		}
 	}
 }

+ 6 - 1
im-uniapp/pages/group/group.vue

@@ -7,7 +7,7 @@
 					placeholder="点击搜索群聊"></uni-search-bar>
 			</view>
 		</view>
-		<view class="group-tip" v-if="groupStore.groups.length == 0">
+		<view class="group-tip" v-if="!hasGroups">
 			温馨提示:您现在还没有加入任何群聊,点击右上方'+'按钮可以创建群聊哦~
 		</view>
 		<view class="group-items" v-else>
@@ -38,6 +38,11 @@ export default {
 				url: "/pages/group/group-edit"
 			})
 		}
+	},
+	computed: {
+		hasGroups() {
+			return this.groupStore.groups.some((g) => !g.quit);
+		}
 	}
 }
 </script>