diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index cf616cf48..894f9e9df 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -86,6 +86,8 @@ const Glcc = (propsF) => { const [glccSettings, setGLccSetting] = useState(undefined); // 是否展示项目、课题列表入口 const [repoPublic, setRepoPublic] = useState(false); + // 是否处于项目/课题补录阶段 + const [applyRepo, setApplyRepo] = useState(false); useEffect(()=>{ if(id && id === "2022"){ @@ -101,8 +103,11 @@ const Glcc = (propsF) => { // 判断是否展示项目、课题 const publicRepoTask = res.data.filter(item=>item.name === "repoPublic"); publicRepoTask[0] && setRepoPublic(judge(nowTime, publicRepoTask[0].value, "range")) - // 过滤掉 项目课题公示时间 - const filterRepoPublic = res.data.filter(item=>item.name !== "repoPublic"); + // 是否处于项目/课题补录阶段 + const repoApply1 = res.data.filter(item=>item.name === "repoApply1"); + repoApply1[0] && setApplyRepo(judge(nowTime, repoApply1[0].value, "range")) + // 过滤掉 项目课题公示时间、项目/课题补录 + const filterRepoPublic = res.data.filter(item=>["repoPublic", "repoApply1"].indexOf(item.name) === -1); const periodIndex = filterRepoPublic.findIndex(item=>judge(nowTime, item.value, "range")); periodIndex !== -1 && setPeriod(filterRepoPublic[periodIndex].name); } @@ -188,12 +193,12 @@ const Glcc = (propsF) => {
{/* 学生报名 */} - ( )} - > + >} {/* 开源夏令营报名页面 */} {period === "repoApply" && { )} >} + {/* 导师报名课题路由通道 */} + {applyRepo && ( + + )} + >} {/* 教师审核 */} { )} > - ( )} - > + >} {/* 项目/课题列表 */} - ( - + )} - > + >} {/* 课题列表 */} - ( - + )} - > + >} {/* openmmlab列表 */} { window.scrollTo(0, 0); },[]) @@ -33,7 +30,7 @@ function Project(propsF) {
-
学生报名时间: {id === '2023' ? '2023年6月4日-6月21日' : '2022年5月26日-6月24日'}
+
学生报名时间: {id === '2022' ? '2022年5月26日-6月24日' : '2023年6月4日-6月21日'}
课题列表 diff --git a/src/glcc/project/projectList/index.jsx b/src/glcc/project/projectList/index.jsx index ab303c2d4..4ae2a9e9d 100644 --- a/src/glcc/project/projectList/index.jsx +++ b/src/glcc/project/projectList/index.jsx @@ -31,8 +31,10 @@ function ProjectList({ applyTaskId, location, match, applyTask, round, period, m if (response && response.message === "success") { let dataArr = response.data.rows; dataArr.forEach(i => { - let urlArr = i.gitlinkUrl.split('/'); - i.gitlinkLastUrl = urlArr.pop() || urlArr.pop(); + // 兼容url最后带/的情况 + let urlArr = i.gitlinkUrl.endsWith('/') ? i.gitlinkUrl.substring(0, i.gitlinkUrl.length-1).split('/') : i.gitlinkUrl.split('/'); + // 直接使用last url会导致命中css + i.gitlinkLastUrl = `${urlArr.pop()}glcc`; i.gitlinkLastUrl = i.gitlinkLastUrl.replace(/\./g, ''); }); if (gitlinkLastUrl) { @@ -90,7 +92,7 @@ function ProjectList({ applyTaskId, location, match, applyTask, round, period, m overlayClassName='projectItemPopover' autoAdjustOverflow={false} > -
+
{!gitlinkLastUrl && !openmmlab && item.recommendFlag ? : ''}
diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index caf128557..f81c94cdc 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -53,19 +53,9 @@ function Apply(props) { useEffect(() => { // 进入此页面到填写页面 - // setTimeout(()=>{ - // let clientWidth = document.body.clientWidth; - // let scrollHeight = 500 * clientWidth / 1920; - // window.scrollTo(0, scrollHeight); - // },200); window.scrollTo(0, 50); - - if (new Date().getTime() < new Date('2022/05/26').getTime()) { - // 不在开源夏令营报名时间之内 - window.location.href = "/glcc/subjects"; - } else if (current_user && current_user.login) { - - } else { + // 未登录 + if (current_user && !current_user.login){ window.location.href = `/login?go_page=/glcc/student/apply/${taskId}`; } }, [])