项目首页-精选项目-固定八个组织

This commit is contained in:
caishi 2021-12-02 16:27:11 +08:00
parent 472ea69e29
commit a1cc59e89b
1 changed files with 32 additions and 24 deletions

View File

@ -23,27 +23,41 @@ const settings = {
autoplay:true, autoplay:true,
arrows:false arrows:false
}; };
const group_size = 6; // const group_size = 6;
const list =[
[
{url:"/Huawei_Technology",avatar_url:huawei,name:"华为技术有限公司"},
{url:"/openatom_foundation",avatar_url:jijinhui,name:"开放原子开源基金会"},
{url:"/Inspur",avatar_url:langchao,name:"浪潮信息"},
{url:"/mulan-community",avatar_url:mulan,name:"木兰开源社区"},
],
[
{url:"/CrowdOS_WeSense",avatar_url:xigongye,name:"西北工业大学"},
{url:"/pkecosystem",avatar_url:feiteng,name:"PK开源生态项目组"},
{url:"/xuos",avatar_url:xiuos,name:"泛在操作系统实验室"},
{url:"/hustos",avatar_url:huake,name:"华中科技大学操作系统团队"},
]
]
function SubUnitBanner() { function SubUnitBanner() {
const [ list , setlist ] = useState(undefined); // const [ list , setlist ] = useState(undefined);
useEffect(()=>{ // useEffect(()=>{
getRecommandOrz(); // getRecommandOrz();
},[]) // },[])
function getRecommandOrz(params) { // function getRecommandOrz(params) {
const url = `/organizations/recommend.json`; // const url = `/organizations/recommend.json`;
axios.get(url,{ // axios.get(url,{
params:{ // params:{
group_size // group_size
} // }
}).then(result=>{ // }).then(result=>{
if(result){ // if(result){
setlist(result.data.organizations) // setlist(result.data.organizations)
} // }
}).catch(error=>{}) // }).catch(error=>{})
} // }
return( return(
list && list.length > 0 ? list && list.length > 0 ?
<div className="unitBanner"> <div className="unitBanner">
@ -60,7 +74,7 @@ function SubUnitBanner() {
{ {
i.map((j,k1)=>{ i.map((j,k1)=>{
return( return(
<Link to={j.name}><img src={getImageUrl(`/${j.avatar_url}`)} alt="" height="56px" style={{maxWidth:"180px"}}/></Link> <Link to={j.url}><img src={j.avatar_url} title={j.name} alt={j.name} height="56px" style={{maxWidth:"180px"}}/></Link>
) )
}) })
} }
@ -68,12 +82,6 @@ function SubUnitBanner() {
) )
}) })
} }
{/* <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> </Slider>
</div> </div>
</div> </div>