From 29732b5e8bcec7a0d3fba72ca1a62409c890da4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Sat, 15 Nov 2025 09:46:23 +0800 Subject: [PATCH] =?UTF-8?q?banner=E5=8F=B3=E4=BE=A7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=89=E6=96=B9=E7=BB=84=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/projectHomeNew/v2/index.jsx | 18 +++++++++++++----- src/forge/Main/projectHomeNew/v2/index.scss | 6 +++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/forge/Main/projectHomeNew/v2/index.jsx b/src/forge/Main/projectHomeNew/v2/index.jsx index 36d63fed..73ad7104 100644 --- a/src/forge/Main/projectHomeNew/v2/index.jsx +++ b/src/forge/Main/projectHomeNew/v2/index.jsx @@ -22,7 +22,7 @@ function ProjectHomePage(props) { const [topicId, setTopicId] = useState(undefined); const [topicDetail, setTopicDetail] = useState(undefined); const [count, setCount] = useState({}); - const {countByGHM, countByOther} = count; + const {countByGHM, countByOther, countByGHMType} = count; const topicsByCateId = cateTopics && cateTopics[cateID]; // const topicsByCateId = cateTopics && cateTopics[cateID] || [ // { @@ -65,7 +65,8 @@ function ProjectHomePage(props) { function getInitCount() { const obj = { countByGHM: 0, - countByOther: 0 + countByOther: 0, + countByGHMType: 0 } axios.get(`/organizations/gh_mirrors/projects.json?page=1&limit=15&sort_by=updated_on&sort_direction=desc`).then(result => { if (result && result.data) { @@ -76,8 +77,10 @@ function ProjectHomePage(props) { if (result && result.data) { obj.countByOther = result.data.total_count - obj.countByGHM } + }).finally(()=>{ + cateTopics[39] && (obj.countByGHMType = cateTopics[39].length) setCount(obj); - }).catch(error => { }) + }) } function getCateTopic() { @@ -152,12 +155,17 @@ function ProjectHomePage(props) {

{countByOther}

- 软件包总数 + 软件数量 +
+ +
+

{countByGHMType}

+ 支持三方组件类型

{countByGHM}

- 可信三方组件数 + 三方组件数
diff --git a/src/forge/Main/projectHomeNew/v2/index.scss b/src/forge/Main/projectHomeNew/v2/index.scss index 9f5cfc90..9b414599 100644 --- a/src/forge/Main/projectHomeNew/v2/index.scss +++ b/src/forge/Main/projectHomeNew/v2/index.scss @@ -50,8 +50,8 @@ } .project_count { - width: 343px; - height: 103px; + width: 500px; + height: 110px; // background-image: url('./img/count_bg.png'); // background-size: 100% 100%; justify-content: space-evenly; @@ -68,7 +68,7 @@ font-family: "YouSheBiaoTiHei"; } .center{ - min-width: 45%; + min-width: 30%; } } }