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