forked from Gitlink/forgeplus-react
This commit is contained in:
parent
e6c26ca320
commit
bb0dd39ad9
|
|
@ -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(
|
||||
<div className="boxmain zone_c_lists pt40">
|
||||
{
|
||||
personList && personList.length > 0 ?
|
||||
showList && showList.length > 0 ?
|
||||
<Slider {...settings}>
|
||||
{
|
||||
personList.map((i,k)=>{
|
||||
showList.map((i,k)=>{
|
||||
return(
|
||||
<div className="container">
|
||||
<div className="c_item">
|
||||
<Link to={`/${i.login}`}><img src={i.imageUrl} alt="" /></Link>
|
||||
<span className="c_name">{i.name}</span>
|
||||
<p className="c_desc task-hide-2" style={{display:i.introduction?"":"flex"}}>{i.introduction || "暂无~"}</p>
|
||||
</div>
|
||||
{ i.name &&
|
||||
<div className="c_item">
|
||||
<Link to={`/${i.login}`}><img src={i.imageUrl} alt="" /></Link>
|
||||
<span className="c_name">{i.name}</span>
|
||||
<p className="c_desc task-hide-2" style={{display:i.introduction?"":"flex"}}>{i.introduction || "暂无~"}</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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;) {
|
||||
|
|
|
|||
|
|
@ -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: <SamplePrevArrow className="left_arraw"/>
|
||||
};
|
||||
|
||||
|
||||
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(
|
||||
<div className="boxmain">
|
||||
{
|
||||
projectList && projectList.length > 0 ?
|
||||
<Slider {...settings}>
|
||||
<Slider ref={sliderRef} {...settings}>
|
||||
{
|
||||
projectList.map((i,k)=>{
|
||||
return(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
<div className="zone_box">
|
||||
{data && <p className="in_title">{data.firstTitle}</p> }
|
||||
|
|
@ -162,10 +173,10 @@ function HeaderPage(props){
|
|||
|
||||
{
|
||||
// 合作伙伴
|
||||
data && data.partnersShow === 1 &&
|
||||
data && data.partnersShow === 1 && partnerList && partnerList.length > 0 &&
|
||||
<div className="zone_parter">
|
||||
<p className="in_title">{ data.homepagePartnersTitle }</p>
|
||||
<Partner id={ id }></Partner>
|
||||
<Partner id={ id } partnerList={ partnerList }></Partner>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
<div className="zone1_box">
|
||||
{
|
||||
|
|
@ -258,14 +269,14 @@ function HeaderPage(props){
|
|||
|
||||
<div className="zone_communicate">
|
||||
<p className="in_title">集萃群智经验 交流心得体会</p>
|
||||
<button>立即加入</button>
|
||||
<button onClick={() => { window.location.href = 'https://forum.gitlink.org.cn/forums/theme/135' }}>立即加入</button>
|
||||
</div>
|
||||
{
|
||||
// 合作伙伴
|
||||
data && data.partnersShow === 1 &&
|
||||
data && data.partnersShow === 1 && partnerList && partnerList.length > 0 &&
|
||||
<div className="zone_parter">
|
||||
<p className="in_title">{ data.homepagePartnersTitle }</p>
|
||||
<Partner id={ id }></Partner>
|
||||
<Partner id={ id } partnerList={ partnerList }></Partner>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/zone/${deptId}/newdetail/${i.id}`)}} key={k}>
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/${temp}/${deptId}/newdetail/${i.id}`)}} key={k}>
|
||||
{
|
||||
i.headImg ?
|
||||
<img src={i.headImg} alt=""/>
|
||||
|
|
@ -127,7 +128,7 @@ function NewsList(props){
|
|||
<DefaultImg name="GitLink" title={details && details.name} />
|
||||
}
|
||||
<div style={{flex:1,width:0}}>
|
||||
<Link to={`/zone/${deptId}/newdetail/${i.id}`} className={`sub_name task-hide`}>{i.name}</Link>
|
||||
<Link to={`/${temp}/${deptId}/newdetail/${i.id}`} className={`sub_name task-hide`}>{i.name}</Link>
|
||||
<p className={`sub_desc task-hide-2`}>
|
||||
{i.summary}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ function ProjectSource(props){
|
|||
{/* <Banner {...props}/> */}
|
||||
<div className="boxmain" style={{paddingTop:"56px"}}>
|
||||
<p className="in_title">开源项目</p>
|
||||
{ temp === 'zone1' && <p className="project_sub_title">聚合开源特色项目,搭建硬件开源服务桥梁</p> }
|
||||
<Box>
|
||||
<ul className="in_pro_menu">
|
||||
<li className="u_t"><i className="iconfont icon-muluicon font-15 mr10 mt2" style={{color:"#1f2329"}} />项目分类</li>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function ZoneVIP(props){
|
|||
|
||||
return(
|
||||
<div className={`boxmain ${temp}_VIP_box`}>
|
||||
<p className="in_title">专区会员</p>
|
||||
<p className="in_title">{ tempConfig[temp].member }</p>
|
||||
<p className="vip_sub_title">{ tempConfig[temp].vipDesc }</p>
|
||||
<Spin spinning={isSpin}>
|
||||
<div style={{minHeight:400}}>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue