diff --git a/src/forge/Information/Pages/JCC/homePage.jsx b/src/forge/Information/Pages/JCC/homePage.jsx index 72caf0e48..08b37d1fb 100644 --- a/src/forge/Information/Pages/JCC/homePage.jsx +++ b/src/forge/Information/Pages/JCC/homePage.jsx @@ -1,9 +1,221 @@ -import React, { } from 'react'; -import './index.scss'; +import React,{ useState, useEffect } from 'react'; +import { httpUrl } from '../../fetch'; -function HomePage(props) { - return ( -
云际计算社区首页(自定义)
- ) +import visionFw from '../../img/vision-fw.png'; +import visionYj from '../../img/vision-yj.png'; +import visionZy from '../../img/vision-zy.png'; +import visionJz from '../../img/vision-jz.png'; +import guideArrow from '../../img/guideArrow1.png'; +import { Link } from 'react-router-dom'; +import shijian from '../../img/shijian.png'; +import axios from 'axios'; +import Projects from '../../Component/projects'; +import Partner from '../../Component/partner'; +import '../../indexZone1.scss' +import './index.scss' +import { Popover } from 'antd'; + +function HeaderPageJCC(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, history } = props; + + const vision = [ + {imageUrl: visionFw, title: '服务无边界'}, + {imageUrl: visionYj, title: '云间有协作'}, + {imageUrl: visionZy, title: '资源易共享'}, + {imageUrl: visionJz, title: '价值可交换'} + ] + + + useEffect(()=>{ + if(id){ + getProjectList(); + getNewsList(); + getPersonList(); + getPartnerList(); + } + },[id]) + + function getPersonList(){ + const url = `${httpUrl}/zone/open/${id}/member/homePageList`; + axios.get(url).then(result=>{ + if(result){ + setPersonList(result.data.rows); + } + }).catch(error=>{}) + } + + function getNewsList(){ + const url = `${httpUrl}/cms/doc/open/zone/${id}/homePageDocList`; + axios.get(url).then(result=>{ + if(result){ + setNewsList(result.data.rows); + } + }).catch(error=>{}) + } + + function getProjectList(){ + const url = `${httpUrl}/zone/open/${id}/project/list`; + axios.get(url,{params:{ + isHomepage:1 + }}).then(result=>{ + if(result){ + if (result.data.rows.length < 3) { + setProjectList(result.data.rows) + } else { + 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=>{}) + } + return( +
+ { + // 专区简介 + data && (data.introductionTitle || data.introductionContent || data.introductionImage) && +
+
+ {data &&

{data.firstTitle}

} +

{data.introductionTitle}

+

+
+ { + data.introductionImage && + + } +
+ } +
+

宗旨及愿景

+
+ { + vision.map((i, k) => { + return ( +
+
+ +
+

{ i.title }

+
+ ) + }) + } +
+
+ { + // 新闻动态 + data && data.cmsShow === 1 && newsList && newsList.length>0 && +
+
+

{ data.homepageCmsTitle }

+
+

+ 1 + {newsList[0].name} +

+

{newsList[0].summary}

+

+ + + {newsList[0].publishTime} + + 查看更多 +

+
+
    + { + newsList.map((i,k)=>{ + return( + k > 0 && +
    { history.push(`/zone/${deptId}/newdetail/${i.id}`) }}> +
  • +

    + {k + 1} + {i.name} +

    +

    {i.summary}

    +

    + + + {i.publishTime} + + 查看详情 +

    +
  • +
    + ) + }) + } +
+
+
+ } + { + // 精选项目 + data && data.projectShow === 1 && projectList && projectList.length > 0 && +
+

{ data.homepageProjectTitle }

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

{ data.homepageMemberTitle }

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

{ data.homepagePartnersTitle }

+ +
+ } + +
+ ) } -export default HomePage; \ No newline at end of file +export default HeaderPageJCC; \ No newline at end of file diff --git a/src/forge/Information/Pages/JCC/index.scss b/src/forge/Information/Pages/JCC/index.scss index e69de29bb..0be308023 100644 --- a/src/forge/Information/Pages/JCC/index.scss +++ b/src/forge/Information/Pages/JCC/index.scss @@ -0,0 +1,82 @@ + +.zone_jcc_box{ + background-color: #f7f7f7; + .zone_infos{ + position: relative; + &>img{ + position: absolute; + right: 0; + top: 0; + } + .zone_infos_desc{ + .tleft{ + text-align: left; + margin-bottom: 25px !important; + } + .z_name{ + font-size: 20px; + } + .z_desc{ + background: white; + padding: 50px 250px 50px 50px; + margin-right: 350px; + color: inherit; + } + } + } + .zone_contributor{ + min-height: 466px; + background-color: #F7F9FC; + padding:44px 0px 30px; + .zone_c_lists{ + display: flex; + align-items: center; + margin-top: 50px; + flex-wrap: wrap; + li{ + // background-image: url(./img/contributebg.png); + box-shadow:0px 0px 15px rgba(49,61,113,0.06); + background-size: 100% 100%; + width: 110px; + height: 110px; + border:1px solid #fff; + display: flex; + flex-direction: column; + align-items: center; + border-radius: 50%; + margin-bottom: 40px!important; + margin-right: 40px; + & img{ + width: 110px; + height: 110px; + border-radius: 50%; + margin-bottom: 16px; + } + } + } + } + .zone_vision { + .vision_item { + .vision_icon { + img { + width: 50%; + } + } + .vision_title { + margin-top: 0; + font-weight: 600; + } + } + } +} + .zone_popover{ + width: 300px; + :global{ + .ant-popover-title{ + font-weight: 600; + } + .ant-popover-content{ + width: 300px; + } + } + } diff --git a/src/forge/Information/img/vision-fw.png b/src/forge/Information/img/vision-fw.png new file mode 100644 index 000000000..711112b5d Binary files /dev/null and b/src/forge/Information/img/vision-fw.png differ diff --git a/src/forge/Information/img/vision-jz.png b/src/forge/Information/img/vision-jz.png new file mode 100644 index 000000000..5ef9e6bd8 Binary files /dev/null and b/src/forge/Information/img/vision-jz.png differ diff --git a/src/forge/Information/img/vision-yj.png b/src/forge/Information/img/vision-yj.png new file mode 100644 index 000000000..fb6bce4b3 Binary files /dev/null and b/src/forge/Information/img/vision-yj.png differ diff --git a/src/forge/Information/img/vision-zy.png b/src/forge/Information/img/vision-zy.png new file mode 100644 index 000000000..c6535b405 Binary files /dev/null and b/src/forge/Information/img/vision-zy.png differ