From 9dc709dd7e2eadbc6a9d4e7ab80919e8fcf16f39 Mon Sep 17 00:00:00 2001 From: qiukai <123@qq.com> Date: Mon, 3 Mar 2025 11:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=BA=90=E4=B8=AD=E5=BF=83=E4=B8=93?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Information/Pages/headerPagebyKyzx.jsx | 286 ++++++++++++++++++ src/forge/Information/index.jsx | 6 + 2 files changed, 292 insertions(+) create mode 100644 src/forge/Information/Pages/headerPagebyKyzx.jsx diff --git a/src/forge/Information/Pages/headerPagebyKyzx.jsx b/src/forge/Information/Pages/headerPagebyKyzx.jsx new file mode 100644 index 000000000..d73326d70 --- /dev/null +++ b/src/forge/Information/Pages/headerPagebyKyzx.jsx @@ -0,0 +1,286 @@ +import React, { useState, useEffect } from 'react'; +import img1 from '../img/img1.png'; +import { httpUrl } from '../fetch'; +import { Link } from 'react-router-dom'; +import shijian from '../img/shijian.png'; +import xuexi from '../img/xuexiguanli.png'; +import { getHomePageList, gethomePageDocList, getAllList, getNewsAllList, getVIPLists } from '../api'; +import axios from 'axios'; +import Partner from '../Component/partner'; +import MemberList from '../Component/memberList'; +import '../indexZonebyCCF.scss'; +import '../indexZone1.scss'; +import "slick-carousel/slick/slick.css"; +import "slick-carousel/slick/slick-theme.css"; +import Slider from 'react-slick'; +import Left from '../../../home/Img/left.png'; +import Right from '../../../home/Img/right.png'; + + +function HeaderPageCCF(props) { + const [projectList, setProjectList] = useState(undefined); + const [personList, setPersonList] = useState(undefined); + const [newsList, setNewsList] = useState(undefined); + const [partnerList, setParterList] = useState(undefined); + const { deptId, cateId } = props.match.params; + const { data, id, temp } = props; + const [mainList, setMainList] = useState(undefined); + const [tag,setTag] = useState(0); + const setting = { + dots: true, + infinite: true, + speed: 2000, + slidesToShow: 1, + slidesToScroll: 1, + pauseOnDotsHover: true, + autoplaySpeed: 5000, + pauseOnFocus: true, + autoplay: true, + arrows: true, + prevArrow: , + nextArrow: , + afterChange: (index)=> setTag(index) + } + + useEffect(() => { + if (id||cateId) { + getProjectList(); + getNewsList(); + getPersonList(); + getPartnerList(); + getMainList(); + } + }, [id,cateId]) + + function getPersonList() { + // 不分类 + // getHomePageList(id).then(result => { + // if (result) { + // setPersonList(result.data.rows); + // } + // }).catch(error => { }) + // 分类获取首页推荐的会员列表 + getVIPLists(id, {isHomepage: 1}).then(response=>{ + if(response){ + const list = response.data.rows && response.data.rows.filter(item=>item.zoneMemberList); + setPersonList(list); + } + }) + } + + function getNewsList() { + gethomePageDocList(id).then(result => { + if (result) { + setNewsList(result.data.rows); + } + }).catch(error => { }) + } + + function getProjectList() { + getAllList(id, { isHomepage: 1 }).then(result => { + if (result) { + setProjectList(result.data.rows); + } + }).catch(console.error()) + } + + function getPartnerList() { + const url = `${httpUrl}/zone/open/${id}/partners/list`; + axios.get(url).then(result => { + if (result) { + const array = result.data.rows; + const newArray = []; + for (let i in array) { + let e = array[i] + if (e.zonePartnersList && e.zonePartnersList.length > 0) { + e.zonePartnersList[0].typeName = e.typeName; + } + if (e.zonePartnersList.length > 0) { + newArray.push(e.zonePartnersList); + } + } + setParterList(newArray); + } + }).catch(error => { }) + } + function getMainList() { + getNewsAllList(id).then(result => { + if (result) { + let rows = result.data.rows; + setMainList(rows); + } + }).catch(error => { }) + } + return ( +
+ { + // 新闻动态 + data && data.cmsShow === 1 && newsList && newsList.length >= 0 && +
+

{data.homepageCmsTitle}

+
+
+ + { + newsList && newsList.length > 0 ? + newsList.map((i, k) => { + return ( +
+
+ {window.location.href=`/zone/${deptId}/newdetail/${i.id}`}} /> +
+
+ ) + }) + : + "" + } +
+
+
    + { + newsList.map((i, k) => { + return ( +
  • + {i.name} +

    + + + {i.publishTime} + +

    {i.visits}

    +

    +
  • + ) + }) + } +
+
+ {/* 图片下三个栏目 */} +
+ { + mainList && mainList.length > 0 ? + mainList.map((i, k) => { + if (i.name === "开源业内资讯" || i.name === "开源战略工作组" || i.name === "开源活动") + return ( +
    +

    + + {i.name} +

    + { + i.cmsDocList && i.cmsDocList.length > 0 ? + i.cmsDocList.map((j, k) => { + return ( +
  • + {j.name} +
  • + ) + }) + : "" + } +
+ ) + }) + : + "" + } +
+
+ } + { + // 精选项目 + data && data.projectShow === 1 && projectList && projectList.length > 0 && +
+

{data.homepageProjectTitle}

+ { +
+ { + projectList.map((i, k) => { + return ( +
  • +
    {i.projectProperties && i.projectProperties.authorImageUrl && }
    +
    + window.open(i.projectURL)} className="z_p_title task-hide">{i.projectProperties && i.projectProperties.name} +

    {i.projectProperties && i.projectProperties.description ? i.projectProperties.description : "暂无~"}

    +
    + { + i.projectProperties.topics && +
      + { + i.projectProperties.topics.split(",").map(t => { + return ( +
    • {t}
    • + ) + }) + } +
    + } +
    +
    +
  • + ) + }) + } +
    + } +
    + } + {data &&

    {data.firstTitle}

    } + { + // 专区简介 + data && (data.introductionTitle || data.introductionContent || data.introductionImage) && +
    +
    + {data.introductionTitle &&

    {data.introductionTitle}

    } +

    +
    + { + data.introductionImage && + + } +
    + } + { + // 核心贡献者 + data && data.memberShow === 1 && personList && personList.length > 0 && +
    +

    {data.homepageMemberTitle}

    + {/* */} + {personList && personList.map(item=>{ + return
    +

    {item.typeName}

    +
      + { + item.zoneMemberList.map((i, k) => { + return ( +
    • + +
      + {i.name} + {i.memberLevel && {i.memberLevel} } +
      +

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

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

    {data.homepagePartnersTitle}

    + +
    + } +
    + ) +} +export default HeaderPageCCF; \ No newline at end of file diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 9dadf8f5e..645fb97a6 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -59,6 +59,11 @@ const HeaderPageCCF = Loadable({ loading : Loading, }); +const HeaderPageKyzx = Loadable({ + loader : () => import("./Pages/headerPagebyKyzx"), + loading : Loading, +}); + const ProjectSource = Loadable({ loader: () => import("./Pages/projectSource"), loading: Loading, @@ -292,6 +297,7 @@ function Index(props){ deptId==="CCF-ODC" ? : deptId === "JCC" ? : deptId === "uos" ? : + deptId==="xjykyzx" ? : temp === tempEnum.zone ? : )}