|
|
@ -14,9 +14,10 @@ interface Props {
|
|
|
|
className?: string;
|
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface TDataList {
|
|
|
|
interface UserData {
|
|
|
|
label: string;
|
|
|
|
label: string;
|
|
|
|
value: number;
|
|
|
|
value: number;
|
|
|
|
|
|
|
|
url: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default function UserCard({ onClose, className }: Props) {
|
|
|
|
export default function UserCard({ onClose, className }: Props) {
|
|
|
@ -27,24 +28,19 @@ export default function UserCard({ onClose, className }: Props) {
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const [userDataList, setUserDataList] = useState<TDataList[]>([
|
|
|
|
const [userDataList, setUserDataList] = useState<UserData[]>([]);
|
|
|
|
{ label: '关注', value: userInfo.followCount },
|
|
|
|
|
|
|
|
{ label: '粉丝', value: userInfo.fansCount },
|
|
|
|
|
|
|
|
{ label: '评论', value: userInfo.commentReplyCount },
|
|
|
|
|
|
|
|
{ label: '获赞', value: userInfo.thumbUpCount },
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleGoMyList = () => {
|
|
|
|
const handleGoMyCollect = () => {
|
|
|
|
router.push('/myList');
|
|
|
|
router.push('/my/collect');
|
|
|
|
onClose();
|
|
|
|
onClose();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
setUserDataList([
|
|
|
|
setUserDataList([
|
|
|
|
{ label: '关注', value: userInfo.followCount },
|
|
|
|
{ label: '关注', value: userInfo.followCount, url: '' },
|
|
|
|
{ label: '粉丝', value: userInfo.fansCount },
|
|
|
|
{ label: '粉丝', value: userInfo.fansCount, url: '' },
|
|
|
|
{ label: '评论', value: userInfo.commentReplyCount },
|
|
|
|
{ label: '评论', value: userInfo.commentReplyCount, url: '' },
|
|
|
|
{ label: '获赞', value: userInfo.thumbUpCount },
|
|
|
|
{ label: '获赞', value: userInfo.thumbUpCount, url: '' },
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}, [userInfo]);
|
|
|
|
}, [userInfo]);
|
|
|
|
|
|
|
|
|
|
|
@ -75,7 +71,7 @@ export default function UserCard({ onClose, className }: Props) {
|
|
|
|
<ul className="px-[15px] mt-[6px]">
|
|
|
|
<ul className="px-[15px] mt-[6px]">
|
|
|
|
<li
|
|
|
|
<li
|
|
|
|
className="flex flex-row justify-between items-center w-[238px] h-[49px] px-[15px] rounded-[3px] text-[15px] leading-[21px] hover:bg-[#f2f3f7] cursor-pointer"
|
|
|
|
className="flex flex-row justify-between items-center w-[238px] h-[49px] px-[15px] rounded-[3px] text-[15px] leading-[21px] hover:bg-[#f2f3f7] cursor-pointer"
|
|
|
|
onClick={handleGoMyList}
|
|
|
|
onClick={handleGoMyCollect}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span>我的收藏</span>
|
|
|
|
<span>我的收藏</span>
|
|
|
|
<Image width={24} height={24} src="/img/icon/love.svg" alt="我的收藏" />
|
|
|
|
<Image width={24} height={24} src="/img/icon/love.svg" alt="我的收藏" />
|
|
|
|