forked from Gitlink/forgeplus-react
限制开源夏令营报名时间
This commit is contained in:
parent
947b7a4be6
commit
e7a23064a8
|
@ -8,7 +8,7 @@ import banner from "../img/banner.png";
|
|||
import './index.scss';
|
||||
const Option = Select.Option;
|
||||
function Apply(props) {
|
||||
const {form, current_user, showNotification} = props;
|
||||
const {form, current_user, showNotification, isGlccApplyDate} = props;
|
||||
// 可用于开发时不同账号报名
|
||||
// current_user && (current_user.user_id = 1061)
|
||||
// current_user && (current_user.userName = "美女")
|
||||
|
@ -29,7 +29,10 @@ function Apply(props) {
|
|||
);
|
||||
|
||||
useEffect(()=>{
|
||||
if(current_user && current_user.login){
|
||||
if(!isGlccApplyDate){
|
||||
// 不在开源夏令营报名时间之内
|
||||
window.location.href="/glcc";
|
||||
}else if(current_user && current_user.login){
|
||||
// 获取项目分类参数
|
||||
const url = `/project_categories/pinned_index.json`;
|
||||
axios.get(url).then(result=>{
|
||||
|
@ -38,7 +41,7 @@ function Apply(props) {
|
|||
}
|
||||
}).catch(error=>{})
|
||||
}else{
|
||||
window.location.href="/login?go_page=/glcc/apply"
|
||||
window.location.href="/login?go_page=/glcc/apply";
|
||||
}
|
||||
|
||||
}, [])
|
||||
|
|
|
@ -11,14 +11,14 @@ import banner from "../img/banner.png";
|
|||
import './index.scss';
|
||||
|
||||
export default (props) => {
|
||||
const {current_user} = props;
|
||||
const {current_user, isGlccApplyDate, showNotification} = props;
|
||||
|
||||
return (
|
||||
<div className="glcc">
|
||||
{/* <Banner /> */}
|
||||
<img className="glcc-banner" src={banner}></img>
|
||||
{/* <div > */}
|
||||
<Link className="apply-btn" to={current_user && current_user.login ? '/glcc/apply' : '/login?go_page=/glcc/apply'}>
|
||||
<Link className="apply-btn" to={isGlccApplyDate ? current_user && current_user.login ? '/glcc/apply' : '/login?go_page=/glcc/apply' : '/glcc'} onClick={()=>{!isGlccApplyDate && showNotification("不在报名时间,报名时间为4月15日~5月8日")}}>
|
||||
<div className="apply-text">立即报名</div>
|
||||
<div className="apply-icon"><i className="font-14 iconfont icon-xiangyoujiantou "></i></div>
|
||||
</Link>
|
||||
|
@ -27,7 +27,7 @@ export default (props) => {
|
|||
<div className="glcc-tit">活动简介</div>
|
||||
<div className="introduce-content">GitLink编程夏令营(GLCC),是在CCF中国计算机学会指导下,由CCF开源发展委员会(CCF ODC)举办的面向全国高校学生的暑期编程活动。活动将覆盖近千所高校,并联合各大开源基金会、开源企业、开源社区、开源专家,旨在鼓励青年学生通过参加真实的开源软件开发,提升自身技术能力,为开源社区输送优秀人才。为青年学生提供开放友好的交流平台,希望进一步推动国内开源社区的繁荣发展。</div>
|
||||
</div>
|
||||
<Lightspot />
|
||||
<Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification}/>
|
||||
<TimerShaft />
|
||||
<Award />
|
||||
<News />
|
||||
|
|
|
@ -8,10 +8,11 @@ import lightspot4 from '../../img/lightspot4.png';
|
|||
|
||||
|
||||
import './index.scss';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
|
||||
function Lightspot(props) {
|
||||
const {current_user} = props;
|
||||
const {current_user, isGlccApplyDate, showNotification} = props;
|
||||
|
||||
return (
|
||||
<div className="lightspot">
|
||||
|
@ -22,7 +23,7 @@ function Lightspot(props) {
|
|||
<div className="teacher-text">
|
||||
<h3 className="teacher-invite">有兴趣成为GLCC的导师吗?</h3>
|
||||
<div className="teacher-content">想要扩大项目知名度和影响力,为开源项目吸引新鲜血液,培养长期开发者。通过GitLink平台,与高校建立连接,指导开源新人传授他们的开源文化,享受开源的乐趣</div>
|
||||
<Button type="primary" href={current_user && current_user.login ? '/glcc/apply' : '/login?go_page=/glcc/apply'} className='applyBut'>立即报名</Button>
|
||||
<Link className='applyBut' to={isGlccApplyDate ? current_user && current_user.login ? '/glcc/apply' : '/login?go_page=/glcc/apply' : '/glcc'} onClick={()=>{!isGlccApplyDate && showNotification("不在报名时间,报名时间为4月15日~5月8日")}}>立即报名</Link>
|
||||
</div>
|
||||
<img className="teacher-img" src={teacherImg}></img>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,20 @@
|
|||
}
|
||||
.teacher-text {
|
||||
margin-right: 2.84%;
|
||||
.applyBut, .applyBut:hover{color: white !important;}
|
||||
.applyBut{
|
||||
width: 120px;
|
||||
height: 36px;
|
||||
background-color: #466aff;
|
||||
border-radius: 2px;
|
||||
color: white;
|
||||
display: block;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
&:hover{
|
||||
opacity: .8;
|
||||
color: white !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.teacher-invite {
|
||||
color: #202d40;
|
||||
|
|
|
@ -31,6 +31,8 @@ const Help = Loadable({
|
|||
|
||||
|
||||
const Glcc = (propsF) => {
|
||||
// 判断时间是否在开源夏令营报名时间内(4月15日~5月8日)
|
||||
const isGlccApplyDate = Date.parse(new Date()) < 1652889600000;
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
|
@ -39,7 +41,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/apply"
|
||||
render={(props) => (
|
||||
<Apply {...propsF} {...props} />
|
||||
<Apply {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* 帮助中心 */}
|
||||
|
@ -53,7 +55,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc"
|
||||
render={(props) => (
|
||||
<Home {...propsF} {...props} />
|
||||
<Home {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
Loading…
Reference in New Issue