Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 热门内容详情开发中
gaoSir7941fcdc678a
diff --git a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scssindex 22ad1bab..483b4e93 100644--- a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss+++ b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss@@ -218,3 +218,22 @@}}}++.baseInfoPopver {+ display: flex;+ flex-direction: column;+ width: 500px;+ height: 400px;+ :global {+ .baseInfoPopver-head {++ }+ .baseInfoPopver-content {+ height: 100%;+ overflow: auto;+ }+ .baseInfoPopver-footer {++ }+ }+}diff --git a/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx b/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsxindex 0499d59f..9c827ee9 100644--- a/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx+++ b/src/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget.tsx@@ -2,7 +2,7 @@ import styles from "@/app/[lng]/hotContent/components/HotContent/hotContent.moduimport Icon from "@ant-design/icons";import Uparrow from "@/app/[lng]/hotContent/svgs/uparrow.svg";import { describeNumber } from "@/utils";-import { Avatar } from "antd";+import { Avatar, Popover } from "antd";import { useTransClient } from "@/app/i18n/client";export const AnaAddCall = ({@@ -67,6 +67,7 @@ export const HotContentBaseInfo = ({fansCount,publishTime,onClick,+ coverPopoverContent,}: {cover: string;title: string;@@ -74,12 +75,15 @@ export const HotContentBaseInfo = ({nickname: string;fansCount?: number;publishTime: string;+ coverPopoverContent?: React.ReactNode;onClick?: () => void;}) => {const { t } = useTransClient("hot-content");return (<div className={styles.baseInfo}>- <img className="baseInfo-cover" src={cover} />+ <Popover placement="right" content={coverPopoverContent}>+ <img className="baseInfo-cover" src={cover} />+ </Popover><div className="baseInfo-right">{title ? (<div className="baseInfo-right-title" title={title}>diff --git a/src/app/[lng]/hotContent/components/HotContent/index.tsx b/src/app/[lng]/hotContent/components/HotContent/index.tsxindex 91360c92..554fddfa 100644--- a/src/app/[lng]/hotContent/components/HotContent/index.tsx+++ b/src/app/[lng]/hotContent/components/HotContent/index.tsx@@ -31,6 +31,7 @@ import {} from "@/app/[lng]/hotContent/components/HotContent/hotContentCommonWidget";import { useTransClient } from "@/app/i18n/client";import CryptoJS from "crypto-js";+import { AccountPlatInfoMap, PlatType } from "@/app/config/platConfig";export interface IHotContentRef {}@@ -115,13 +116,40 @@ const HotContent = memo(case "shipinhao":break;}- console.log(selectedLabelInfo.ranking.platform.type);-- console.log(data);},[selectedLabelInfo],);+ // 热门内容的平台类型转换到本地枚举+ const getPlatEnum = (type: string) => {+ switch (type) {+ case "douyin":+ return {+ plat: PlatType.Douyin,+ };+ case "xiaohongshu":+ return {+ plat: PlatType.Xhs,+ };+ case "kuaishou":+ return {+ plat: PlatType.KWAI,+ };+ case "bilibili":+ return {+ plat: PlatType.BILIBILI,+ };+ case "shipinhao":+ return {+ plat: PlatType.WxSph,+ };+ case "wechat":+ return {+ plat: PlatType.WxGzh,+ };+ }+ };+const columns = useMemo(() => {const callParamsColumnsCommon = (title: string) => {return {@@ -299,8 +327,21 @@ const HotContent = memo(title: t("baseInfo"),dataIndex: "baseInfo",render: (text, data) => {+ const platInfo = getPlatEnum(+ selectedLabelInfo.ranking.platform.type,+ );+ const platConfig = AccountPlatInfoMap.get(platInfo!.plat)!;+ console.log(platConfig);+return (<HotContentBaseInfo+ // coverPopoverContent={+ // <div className={styles.baseInfoPopver}>+ // <div className="baseInfoPopver-head"></div>+ // <div className="baseInfoPopver-content"></div>+ // <div className="baseInfoPopver-footer"></div>+ // </div>+ // }title={data.title}avatar={data.author.avatar}publishTime={data.publishTime}