Skip to content

Let's use AI to Earn!

feat(热门内容): 热点事件添加上升下降排名

gaoSir8c74e994aa12
diff --git a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
index cfb8c8dd..375f1e15 100644
--- a/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
+++ b/src/app/[lng]/hotContent/components/HotContent/hotContent.module.scss
@@ -209,4 +209,4 @@
color: var(--colorPrimary5);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/app/[lng]/hotContent/components/HotEvent/hotEvent.module.scss b/src/app/[lng]/hotContent/components/HotEvent/hotEvent.module.scss
index be04d3cd..143d45c5 100644
--- a/src/app/[lng]/hotContent/components/HotEvent/hotEvent.module.scss
+++ b/src/app/[lng]/hotContent/components/HotEvent/hotEvent.module.scss
@@ -18,11 +18,11 @@
border-radius: 10px 10px 0 0;
}
&-content {
- overflow: auto;
- height: 400px;
- scrollbar-width: none;
- &::-webkit-scrollbar {
- display: none;
+ .ant-table-body {
+ scrollbar-width: none;
+ &::-webkit-scrollbar {
+ display: none;
+ }
}
thead {
.ant-table-cell {
@@ -57,3 +57,36 @@
color: var(--colorPrimary5);
}
}
+
+.ranking {
+ position: relative;
+ display: flex;
+ align-items: center;
+ :global {
+ .rankingTopthree-rise, .rankingTopthree-fall {
+ position: absolute;
+ display: flex;
+ align-items: center;
+ top: 50%;
+ right: 0;
+ transform: translate(40%, -50%);
+ .anticon {
+ font-size: 12px;
+ }
+ }
+ .rankingTopthree-name {
+ position: relative;
+ left: -10px;
+ font-size: var(--fs-xs);
+ }
+ .rankingTopthree-rise {
+ color: var(--error-color);
+ }
+ .rankingTopthree-fall {
+ color: var(--success-color);
+ .anticon {
+ transform: rotate(180deg);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/app/[lng]/hotContent/components/HotEvent/index.tsx b/src/app/[lng]/hotContent/components/HotEvent/index.tsx
index 64f1d0dc..aa5abc63 100644
--- a/src/app/[lng]/hotContent/components/HotEvent/index.tsx
+++ b/src/app/[lng]/hotContent/components/HotEvent/index.tsx
@@ -22,6 +22,7 @@ import { Spin, Table, type TableProps } from "antd";
import { describeNumber } from "@/utils";
import hotContentStyles from "../HotContent/hotContent.module.scss";
import drawHotEventEchartLine from "@/app/[lng]/hotContent/components/HotEvent/echart/drawHotEventEchartLine";
+import Uparrow from "../../svgs/uparrow.svg";
const material = [
{
@@ -71,7 +72,7 @@ const HotTrendLine: React.FC<{ id: string; data: HotValueHistory[] }> = ({
drawHotEventEchartLine(id, data);
}, [id, data]);
- return <div id={id} style={{ width: "180px", height: "50px" }}></div>;
+ return <div id={id} style={{ width: "180px", height: "25px" }}></div>;
};
const HotEvent = memo(
@@ -101,7 +102,7 @@ const HotEvent = memo(
title: "排名",
width: 60,
render: (text, data, ind) => (
- <>
+ <div className={styles.ranking}>
{ind <= 2 ? (
<div
className={hotContentStyles.rankingTopthree}
@@ -112,7 +113,23 @@ const HotEvent = memo(
) : (
<p style={{ width: "20px", textAlign: "center" }}>{ind + 1}</p>
)}
- </>
+
+ {!data.rankChange ? null : data.rankChange > 0 ? (
+ <p className="rankingTopthree-rise">
+ <Icon component={Uparrow} />
+ <span className="rankingTopthree-name">
+ {data.rankChange}
+ </span>
+ </p>
+ ) : (
+ <p className="rankingTopthree-fall">
+ <Icon component={Uparrow} />
+ <span className="rankingTopthree-name">
+ {Math.abs(data.rankChange)}
+ </span>
+ </p>
+ )}
+ </div>
),
},
{
@@ -137,7 +154,11 @@ const HotEvent = memo(
title: "热度值",
align: "center",
render: (text, record) => {
- return <span>{describeNumber(record.hotValue)}</span>;
+ return (
+ <span style={{ fontFamily: "DIN" }}>
+ {describeNumber(record.hotValue)}
+ </span>
+ );
},
},
@@ -174,6 +195,7 @@ const HotEvent = memo(
columns={getColumns(topics)}
rowKey={(record) => record._id}
pagination={false}
+ scroll={{ y: 400 }}
/>
</div>
</div>