开发: 群列表改为隐藏式

This commit is contained in:
zhengw
2023-04-24 15:43:28 +08:00
parent 00a69d5759
commit 3d98c2cf38
2 changed files with 104 additions and 104 deletions

View File

@@ -36,9 +36,7 @@ export const ChatVote: React.FC<IChatItem> = (props) => {
<div key={msg?.voteitem[item]} className={styles.voteitem}>
{msg?.voteitem[item]}
</div>
) : (
<></>
);
) : null;
})
: null}
</div>

View File

@@ -343,105 +343,6 @@ const ChatLogs: React.FC = () => {
return 0;
};
// const { notification } = App.useApp();
const tabContent = () => {
if (tabKey == '0') {
// 内部联系人
return (
<Spin spinning={loadingInner}>
{innerStaffsList.length
? innerStaffsList.map((item) => {
if (item.user_id == selectStaff?.user_id) {
return null;
}
return (
<div
key={`${item.user_id}_${item.name}`}
className={`${styles.chatB} ${
selectInnerStaff?.user_id == item.user_id ? styles.active : ''
}`}
onClick={() => {
tabKeyRef.current = tabKey;
setSelectCustFollow(undefined);
selectCustFollowRef.current = undefined;
setSelectGroup(undefined);
selectGroupRef.current = undefined;
setSelectInnerStaff(item);
selectInnerStaffRef.current = item;
page(1);
}}
style={{ display: item.name.includes(searchWord['0']) ? '' : 'none' }}
>
<div className={styles.avatar}>
{item.avatar ? (
<img
src={item.avatar}
alt=""
style={{
width: '100%',
height: '100%',
objectFit: 'cover',
borderRadius: 4,
}}
/>
) : (
<>{item.name[0]}</>
)}
</div>
<div className={styles.chatAMsg}>
<div className={styles.chatAName} title={item.name}>
{item.name}
</div>
</div>
</div>
);
})
: null}
<div style={{ lineHeight: '34px', textAlign: 'center', color: '#999' }}>
{checkInnerIsEmpty() == 0 ? '暂无内部联系人' : ''}
</div>
</Spin>
);
} else if (tabKey == '1') {
return (
<Spin spinning={loadingOuter}>
{custFollowsList.length
? custFollowsList.map((item, i) => {
return item.state == 0 ? null : custFollowsListItem(item, i);
})
: null}
<div style={{ lineHeight: '34px', textAlign: 'center', color: '#999' }}>
{checkCustFollowsIsEmpty(1) == 0 ? '暂无外部联系人' : ''}
</div>
</Spin>
);
} else {
return (
<Spin spinning={loadingGroup}>
<GroupListWidget
groupAvatar={avatarObjRef.current}
groupList={groupList}
searchWord={searchWord['2']}
onClick={(item: IGroup) => {
tabKeyRef.current = tabKey;
setSelectCustFollow(undefined);
selectCustFollowRef.current = undefined;
setSelectInnerStaff(undefined);
selectInnerStaffRef.current = undefined;
setSelectGroup(item);
selectGroupRef.current = item;
selectGroupRef.current.adminUserIDs = getAdminList(item.admin_list);
getGroupMembersList();
}}
selectGroup={selectGroup}
/>
</Spin>
);
}
};
// 删除的联系人/群
const tabContentDel = () => {
if (tabKey == '0') {
@@ -479,6 +380,108 @@ const ChatLogs: React.FC = () => {
}
};
// const { notification } = App.useApp();
const tabContent = () => {
// <div className={styles.chatBBox}>{tabContent()}</div>
return (
<>
{/* 内部联系人 */}
<div className={styles.chatBBox} style={{ display: tabKey == '0' ? 'block' : 'none' }}>
<Spin spinning={loadingInner}>
{innerStaffsList.length
? innerStaffsList.map((item) => {
if (item.user_id == selectStaff?.user_id) {
return null;
}
return (
<div
key={`${item.user_id}_${item.name}`}
className={`${styles.chatB} ${
selectInnerStaff?.user_id == item.user_id ? styles.active : ''
}`}
onClick={() => {
tabKeyRef.current = tabKey;
setSelectCustFollow(undefined);
selectCustFollowRef.current = undefined;
setSelectGroup(undefined);
selectGroupRef.current = undefined;
setSelectInnerStaff(item);
selectInnerStaffRef.current = item;
page(1);
}}
style={{ display: item.name.includes(searchWord['0']) ? '' : 'none' }}
>
<div className={styles.avatar}>
{item.avatar ? (
<img
src={item.avatar}
alt=""
style={{
width: '100%',
height: '100%',
objectFit: 'cover',
borderRadius: 4,
}}
/>
) : (
<>{item.name[0]}</>
)}
</div>
<div className={styles.chatAMsg}>
<div className={styles.chatAName} title={item.name}>
{item.name}
</div>
</div>
</div>
);
})
: null}
<div style={{ lineHeight: '34px', textAlign: 'center', color: '#999' }}>
{checkInnerIsEmpty() == 0 ? '暂无内部联系人' : ''}
</div>
</Spin>
</div>
<div className={styles.chatBBox} style={{ display: tabKey == '1' ? 'block' : 'none' }}>
<Spin spinning={loadingOuter}>
{custFollowsList.length
? custFollowsList.map((item, i) => {
return item.state == 0 ? null : custFollowsListItem(item, i);
})
: null}
<div style={{ lineHeight: '34px', textAlign: 'center', color: '#999' }}>
{checkCustFollowsIsEmpty(1) == 0 ? '暂无外部联系人' : ''}
</div>
</Spin>
</div>
{tabContentDel()}
<div className={styles.chatBBox} style={{ display: tabKey == '2' ? 'block' : 'none' }}>
<Spin spinning={loadingGroup}>
<GroupListWidget
groupAvatar={avatarObjRef.current}
groupList={groupList}
searchWord={searchWord['2']}
onClick={(item: IGroup) => {
tabKeyRef.current = tabKey;
setSelectCustFollow(undefined);
selectCustFollowRef.current = undefined;
setSelectInnerStaff(undefined);
selectInnerStaffRef.current = undefined;
setSelectGroup(item);
selectGroupRef.current = item;
selectGroupRef.current.adminUserIDs = getAdminList(item.admin_list);
getGroupMembersList();
}}
selectGroup={selectGroup}
/>
</Spin>
</div>
</>
);
};
return (
<PageContainer>
<div className={styles.box}>
@@ -610,8 +613,7 @@ const ChatLogs: React.FC = () => {
// }
}}
/>
<div className={styles.chatBBox}>{tabContent()}</div>
{tabContentDel()}
{tabContent()}
</div>
<div style={{ flex: 1 }}>
<div className={styles.logTop}>