Skip to content

Let's use AI to Earn!

feat(热门内容): 添加小红书作者跳转

gaoSir48f6175d1108
diff --git a/src/api/hot.ts b/src/api/hot.ts
index 1f4884e9..ebf111bb 100644
--- a/src/api/hot.ts
+++ b/src/api/hot.ts
@@ -104,6 +104,7 @@ export interface RankingContent {
name: string;
avatar: string;
fansCount: number;
+ id: string;
};
stats: Stats;
collectCount?: number;
diff --git a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
index 7e5ca71a..22ad1bab 100644
--- a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
+++ b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
@@ -66,8 +66,8 @@
.hotContent--wechat, .hotContent--bilibili {
.baseInfo-cover {
- width: 100px !important;
- height: 60px !important;
+ width: 110px !important;
+ height: 75px !important;
}
}
}
diff --git a/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx b/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx
index d56810a9..0499d59f 100644
--- a/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx
+++ b/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx
@@ -91,7 +91,8 @@ export const HotContentBaseInfo = ({
<div
className="baseInfo-right-author"
- onClick={() => {
+ onClick={(e) => {
+ e.stopPropagation();
if (onClick) onClick();
}}
>
diff --git a/src/app/[lng]/hotContent/components/HotContent/index.tsx b/src/app/[lng]/hotContent/components/HotContent/index.tsx
index fd61bd7f..c9863967 100644
--- a/src/app/[lng]/hotContent/components/HotContent/index.tsx
+++ b/src/app/[lng]/hotContent/components/HotContent/index.tsx
@@ -94,6 +94,33 @@ const HotContent = memo(
};
}, [labelData, rankingData, datesData, twoMenuKey, currentRankCategory]);
+ // 跳转到作者主页
+ const goAuthorPage = useCallback(
+ (data: RankingContent) => {
+ switch (selectedLabelInfo.ranking.platform.type) {
+ case "douyin":
+ console.log(data);
+ break;
+ case "xiaohongshu":
+ window.open(
+ `https://www.xiaohongshu.com/user/profile/${data.author.id}`,
+ "_blank",
+ );
+ break;
+ case "kuaishou":
+ break;
+ case "bilibili":
+ break;
+ case "shipinhao":
+ break;
+ }
+ console.log(selectedLabelInfo.ranking.platform.type);
+
+ console.log(data);
+ },
+ [selectedLabelInfo],
+ );
+
const columns = useMemo(() => {
const callParamsColumnsCommon = (title: string) => {
return {
@@ -279,6 +306,9 @@ const HotContent = memo(
fansCount={data.author.fansCount}
nickname={data.author.name}
cover={data.cover}
+ onClick={() => {
+ goAuthorPage(data);
+ }}
/>
);
},