限制开源夏令营报名时间

This commit is contained in:
谢思 2022-04-13 09:59:48 +08:00
parent 947b7a4be6
commit e7a23064a8
5 changed files with 30 additions and 11 deletions

View File

@ -8,7 +8,7 @@ import banner from "../img/banner.png";
import './index.scss'; import './index.scss';
const Option = Select.Option; const Option = Select.Option;
function Apply(props) { 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.user_id = 1061)
// current_user && (current_user.userName = "") // current_user && (current_user.userName = "")
@ -29,7 +29,10 @@ function Apply(props) {
); );
useEffect(()=>{ 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`; const url = `/project_categories/pinned_index.json`;
axios.get(url).then(result=>{ axios.get(url).then(result=>{
@ -38,7 +41,7 @@ function Apply(props) {
} }
}).catch(error=>{}) }).catch(error=>{})
}else{ }else{
window.location.href="/login?go_page=/glcc/apply" window.location.href="/login?go_page=/glcc/apply";
} }
}, []) }, [])

View File

@ -11,14 +11,14 @@ import banner from "../img/banner.png";
import './index.scss'; import './index.scss';
export default (props) => { export default (props) => {
const {current_user} = props; const {current_user, isGlccApplyDate, showNotification} = props;
return ( return (
<div className="glcc"> <div className="glcc">
{/* <Banner /> */} {/* <Banner /> */}
<img className="glcc-banner" src={banner}></img> <img className="glcc-banner" src={banner}></img>
{/* <div > */} {/* <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-text">立即报名</div>
<div className="apply-icon"><i className="font-14 iconfont icon-xiangyoujiantou "></i></div> <div className="apply-icon"><i className="font-14 iconfont icon-xiangyoujiantou "></i></div>
</Link> </Link>
@ -27,7 +27,7 @@ export default (props) => {
<div className="glcc-tit">活动简介</div> <div className="glcc-tit">活动简介</div>
<div className="introduce-content">GitLink编程夏令营GLCC是在CCF中国计算机学会指导下由CCF开源发展委员会CCF ODC举办的面向全国高校学生的暑期编程活动活动将覆盖近千所高校并联合各大开源基金会开源企业开源社区开源专家旨在鼓励青年学生通过参加真实的开源软件开发提升自身技术能力为开源社区输送优秀人才为青年学生提供开放友好的交流平台希望进一步推动国内开源社区的繁荣发展</div> <div className="introduce-content">GitLink编程夏令营GLCC是在CCF中国计算机学会指导下由CCF开源发展委员会CCF ODC举办的面向全国高校学生的暑期编程活动活动将覆盖近千所高校并联合各大开源基金会开源企业开源社区开源专家旨在鼓励青年学生通过参加真实的开源软件开发提升自身技术能力为开源社区输送优秀人才为青年学生提供开放友好的交流平台希望进一步推动国内开源社区的繁荣发展</div>
</div> </div>
<Lightspot /> <Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification}/>
<TimerShaft /> <TimerShaft />
<Award /> <Award />
<News /> <News />

View File

@ -8,10 +8,11 @@ import lightspot4 from '../../img/lightspot4.png';
import './index.scss'; import './index.scss';
import { Link } from 'react-router-dom';
function Lightspot(props) { function Lightspot(props) {
const {current_user} = props; const {current_user, isGlccApplyDate, showNotification} = props;
return ( return (
<div className="lightspot"> <div className="lightspot">
@ -22,7 +23,7 @@ function Lightspot(props) {
<div className="teacher-text"> <div className="teacher-text">
<h3 className="teacher-invite">有兴趣成为GLCC的导师吗</h3> <h3 className="teacher-invite">有兴趣成为GLCC的导师吗</h3>
<div className="teacher-content">想要扩大项目知名度和影响力为开源项目吸引新鲜血液培养长期开发者通过GitLink平台与高校建立连接指导开源新人传授他们的开源文化享受开源的乐趣</div> <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> </div>
<img className="teacher-img" src={teacherImg}></img> <img className="teacher-img" src={teacherImg}></img>
</div> </div>

View File

@ -13,7 +13,20 @@
} }
.teacher-text { .teacher-text {
margin-right: 2.84%; 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 { .teacher-invite {
color: #202d40; color: #202d40;

View File

@ -31,6 +31,8 @@ const Help = Loadable({
const Glcc = (propsF) => { const Glcc = (propsF) => {
// 415~58
const isGlccApplyDate = Date.parse(new Date()) < 1652889600000;
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
@ -39,7 +41,7 @@ const Glcc = (propsF) => {
<Route <Route
path="/glcc/apply" path="/glcc/apply"
render={(props) => ( render={(props) => (
<Apply {...propsF} {...props} /> <Apply {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
)} )}
></Route> ></Route>
{/* 帮助中心 */} {/* 帮助中心 */}
@ -53,7 +55,7 @@ const Glcc = (propsF) => {
<Route <Route
path="/glcc" path="/glcc"
render={(props) => ( render={(props) => (
<Home {...propsF} {...props} /> <Home {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
)} )}
></Route> ></Route>