diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 0d146204c..9877c4eaf 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3971,9 +3971,12 @@ html>body #ajax-indicator { display: block; height: 100%; width: 100%; - color: #333; + color: #fff; font-size: 16px; } +.head-right i{ + color: #fff!important; +} .head-nav ul#header-nav li a:hover,.head-nav ul#header-nav li.active a { color: #5091FF; diff --git a/src/App.js b/src/App.js index 3072aca5b..5b745a709 100644 --- a/src/App.js +++ b/src/App.js @@ -322,6 +322,13 @@ class App extends Component { {/* 查询 */} + ( + + ) + } + /> ( diff --git a/src/forge/Component/HeadSearch.jsx b/src/forge/Component/HeadSearch.jsx index fb7c9f25a..10b829a23 100644 --- a/src/forge/Component/HeadSearch.jsx +++ b/src/forge/Component/HeadSearch.jsx @@ -32,7 +32,7 @@ export default ({history}) => { /> : - { + { setOpenSearch(true) }} /> } diff --git a/src/forge/Head/Footer.jsx b/src/forge/Head/Footer.jsx index 52c068586..8a69c2ad1 100644 --- a/src/forge/Head/Footer.jsx +++ b/src/forge/Head/Footer.jsx @@ -19,7 +19,7 @@ function Footer(){ return(
-
+
{value && showhtml(value)} {/*
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index ac139351e..622eef3c6 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -433,7 +433,7 @@ class NewHeader extends Component { { current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)? - + :"" } @@ -448,7 +448,7 @@ class NewHeader extends Component { > {current_user && - + } @@ -457,10 +457,10 @@ class NewHeader extends Component {
{!user || (user && !user.login) ? - this.educoderlogin()} className="mr5 color-grey-6">登录 + this.educoderlogin()} className="mr5 color-white">登录 { settings && settings.common && settings.common.register && - 注册 + 注册 } : diff --git a/src/forge/Index.js b/src/forge/Index.js index c2e369169..a3770fcc5 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -22,6 +22,11 @@ const ProjectIndex = Loadable({ loading: Loading, }); +const ProjectHome = Loadable({ + loader: () => import("./Main/projecthome/Index"), + loading: Loading, +}); + // 项目详情放在用户和组织下作为二级菜单存在 // const ProjectDetail = Loadable({ // loader: () => import("./Main/Detail"), @@ -67,16 +72,22 @@ class Index extends Component { )} > */} ( )} > + ( + + )} + > ( - + )} > diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index f50c134a3..bfd6105ad 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -138,7 +138,7 @@ function CoderDepot(props){ if(result && result.data){ const release = { "list":result.data.releases, - "total_count":result.data.releases.length + "total_count":result.data.releases && result.data.releases.length } setReleaseVersions(release); } diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index 3b1f66dba..b82db46e7 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -50,7 +50,7 @@ class Index extends Component { this.getCategory(); - this.getRecommand(); + // this.getRecommand(); this.getLanguage(); @@ -304,9 +304,9 @@ class Index extends Component { return (
-

+ {/*

-

+

*/} {/* { recommendOriList && recommendOriList.length>0? @@ -320,7 +320,7 @@ class Index extends Component { :"" } */} - { + {/* { recommendList && recommendList.length>0 && 5 ? "recommandProjects":"recommandProjects mb20"}> { @@ -341,7 +341,7 @@ class Index extends Component { }) } - } + } */}
    diff --git a/src/forge/Main/img/index/banner.png b/src/forge/Main/img/index/banner.png new file mode 100644 index 000000000..101be0a58 Binary files /dev/null and b/src/forge/Main/img/index/banner.png differ diff --git a/src/forge/Main/img/index/box.png b/src/forge/Main/img/index/box.png new file mode 100644 index 000000000..3dbddbefb Binary files /dev/null and b/src/forge/Main/img/index/box.png differ diff --git a/src/forge/Main/img/index/data.png b/src/forge/Main/img/index/data.png new file mode 100644 index 000000000..6b5b33478 Binary files /dev/null and b/src/forge/Main/img/index/data.png differ diff --git a/src/forge/Main/img/index/earth.png b/src/forge/Main/img/index/earth.png new file mode 100644 index 000000000..eca8dafba Binary files /dev/null and b/src/forge/Main/img/index/earth.png differ diff --git a/src/forge/Main/img/index/eye.png b/src/forge/Main/img/index/eye.png new file mode 100644 index 000000000..e7563addf Binary files /dev/null and b/src/forge/Main/img/index/eye.png differ diff --git a/src/forge/Main/img/index/hot.png b/src/forge/Main/img/index/hot.png new file mode 100644 index 000000000..0304899db Binary files /dev/null and b/src/forge/Main/img/index/hot.png differ diff --git a/src/forge/Main/img/index/hotAuthor.png b/src/forge/Main/img/index/hotAuthor.png new file mode 100644 index 000000000..62d01a746 Binary files /dev/null and b/src/forge/Main/img/index/hotAuthor.png differ diff --git a/src/forge/Main/img/index/icon.png b/src/forge/Main/img/index/icon.png new file mode 100644 index 000000000..2bfa60dde Binary files /dev/null and b/src/forge/Main/img/index/icon.png differ diff --git a/src/forge/Main/img/index/month.png b/src/forge/Main/img/index/month.png new file mode 100644 index 000000000..3b0b909f9 Binary files /dev/null and b/src/forge/Main/img/index/month.png differ diff --git a/src/forge/Main/img/index/more.png b/src/forge/Main/img/index/more.png new file mode 100644 index 000000000..1ae51d036 Binary files /dev/null and b/src/forge/Main/img/index/more.png differ diff --git a/src/forge/Main/img/index/typebg.png b/src/forge/Main/img/index/typebg.png new file mode 100644 index 000000000..e1d748ed5 Binary files /dev/null and b/src/forge/Main/img/index/typebg.png differ diff --git a/src/forge/Main/img/index/unit/feiteng.png b/src/forge/Main/img/index/unit/feiteng.png new file mode 100644 index 000000000..b4190d4e3 Binary files /dev/null and b/src/forge/Main/img/index/unit/feiteng.png differ diff --git a/src/forge/Main/img/index/unit/huake.png b/src/forge/Main/img/index/unit/huake.png new file mode 100644 index 000000000..56863862a Binary files /dev/null and b/src/forge/Main/img/index/unit/huake.png differ diff --git a/src/forge/Main/img/index/unit/huawei.png b/src/forge/Main/img/index/unit/huawei.png new file mode 100644 index 000000000..4374a68c6 Binary files /dev/null and b/src/forge/Main/img/index/unit/huawei.png differ diff --git a/src/forge/Main/img/index/unit/jijinhui.png b/src/forge/Main/img/index/unit/jijinhui.png new file mode 100644 index 000000000..c7fc91a6f Binary files /dev/null and b/src/forge/Main/img/index/unit/jijinhui.png differ diff --git a/src/forge/Main/img/index/unit/langchao.png b/src/forge/Main/img/index/unit/langchao.png new file mode 100644 index 000000000..46a1d70cc Binary files /dev/null and b/src/forge/Main/img/index/unit/langchao.png differ diff --git a/src/forge/Main/img/index/unit/mulan.png b/src/forge/Main/img/index/unit/mulan.png new file mode 100644 index 000000000..8e700754f Binary files /dev/null and b/src/forge/Main/img/index/unit/mulan.png differ diff --git a/src/forge/Main/img/index/unit/xigongye.png b/src/forge/Main/img/index/unit/xigongye.png new file mode 100644 index 000000000..7ec298106 Binary files /dev/null and b/src/forge/Main/img/index/unit/xigongye.png differ diff --git a/src/forge/Main/img/index/unit/xiuos.png b/src/forge/Main/img/index/unit/xiuos.png new file mode 100644 index 000000000..cc9d74223 Binary files /dev/null and b/src/forge/Main/img/index/unit/xiuos.png differ diff --git a/src/forge/Main/img/index/week.png b/src/forge/Main/img/index/week.png new file mode 100644 index 000000000..c967f424d Binary files /dev/null and b/src/forge/Main/img/index/week.png differ diff --git a/src/forge/Main/projecthome/Index.jsx b/src/forge/Main/projecthome/Index.jsx new file mode 100644 index 000000000..37e72cd1b --- /dev/null +++ b/src/forge/Main/projecthome/Index.jsx @@ -0,0 +1,126 @@ +import React , { useEffect , useState } from 'react'; +import './Index.scss'; +import SubBanner from './SubBanner'; +import SubUnitBanner from './SubUnitBanner'; +import Icon from '../img/index/icon.png'; +import { Link } from 'react-router-dom'; +import { Spin } from 'antd'; +import SubList from './SubList'; +import more from '../img/index/more.png'; +import axios from 'axios'; +import { getImageUrl } from 'educoder'; +import Nodata from '../../Nodata'; + +const LIMIT = 20; +function Index() { + + const [ cateList , setCateList ] = useState(undefined); + const [ projectsList , setProjectsList ] = useState(undefined); + const [ cateID, setCateID ] = useState(undefined); + const [ isSpin, setIsSpin ] = useState(true); + + useEffect(()=>{ + getCate(); + },[]) + + useEffect(()=>{ + setIsSpin(true); + getProject(); + },[cateID]) + + function getCate() { + const url = `/project_categories/pinned_index.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + setCateList(result.data.project_categories); + } + }).catch(error=>{}) + } + + function getProject() { + const url = `/projects.json`; + axios.get(url,{ + params:{ + pinned:"d", + category_id:cateID, + limit:LIMIT + } + }).then(result=>{ + if(result && result.data){ + setProjectsList(result.data.projects); + setIsSpin(false); + } + }).catch(error=>{}) + } + + return( +
    + + +
    +
    + +
    +
    + 开源项目 + 更多 +
    + +
    + { + projectsList && projectsList.length > 0 ? +
    + { + projectsList.map((i,k)=>{ + return( +
  • + +
    +
    + {i.author && i.author.name}/{i.name} + {i.praises_count > 0 ? {i.praises_count} :"" } + {i.forked_count > 0 ? {i.forked_count}:""} +
    +
    + {i.description} +
    +
    + {i.category && i.category.id ? {i.category.name} :"" } + {i.language && i.language.id ? {i.language.name} :""} + 更新于{i.time_ago} +
    +
    +
  • + ) + }) + } +
    + :"" + } + { + projectsList && projectsList.length === 0 && + } +
    +
    +
    + 查看更多开源项目 +
    +
    +
    + +
    +
    + ) +} +export default Index; \ No newline at end of file diff --git a/src/forge/Main/projecthome/Index.scss b/src/forge/Main/projecthome/Index.scss new file mode 100644 index 000000000..ef733067d --- /dev/null +++ b/src/forge/Main/projecthome/Index.scss @@ -0,0 +1,553 @@ +.banners{ + background: url('../img/index/banner.png') no-repeat top; + min-height: 516px; + background-size: cover; + background-color: #0C2A5B; + .bannersCenter{ + padding-top: 30px; + max-width: 1200px; + margin: 0px auto; + position: relative; + height: 516px; + } + .bTitle{ + height: 30px; + line-height: 30px; + font-size: 30px; + font-weight: 500; + color: #FFFFFF; + margin-bottom: 20px!important; + text-align: center; + span{ + background: linear-gradient(to right,#289AF6 0%, #9E84FF 40%, #FFB03B 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + .bSubTitle{ + text-align: center; + height: 30px; + line-height: 30px; + font-size: 16px; + font-weight: 400; + color: #FFFFFF; + } + .bannerBox{ + background: url('../img/index/box.png') no-repeat; + background-size: 100% 100%; + height: 240px; + width: 380px; + margin:0px auto; + padding:25px 30px 34px; + .bannersProject{ + position: relative; + .slick-list{ + width: 100%; + overflow: hidden; + } + .slick-track{ + display: flex; + li{ + padding:15px 20px; + .projectinfos{ + display: flex; + align-items: center; + width: 100%; + margin-bottom: 13px; + img{ + width: 32px; + height: 32px; + margin-right: 7px; + border-radius: 50%; + } + .name{ + height: 28px; + line-height: 28px; + font-size: 20px; + font-weight: 500; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 250px; + color: #25EBFF; + a{ + color: #25EBFF!important; + } + } + .company{ + height: 20px; + line-height: 20px; + font-size: 14px; + font-weight: 400; + color: #FFFFFF; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 250px; + a{ + color: #FFFFFF!important; + } + } + } + .desc{ + height: 40px; + font-size: 13px; + font-weight: 400; + color: #FFFFFF; + line-height: 20px; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + .infoData{ + display: flex; + margin-top: 16px; + justify-content: space-around; + &>span{ + display: flex; + align-items: center; + &>span{ + color: #FFB729; + font-size: 15px; + font-weight: 400; + } + } + img{ + width: 16px; + margin-right: 4px; + } + } + } + } + } + } + .airBubble{ + &>div{ + position: absolute; + height: 410px; + width: 415px; + bottom: 0px; + &.right{ + right: 0px; + } + &.left{ + left: 0px; + } + &.right div, &.left div{ + position: relative; + width: 100%; + height: 100%; + span{ + position: absolute; + border-radius: 50%; + background: linear-gradient(124deg, rgba(255, 255, 255, 0.1) 0%, rgba(5, 200, 220, 0.04) 50%, rgba(5, 200, 220, 0.03) 100%); + box-shadow: 0px 0px 7px 3px rgba(0, 154, 255, 0.19); + border: 1px solid rgba(0, 154, 255, 0.19); + font-size: 14px; + font-weight: 400; + line-height: 17px; + display: flex; + align-items: center; + word-break: break-all; + text-align: center; + padding:5px; + animation: zoomin 1.3s infinite alternate; + &:hover{ + animation:none + } + } + } + &.right span:nth-child(4) a,&.left span:nth-child(1) a,&.left span:nth-child(2) a{ + color: #25EBFF!important; + } + &.right span:nth-child(1) a,&.left span:nth-child(5) a{ + color: #CD8AFF!important; + } + &.right span:nth-child(3) a,&.right span:nth-child(5) a,&.left span:nth-child(6) a{ + color: #FF6125!important; + } + &.left span:nth-child(3) a{ + color: #FF8425!important; + } + &.right span:nth-child(2) a,&.left span:nth-child(4) a{ + color: #8CC2FF!important; + } + &.right span:nth-child(1){ + right: 0px; + height: 120px; + width: 120px; + } + &.right span:nth-child(2){ + right: 160px; + height: 72px; + width: 72px; + bottom: 220px; + padding:0px; + animation-delay: 0.2s; + } + &.right span:nth-child(3){ + right: 300px; + height: 94px; + width: 94px; + bottom: 99px; + padding:8px; + animation-delay: 0.3s; + } + &.right span:nth-child(4){ + right: 156px; + height: 100px; + width: 100px; + bottom: 39px; + font-size: 12px; + animation-delay: 0.2s; + } + &.right span:nth-child(5){ + right: 10px; + height: 94px; + width: 94px; + bottom: 97px; + animation-delay: 0.4s; + } + &.left span:nth-child(1){ + left: 80px; + height: 110px; + width: 110px; + padding:8px; + animation-delay: 0.1s; + } + &.left span:nth-child(2){ + right: 60px; + height: 96px; + width: 96px; + top: 85px; + font-size: 13px; + animation-delay: 0.2s; + } + &.left span:nth-child(3){ + left: 0px; + height: 86px; + width: 86px; + top: 145px; + font-size: 13px; + animation-delay: 0.3s; + } + &.left span:nth-child(4){ + left: 164px; + height: 70px; + width: 70px; + bottom: 158px; + font-size: 12px; + font-size: 12px; + animation-delay: 0.3s; + } + &.left span:nth-child(5){ + left: 35px; + height: 102px; + width: 102px; + bottom: 32px; + font-size: 13px; + animation-delay: 0.4s; + } + &.left span:nth-child(6){ + right: 10px; + height: 114px; + width: 114px; + bottom: 26px; + padding:8px; + } + } + } +} +@keyframes zoomin{ + 0%{-webkit-transform:scale(1.05);transform:scale(1.05)} + 100%{-webkit-transform:scale(0.8);transform:scale(0.8)} +} +@-webkit-keyframes zoomin{ + 0%{-webkit-transform:scale(1.05);transform:scale(1.05)} + 100%{-webkit-transform:scale(0.8);transform:scale(0.8)} +} +.unitBanner{ + padding:29px 0px; + background: #F9F9F9; + .unitContent{ + max-width: 1200px; + margin:0px auto; + .unitTitle{ + height: 28px; + line-height: 28px; + font-size: 20px; + font-weight: 500; + color: #1E1E1E; + display: flex; + align-items: center; + img{ + margin-left: 9px; + } + } + .unitSlider{ + padding:30px 0px 10px; + .slick-list{ + width: 100%; + height: 56px; + overflow: hidden; + .slickline{ + display: flex!important; + align-items: center; + justify-content: space-between; + } + } + } + } +} +.dataPanel{ + width: 1200px; + display: flex; + justify-content: space-between; + padding:30px 0px 60px; + margin:0px auto; + .left{ + width: 850px; + box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02); + display: flex; + .leftTypes{ + width: 220px; + height: 1576px; + background: url('../img/index/typebg.png'); + background-size: 100% 100%; + box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02); + padding:12px 0px; + a{ + padding:0px 20px; + height: 44px; + margin-top: 10px; + font-size: 16px; + font-weight: 500; + color: #333333; + display: flex; + align-items: center; + cursor: pointer; + &:hover{ + background-color: #F5F5F5; + } + &.active{ + background: linear-gradient(to right,#07228F , #466AFF); + color: #fff!important; + } + img{ + margin-right: 12px; + width: 28px; + } + } + } + .leftLists{ + flex:1; + .leftTitles{ + height: 60px; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid rgba(153, 153, 153, 0.16); + padding:0px 20px; + span{ + font-size: 18px; + font-weight: 500; + color: #000000; + } + a{ + color: #466AFF!important; + } + } + .leftlistItem{ + padding:0px 20px; + li{ + border-bottom: 1px solid rgba(153, 153, 153, 0.16); + display: flex; + align-items: flex-start; + padding:20px 0px ; + &>a img{ + width: 32px; + height: 32px; + border-radius: 50%; + margin-right: 10px; + } + .itemTitle{ + flex:1; + .item-title-infos{ + height: 22px; + display: flex; + align-items: center; + .infotitle{ + flex:1; + height: 21px; + font-size: 15px; + font-weight: 600; + line-height: 21px; + color: #333!important; + &:hover{ + color: #466AFF!important; + } + } + span{ + margin-left:20px ; + color: #333; + i{ + color: #666; + } + } + } + .item-desc{ + font-size: 14px; + font-weight: 400; + color: #414141; + line-height: 24px; + max-width: 548px; + margin: 5px 0px; + } + .item-data{ + font-size: 13px; + font-weight: 400; + color: #7D7D7D; + height: 20px; + line-height: 20px; + display: flex; + align-items: flex-end; + .category{ + position: relative; + padding-left: 11px; + margin-right: 10px; + &::before{ + position: absolute; + content: ""; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #466AFF; + top: 7px; + left: 0px; + } + } + .language{ + position: relative; + padding-left: 11px; + &::before{ + position: absolute; + content: ""; + width: 1px; + height: 10px; + border-radius: 50%; + border-left: 1px solid #9e9e9e; + bottom: 4px; + left: 0px; + } + } + } + } + } + } + } + .left-bottom-btn{ + display: flex; + justify-content: center; + padding:18px 0px; + a{ + height: 38px; + line-height: 36px; + border-radius: 8px; + border: 1px solid #466AFF; + color: #466AFF; + font-size: 16px; + padding:0px 20px; + img{ + height: 16px; + margin-top: -1px; + margin-left: 8px; + } + } + } + } + .right{ + width: 330px; + &>div{ + box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02); + margin-bottom: 20px; + } + .partTitle{ + padding:15px; + background: #F6F9FF; + font-size: 18px; + color: #000000; + font-weight: 500; + margin-bottom: 10px; + img{ + width: 33px; + margin-right: 6px; + } + } + .righthotAuthor{ + padding-bottom: 15px; + li{ + padding-left: 15px; + &>div{ + display: flex; + align-items: flex-start; + padding:10px 15px 10px 0px; + border-bottom: 1px solid rgba(153, 153, 153, 0.1); + img{ + width: 32px; + height: 32px; + border-radius: 50%; + margin-right: 8px; + margin-top: 3px; + } + } + &:hover{ + background-color: #F3F3F3; + } + &:last-child > div{ + border-bottom: none; + } + } + } + .hotProjects{ + li{ + padding:10px 15px; + margin-bottom: 10px; + &:hover{ + background-color: #F3F3F3; + } + .mInfos{ + display: flex; + align-items: center; + height: 20px; + .num{ + width: 18px; + height: 18px; + background: #466AFF; + border-radius: 2px; + color: #fff; + text-align: center; + line-height: 18px; + margin-right: 8px; + } + .name{ + flex:1; + font-size: 15px; + } + } + .sInfos{ + background: #F7F8F9; + padding:5px; + font-size: 13px; + font-weight: 400; + color: #666666; + line-height: 22px; + word-break: break-all; + margin-top: 10px; + } + } + } + } +} \ No newline at end of file diff --git a/src/forge/Main/projecthome/SubBanner.jsx b/src/forge/Main/projecthome/SubBanner.jsx new file mode 100644 index 000000000..7e8c1a636 --- /dev/null +++ b/src/forge/Main/projecthome/SubBanner.jsx @@ -0,0 +1,115 @@ +import React , { useEffect , useState } from 'react'; +import Slider from 'react-slick'; +import { Link } from 'react-router-dom'; +import { getImageUrl } from 'educoder'; +import Eye from '../img/index/eye.png'; +import Data from '../img/index/data.png'; +import Earth from '../img/index/earth.png'; +import Imgs from '../img/tree.png'; +import axios from 'axios'; + +// const list =[ +// {img:Imgs,name:"矽璓工业物联操作系统XiUOS",company:"泛在操作系统实验室",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"openGauss-operator",company:"华为技术有限公司",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"PaddleDetection 2.0",company:"TrustieMirrors",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"skyline",company:"浪潮信息",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"BitXHub",company:"开放原子开源基金会",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"Device Model",company:"openDACS",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"Gitlink",company:"Gitlink",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"openEuler-datenlord",company:"华为技术有限公司",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"OpenAtom XuperChain",company:"开放原子开源基金会",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"xuos-web",company:"泛在操作系统实验室",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// {img:Imgs,name:"CrowdOS开源项目开发",company:"西北工业大学",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"}, +// ] +const settings={ + dots: false, + infinite: true, + speed: 1000, + slidesToShow: 1, + slidesToScroll: 1, + autoplay:true, + arrows:false, + adaptiveHeight:true +} + +function SubBanner() { + + const [ list , setList ] = useState(undefined); + + useEffect(()=>{ + getList(); + },[]) + + function getList() { + const url = `/projects/banner_recommend.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + setList(result.data.projects); + } + }).catch(error=>{}) + } + return( +
    +
    +

    新一代开源创新服务平台

    +

    Gitlink(确实开源)-CCF官网指定的产学研融合面向软件开源创新的开源社区

    +
    + { + list && list.length > 0 ? + + { + list.map((i,k)=>{ + return( +
  • +
    + +
    +

    {i.name}

    +

    {i.author && i.author.name}

    +
    +
    +

    {i.description}

    +
    + {i.visits} + {i.category && i.category.id && {i.category.name}} + {i.language && i.language.id && {i.language.name}} +
    +
  • + ) + }) + } +
    + :"" + } +
    +
    +
    +
    + { + list && list.length > 0 && list.map((i,k)=>{ + return( + k%2 === 0? {i.author && i.author.name}/{i.name} : "" + ) + }) + } +
    +
    + +
    +
    + { + list && list.length > 0 && list.map((i,k)=>{ + return( + k%2 > 0 ? {i.author && i.author.name}/{i.name} : "" + ) + }) + } +
    +
    + +
    +
    +
    + ) +} +export default SubBanner diff --git a/src/forge/Main/projecthome/SubList.jsx b/src/forge/Main/projecthome/SubList.jsx new file mode 100644 index 000000000..56510392e --- /dev/null +++ b/src/forge/Main/projecthome/SubList.jsx @@ -0,0 +1,138 @@ +import React , { useEffect , useState } from 'react'; +import hotAuthor from '../img/index/hotAuthor.png'; +import week from '../img/index/week.png'; +import month from '../img/index/month.png'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; +import { getImageUrl } from 'educoder'; + + +function SubList() { + + const [ weekList ,setWeekList ] = useState(undefined); + const [ monthList ,setMonthList ] = useState(undefined); + const [ authorList ,setAuthorList ] = useState(undefined); + + useEffect(()=>{ + getList(7); + getList(30); + getAuthorList(7); + },[]) + + function getList(time){ + const url = `/project_rank.json`; + axios.get(url,{ + params:{ + time + } + }).then(result=>{ + if(result && result.data){ + time === 7 ? setWeekList(result.data.projects) : setMonthList(result.data.projects); + } + }).catch(error=>{}) + } + function getAuthorList(time){ + const url = `/user_rank.json`; + axios.get(url,{ + params:{ + time + } + }).then(result=>{ + if(result && result.data){ + setAuthorList(result.data.users); + } + }).catch(error=>{}) + } + + return( +
    + { + authorList && authorList.length > 0? +
    +
    本周热门开发者
    +
    + { + authorList.map((i,k)=>{ + return( +
  • +
    + +
    + {i.name} +

    + {i.project && i.project.name} +

    +
    +
    +
  • + ) + }) + } +
    +
    + :"" + } + + { + weekList && weekList.length > 0 ? +
    +
    本周热门项目
    +
    + { + weekList.map((i,k)=>{ + return( +
  • +
    + {k+1} + {i.owner && i.owner.name}/{i.name} + + {i.praises} + +
    + {i.description && +
    + {i.description} +
    + } +
  • + ) + }) + } +
    +
    + :"" + } + { + monthList && monthList.length > 0? +
    +
    本月热门项目
    +
    + { + monthList.map((i,k)=>{ + return( +
  • +
    + {k+1} + {i.owner && i.owner.name}/{i.name} + + {i.praises} + +
    + {i.description && +
    + {i.description} +
    + } +
  • + ) + }) + } +
    +
    + :"" + } + +
    + ) +} +export default SubList; \ No newline at end of file diff --git a/src/forge/Main/projecthome/SubUnitBanner.jsx b/src/forge/Main/projecthome/SubUnitBanner.jsx new file mode 100644 index 000000000..f3ba16a57 --- /dev/null +++ b/src/forge/Main/projecthome/SubUnitBanner.jsx @@ -0,0 +1,84 @@ +import React , { useEffect , useState } from 'react'; +import Hot from '../img/index/hot.png'; +import Slider from "react-slick"; +import huawei from '../img/index/unit/huawei.png'; +import langchao from '../img/index/unit/langchao.png'; +import jijinhui from '../img/index/unit/jijinhui.png'; +import mulan from '../img/index/unit/mulan.png'; +import xigongye from '../img/index/unit/xigongye.png'; +import feiteng from '../img/index/unit/feiteng.png'; +import xiuos from '../img/index/unit/xiuos.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 = { + dots: false, + infinite: true, + slidesToShow: 1, + slidesToScroll: 1, + vertical: true, + verticalSwiping: true, + autoplay:true, + arrows:false +}; +const group_size = 6; +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( + list && list.length > 0 ? +
    +
    +
    + 精选开源组织 + +
    + + { + list.map((i,k)=>{ + return( +
    + { + i.map((j,k1)=>{ + return( + + ) + }) + } +
    + ) + }) + } + {/*
    + + + + +
    */} +
    +
    +
    + :"" + + ) +} +export default SubUnitBanner; \ No newline at end of file diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css index bdd6d36a8..8d513feb0 100644 --- a/src/modules/tpm/TPMIndex.css +++ b/src/modules/tpm/TPMIndex.css @@ -28,13 +28,14 @@ body>.-task-title { height:70px; min-width: 1200px; z-index: 1000; - background:rgba(255,255,255,1); + box-shadow: 0px 2px 4px 0px rgb(0 0 0 / 50%); position: fixed; - box-shadow: 0px 0px 14px rgb(0 0 0 / 10%); + background-image: linear-gradient(to right, #0F141F, #0C2A5B,#101417); + color: #fff; } .headerContent{ - width:1200px; margin:0px auto; + padding:0px 30px; display: flex; align-items: center; height: 100%;