This commit is contained in:
caishi 2021-10-28 17:08:36 +08:00
parent 1c24baf3b9
commit d5f989bbe2
6 changed files with 79 additions and 40 deletions

View File

@ -87,7 +87,7 @@ class Index extends Component {
<Route <Route
path="/" path="/"
render={(props) => ( render={(props) => (
<ProjectIndex {...this.props} {...props} /> <ProjectHome {...this.props} {...props} />
)} )}
></Route> ></Route>
</Switch> </Switch>

View File

@ -50,7 +50,7 @@ class Index extends Component {
this.getCategory(); this.getCategory();
this.getRecommand(); // this.getRecommand();
this.getLanguage(); this.getLanguage();
@ -304,9 +304,9 @@ class Index extends Component {
return ( return (
<div> <div>
<p className="t_project_banner"> {/* <p className="t_project_banner">
<img src={banner} width="100%" alt=""/> <img src={banner} width="100%" alt=""/>
</p> </p> */}
{/* { {/* {
recommendOriList && recommendOriList.length>0? recommendOriList && recommendOriList.length>0?
<Slider {...settings} className="recommandOri"> <Slider {...settings} className="recommandOri">
@ -320,7 +320,7 @@ class Index extends Component {
</Slider> </Slider>
:"" :""
} */} } */}
{ {/* {
recommendList && recommendList.length>0 && recommendList && recommendList.length>0 &&
<Slider {...setting} className={recommendList.length>5 ? "recommandProjects":"recommandProjects mb20"}> <Slider {...setting} className={recommendList.length>5 ? "recommandProjects":"recommandProjects mb20"}>
{ {
@ -341,7 +341,7 @@ class Index extends Component {
}) })
} }
</Slider> </Slider>
} } */}
<div className="ProjectListIndex"> <div className="ProjectListIndex">
<div className="list-left"> <div className="list-left">
<ul className="list-l-Menu"> <ul className="list-l-Menu">

View File

@ -65,11 +65,14 @@
line-height: 28px; line-height: 28px;
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
color: #25EBFF;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 250px; max-width: 250px;
color: #25EBFF;
a{
color: #25EBFF!important;
}
} }
.company{ .company{
height: 20px; height: 20px;
@ -81,6 +84,9 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 250px; max-width: 250px;
a{
color: #FFFFFF!important;
}
} }
} }
.desc{ .desc{
@ -370,7 +376,7 @@
.itemTitle{ .itemTitle{
flex:1; flex:1;
.item-title-infos{ .item-title-infos{
height: 32px; height: 22px;
display: flex; display: flex;
align-items: center; align-items: center;
.infotitle{ .infotitle{
@ -379,7 +385,7 @@
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
line-height: 21px; line-height: 21px;
color: #262626!important; color: #333!important;
&:hover{ &:hover{
color: #466AFF!important; color: #466AFF!important;
} }
@ -393,13 +399,12 @@
} }
} }
.item-desc{ .item-desc{
height: 48px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #414141; color: #414141;
line-height: 24px; line-height: 24px;
max-width: 548px; max-width: 548px;
margin-bottom: 10px; margin: 5px 0px;
} }
.item-data{ .item-data{
font-size: 13px; font-size: 13px;

View File

@ -62,10 +62,10 @@ function SubBanner() {
return( return(
<li> <li>
<div className="projectinfos"> <div className="projectinfos">
<img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /> <Link to={`/${i.author && i.author.login}`}><img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /></Link>
<div> <div>
<p className="name">{i.name}</p> <p className="name"><Link to={`/${i.author && i.author.login}/${i.identifier}`}>{i.name}</Link></p>
<p className="company">{i.author && i.author.name}</p> <p className="company"><Link to={`/${i.author && i.author.login}`}>{i.author && i.author.name}</Link></p>
</div> </div>
</div> </div>
<p className="desc">{i.description}</p> <p className="desc">{i.description}</p>

View File

@ -56,11 +56,11 @@ function SubList() {
return( return(
<li> <li>
<div> <div>
<img src={getImageUrl(`/${i.avatar_url}`)} alt=""/> <Link to={`/${i.login}`}><img src={getImageUrl(`/${i.avatar_url}`)} alt=""/></Link>
<div> <div>
<Link to={`/${i.login}`} className="font-15">{i.name}</Link> <Link to={`/${i.login}`} className="font-15">{i.name}</Link>
<p className="task-hide" style={{maxWidth:"260px"}}> <p className="task-hide" style={{maxWidth:"260px"}}>
<i className="iconfont icon-daimakuicon1 font-14 mr8"></i>{i.project && i.project.name} <Link to={`/${i.login}/${i.project && i.project.identifier}`}><i className="iconfont icon-daimakuicon1 font-14 mr8"></i>{i.project && i.project.name}</Link>
</p> </p>
</div> </div>
</div> </div>
@ -84,7 +84,7 @@ function SubList() {
<li> <li>
<div className="mInfos"> <div className="mInfos">
<span className="num">{k+1}</span> <span className="num">{k+1}</span>
<Link to={`/${i.owner && i.owner.login}`} className="name task-hide">{i.owner && i.owner.name}/{i.name}</Link> <Link to={`/${i.owner && i.owner.login}/${i.identifier}`} className="name task-hide">{i.owner && i.owner.name}/{i.name}</Link>
<span> <span>
<i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises} <i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises}
</span> </span>
@ -113,7 +113,7 @@ function SubList() {
<li> <li>
<div className="mInfos"> <div className="mInfos">
<span className="num">{k+1}</span> <span className="num">{k+1}</span>
<a className="name task-hide">{i.owner && i.owner.name}/{i.name}</a> <Link to={`/${i.owner && i.owner.login}/${i.identifier}`} className="name task-hide">{i.owner && i.owner.name}/{i.name}</Link>
<span> <span>
<i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises} <i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises}
</span> </span>

View File

@ -1,4 +1,4 @@
import React from 'react'; import React , { useEffect , useState } from 'react';
import Hot from '../img/index/hot.png'; import Hot from '../img/index/hot.png';
import Slider from "react-slick"; import Slider from "react-slick";
import huawei from '../img/index/unit/huawei.png'; import huawei from '../img/index/unit/huawei.png';
@ -9,6 +9,9 @@ import xigongye from '../img/index/unit/xigongye.png';
import feiteng from '../img/index/unit/feiteng.png'; import feiteng from '../img/index/unit/feiteng.png';
import xiuos from '../img/index/unit/xiuos.png'; import xiuos from '../img/index/unit/xiuos.png';
import huake from '../img/index/unit/huake.png'; import huake from '../img/index/unit/huake.png';
import axios from 'axios';
import { Link } from 'react-router-dom';
import { getImageUrl } from 'educoder';
const settings = { const settings = {
dots: false, dots: false,
@ -20,31 +23,62 @@ const settings = {
autoplay:true, autoplay:true,
arrows:false arrows:false
}; };
const group_size = 6;
function SubUnitBanner() { function SubUnitBanner() {
const [ list , setlist ] = useState(undefined);
useEffect(()=>{
getRecommandOrz();
},[])
function getRecommandOrz(params) {
const url = `/organizations/recommend.json`;
axios.get(url,{
params:{
group_size
}
}).then(result=>{
if(result){
setlist(result.data.organizations)
}
}).catch(error=>{})
}
return( return(
<div className="unitBanner"> list && list.length > 0 ?
<div className="unitContent"> <div className="unitBanner">
<div className="unitTitle"> <div className="unitContent">
<span>精选开源组织</span> <div className="unitTitle">
<img src={Hot} alt="" width="47px"/> <span>精选开源组织</span>
<img src={Hot} alt="" width="47px"/>
</div>
<Slider {...settings} className="unitSlider">
{
list.map((i,k)=>{
return(
<div className="slickline">
{
i.map((j,k1)=>{
return(
<Link to={j.name}><img src={getImageUrl(`/${j.avatar_url}`)} alt="" height="56px" style={{maxWidth:"180px"}}/></Link>
)
})
}
</div>
)
})
}
{/* <div className="slickline">
<a href="https://www.nwpu.edu.cn/" target="_blank"><img src={xigongye} alt="" height="56px"/></a>
<a href="https://www.phytium.com.cn/" target="_blank"><img src={feiteng} alt="" height="56px"/></a>
<a href="http://xuos.io" target="_blank"><img src={xiuos} alt="" height="56px"/></a>
<a href="https://www.hust.edu.cn/" target="_blank"><img src={huake} alt="" height="56px"/></a>
</div> */}
</Slider>
</div> </div>
<Slider {...settings} className="unitSlider">
<div className="slickline">
<a href="https://www.huawei.com/cn/?ic_medium=direct&ic_source=surlent" target="_blank"><img src={huawei} alt="" height="56px"/></a>
<a href="https://www.inspur.com/" target="_blank"><img src={langchao} alt="" height="56px"/></a>
<a href="https://www.openatom.org/#/" target="_blank"><img src={jijinhui} alt="" height="56px"/></a>
<a href="https://portal.mulanos.cn//" target="_blank"><img src={mulan} alt="" height="56px"/></a>
</div>
<div className="slickline">
<a href="https://www.nwpu.edu.cn/" target="_blank"><img src={xigongye} alt="" height="56px"/></a>
<a href="https://www.phytium.com.cn/" target="_blank"><img src={feiteng} alt="" height="56px"/></a>
<a href="http://xuos.io" target="_blank"><img src={xiuos} alt="" height="56px"/></a>
<a href="https://www.hust.edu.cn/" target="_blank"><img src={huake} alt="" height="56px"/></a>
</div>
</Slider>
</div> </div>
</div> :""
) )
} }
export default SubUnitBanner; export default SubUnitBanner;