通讯录-常用联系人刷新页面

main
ysn 6 days ago
parent 8084ec42de
commit 5dcec7a4cd
  1. 26
      src/views/contacts/index.vue

@ -43,11 +43,7 @@
/>
</div>
<!-- 滚动事件只在常用联系人场景生效 -->
<div
v-loading="loading"
class="member-list"
@scroll="handleScroll"
>
<div v-loading="loading" class="member-list" @scroll="handleScroll">
<div
v-for="member in memberList"
:key="member.id"
@ -71,7 +67,10 @@
description="暂无成员"
/>
<!-- 分页底部提示仅常用联系人展示 -->
<div v-if="isLatestContacts && memberList.length > 0" class="load-more-tip">
<div
v-if="isLatestContacts && memberList.length > 0"
class="load-more-tip"
>
<span v-if="loadMoreLoading">加载更多...</span>
<span v-if="noMore && !loadMoreLoading">没有更多数据了</span>
</div>
@ -273,13 +272,15 @@ export default {
resList = data.list || [];
} else {
//
const { data } = await getGroupsListUser({ group_id: this.currentGroupId });
const { data } = await getGroupsListUser({
group_id: this.currentGroupId,
});
resList = data.list || [];
}
const formatList = resList.map(item => ({
const formatList = resList.map((item) => ({
...item,
online: [1, true].includes(item.online)
online: [1, true].includes(item.online),
}));
if (isRefresh) {
@ -312,7 +313,7 @@ export default {
try {
const { data } = await getGroupsList();
this.treeData = data.list;
this.defaultExpandedKeys = this.treeData.map(node => node.id);
this.defaultExpandedKeys = this.treeData.map((node) => node.id);
if (!this.userGroupId) return;
const parentKeys = this.findParentKeys(this.treeData, this.userGroupId);
this.$nextTick(() => {
@ -332,7 +333,10 @@ export default {
for (const node of tree) {
if (node.id === targetId) return [...parents, node.id];
if (node.child && node.child.length) {
const res = this.findParentKeys(node.child, targetId, [...parents, node.id]);
const res = this.findParentKeys(node.child, targetId, [
...parents,
node.id,
]);
if (res.length) return res;
}
}

Loading…
Cancel
Save