feat: 联系人搜索
This commit is contained in:
@@ -13,14 +13,13 @@ function ContactList({ keyword = '' }) {
|
||||
keyword = keyword.toLowerCase();
|
||||
contacts = [
|
||||
...contacts.filter((c) => c.displayName?.toLowerCase().includes(keyword)),
|
||||
...contacts.filter((c) => c.nameInitial?.toLowerCase().includes(keyword)),
|
||||
...contacts.filter((c) => c.nameQuanPin?.toLowerCase().includes(keyword)),
|
||||
...contacts.filter((c) => c.nickname?.toLowerCase().includes(keyword)),
|
||||
...contacts.filter((c) => c.nickUameQuanPin?.toLowerCase().includes(keyword)),
|
||||
...contacts.filter((c) => c.nickname?.toLowerCase().includes(keyword)),
|
||||
];
|
||||
contacts = uniq(contacts);
|
||||
}
|
||||
console.log(contacts);
|
||||
|
||||
return (
|
||||
<div className={Style.linkmanList}>
|
||||
{contacts.map((contact) => (
|
||||
|
||||
@@ -14,8 +14,6 @@ function FunctionBar({ onSearch }) {
|
||||
);
|
||||
const handleInputChange = useCallback(
|
||||
(kw) => {
|
||||
console.log('aaaaa',kw);
|
||||
|
||||
setKeyword(kw);
|
||||
triggerSearch(kw);
|
||||
},
|
||||
|
||||
@@ -38,6 +38,8 @@ export interface User {
|
||||
signature?: string;
|
||||
nameInitial?: string;
|
||||
nameQuanPin?: string;
|
||||
nickUameInitial?: string;
|
||||
nickUameQuanPin?: string;
|
||||
avatar: string;
|
||||
lastReadMessage?: Message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user