From bb0dd39ad9f3b1ce782f0e101cabbd2f903e9142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Mon, 12 Jun 2023 11:24:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Information/Component/contributor.jsx | 28 +++++++++++++------ src/forge/Information/Component/partner.jsx | 15 ++-------- src/forge/Information/Component/projects.jsx | 19 +++++++++---- src/forge/Information/Pages/headerPage.jsx | 15 ++++++++-- .../Information/Pages/headerPageZone1.jsx | 17 +++++++++-- src/forge/Information/Pages/newsList.jsx | 5 ++-- src/forge/Information/Pages/projectSource.jsx | 1 + src/forge/Information/Pages/zoneVIP.jsx | 2 +- src/forge/Information/index.scss | 7 +++++ src/forge/Information/indexZone1.scss | 6 ++-- 10 files changed, 79 insertions(+), 36 deletions(-) diff --git a/src/forge/Information/Component/contributor.jsx b/src/forge/Information/Component/contributor.jsx index 79f5ce294..32459f7ae 100644 --- a/src/forge/Information/Component/contributor.jsx +++ b/src/forge/Information/Component/contributor.jsx @@ -1,4 +1,4 @@ -import React , { useEffect } from 'react'; +import React , { useEffect, useState } from 'react'; import Slider from 'react-slick'; import { Link } from 'react-router-dom'; @@ -14,20 +14,32 @@ const settings = { function Contributor(props) { const { personList } = props + const [ showList, setShowList] = useState([]); + + function initList() { + setShowList([].concat(personList, new Array(personList.length % 3 - 1).fill({}))) + } + + useEffect(()=>{ + initList(); + },[personList]) + return(
{ - personList && personList.length > 0 ? + showList && showList.length > 0 ? { - personList.map((i,k)=>{ + showList.map((i,k)=>{ return(
-
- - {i.name} -

{i.introduction || "暂无~"}

-
+ { i.name && +
+ + {i.name} +

{i.introduction || "暂无~"}

+
+ }
) }) diff --git a/src/forge/Information/Component/partner.jsx b/src/forge/Information/Component/partner.jsx index c50ea6245..46ec8566f 100644 --- a/src/forge/Information/Component/partner.jsx +++ b/src/forge/Information/Component/partner.jsx @@ -16,21 +16,12 @@ const settings = { }; function Partner(props) { const [ topics ,setTopics ] = useState(undefined); - const { id } = props; - + const { id, partnerList } = props; + console.log(partnerList) useEffect(()=>{ - getPartnerList(); + getUnit(partnerList); },[id]) - function getPartnerList(){ - const url = `${httpUrl}/zone/open/${id}/partners/list`; - axios.get(url).then(result=>{ - if(result){ - getUnit(result.data.rows) - } - }).catch(error=>{}) - } - function getUnit(array){ const newArray = []; for(let i = 0; i< array.length;) { diff --git a/src/forge/Information/Component/projects.jsx b/src/forge/Information/Component/projects.jsx index 65301e097..6ddbee7c8 100644 --- a/src/forge/Information/Component/projects.jsx +++ b/src/forge/Information/Component/projects.jsx @@ -1,4 +1,4 @@ -import React , { useEffect } from 'react'; +import React , { useEffect, useRef } from 'react'; import Slider from 'react-slick'; import projectRight from '../img/projectRight.png'; import projectLeft from '../img/projectLeft.png'; @@ -17,12 +17,10 @@ function SamplePrevArrow(props) { ); } - - const settings = { className: "center", centerMode: true, - infinite: false, + infinite: true, centerPadding: "100px", slidesToShow: 3, speed: 500, @@ -30,14 +28,23 @@ const settings = { prevArrow: }; + function Projects(props) { - const { projectList } = props + const { projectList } = props; + const sliderRef = useRef(null) + + useEffect(()=>{ + if(sliderRef && projectList && projectList.length > 2){ + sliderRef.current.slickNext() + } + },[sliderRef]) + return(
{ projectList && projectList.length > 0 ? - + { projectList.map((i,k)=>{ return( diff --git a/src/forge/Information/Pages/headerPage.jsx b/src/forge/Information/Pages/headerPage.jsx index 8ba5ccf5d..e81620c8e 100644 --- a/src/forge/Information/Pages/headerPage.jsx +++ b/src/forge/Information/Pages/headerPage.jsx @@ -13,6 +13,7 @@ function HeaderPage(props){ const [ projectList , setProjectList ] = useState(undefined); const [ personList , setPersonList ] = useState(undefined); const [ newsList, setNewsList ] = useState(undefined); + const [ partnerList, setParterList ] = useState(undefined); const { deptId } = props.match.params; const { data, id } = props; const temp = props.pathName @@ -53,6 +54,16 @@ function HeaderPage(props){ } }).catch(console.error()) } + + function getPartnerList(){ + const url = `${httpUrl}/zone/open/${id}/partners/list`; + axios.get(url).then(result=>{ + if(result){ + console.log(result) + setParterList(result.data.rows); + } + }).catch(error=>{}) + } return(
{data &&

{data.firstTitle}

} @@ -162,10 +173,10 @@ function HeaderPage(props){ { // 合作伙伴 - data && data.partnersShow === 1 && + data && data.partnersShow === 1 && partnerList && partnerList.length > 0 &&

{ data.homepagePartnersTitle }

- +
}
diff --git a/src/forge/Information/Pages/headerPageZone1.jsx b/src/forge/Information/Pages/headerPageZone1.jsx index 51e9eb3fd..5c060d602 100644 --- a/src/forge/Information/Pages/headerPageZone1.jsx +++ b/src/forge/Information/Pages/headerPageZone1.jsx @@ -26,6 +26,7 @@ function HeaderPage(props){ const [ projectList , setProjectList ] = useState(undefined); const [ personList , setPersonList ] = useState(undefined); const [ newsList, setNewsList ] = useState(undefined); + const [ partnerList, setParterList ] = useState(undefined); const { deptId } = props.match.params; const { data, id } = props; const temp = props.pathName @@ -64,6 +65,7 @@ function HeaderPage(props){ getProjectList(); getNewsList(); getPersonList(); + getPartnerList(); } },[id]) @@ -95,6 +97,15 @@ function HeaderPage(props){ } }).catch(console.error()) } + + function getPartnerList(){ + const url = `${httpUrl}/zone/open/${id}/partners/list`; + axios.get(url).then(result=>{ + if(result){ + setParterList(result.data.rows); + } + }).catch(error=>{}) + } return(
{ @@ -258,14 +269,14 @@ function HeaderPage(props){

集萃群智经验 交流心得体会

- +
{ // 合作伙伴 - data && data.partnersShow === 1 && + data && data.partnersShow === 1 && partnerList && partnerList.length > 0 &&

{ data.homepagePartnersTitle }

- +
} diff --git a/src/forge/Information/Pages/newsList.jsx b/src/forge/Information/Pages/newsList.jsx index e235534ec..7e1f59d05 100644 --- a/src/forge/Information/Pages/newsList.jsx +++ b/src/forge/Information/Pages/newsList.jsx @@ -22,6 +22,7 @@ function NewsList(props){ const [ details , setDetails ] = useState(undefined); const [ menuSpin , setMenuSpin ] = useState(true); const { id } = props; + const temp = props.pathName useEffect(()=>{ @@ -119,7 +120,7 @@ function NewsList(props){ mainList && mainList.length>0 && mainList.map((i,k)=>{ return( -
{props.history.push(`/zone/${deptId}/newdetail/${i.id}`)}} key={k}> +
{props.history.push(`/${temp}/${deptId}/newdetail/${i.id}`)}} key={k}> { i.headImg ? @@ -127,7 +128,7 @@ function NewsList(props){ }
- {i.name} + {i.name}

{i.summary}

diff --git a/src/forge/Information/Pages/projectSource.jsx b/src/forge/Information/Pages/projectSource.jsx index 37a0e4b18..c2575644e 100644 --- a/src/forge/Information/Pages/projectSource.jsx +++ b/src/forge/Information/Pages/projectSource.jsx @@ -82,6 +82,7 @@ function ProjectSource(props){ {/* */}

开源项目

+ { temp === 'zone1' &&

聚合开源特色项目,搭建硬件开源服务桥梁

}
  • 项目分类
  • diff --git a/src/forge/Information/Pages/zoneVIP.jsx b/src/forge/Information/Pages/zoneVIP.jsx index f50fcd463..164057897 100644 --- a/src/forge/Information/Pages/zoneVIP.jsx +++ b/src/forge/Information/Pages/zoneVIP.jsx @@ -35,7 +35,7 @@ function ZoneVIP(props){ return(
    -

    专区会员

    +

    { tempConfig[temp].member }

    { tempConfig[temp].vipDesc }

    diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 4e2f01a61..0212cd430 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -461,6 +461,13 @@ } .in_pro{ padding-bottom: 80px; + .project_sub_title { + margin-top: 15px; + color: #1f2329; + font-size: 17px; + line-height: 27px; + text-align: center; + } .in_list{ padding:30px 30px 30px 35px; background-color: #fff; diff --git a/src/forge/Information/indexZone1.scss b/src/forge/Information/indexZone1.scss index 9c9535288..c30c94c04 100644 --- a/src/forge/Information/indexZone1.scss +++ b/src/forge/Information/indexZone1.scss @@ -104,7 +104,7 @@ font-size: 18px; } .new_first_desc { - opacity: 80%; + opacity: 0.8; height: 20px; color: #ffffff; font-size: 14px; @@ -253,7 +253,6 @@ border-radius: 50%; } .z_p_title { - height: 22px; font-weight: 700; color: #1f2329; font-size: 16px; @@ -502,6 +501,9 @@ } .zone1_VIP_box{ padding:50px 0px; + .in_title{ + font-size: 38px; + } .vip_sub_title{ margin-top: 25px; color: #1f2329;