From 3c22b78b5f24d4e64b604b86635a364fb4b32358 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Wed, 17 Apr 2024 08:50:22 +0800
Subject: [PATCH 1/4] =?UTF-8?q?glcc2024=E9=A1=B9=E7=9B=AE=E8=AF=BE?=
=?UTF-8?q?=E9=A2=98=E6=8A=A5=E5=90=8D+=E9=A1=B9=E7=9B=AE=E8=AF=BE?=
=?UTF-8?q?=E9=A2=98=E5=85=AC=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/UrlTool.js | 4 +-
src/glcc/api.js | 13 +
src/glcc/apply/editInfo.jsx | 74 ++++--
src/glcc/apply/index.jsx | 26 +-
src/glcc/apply/repoInfo.jsx | 7 +-
src/glcc/apply/taskApply.jsx | 104 +++++---
src/glcc/freeProject/index.scss | 1 +
src/glcc/home/index.jsx | 39 ++-
src/glcc/home/lightspot/index.jsx | 32 +--
src/glcc/home/lightspot/index.scss | 3 +-
src/glcc/home/news/index.jsx | 9 +-
src/glcc/home/news/index.scss | 8 +-
src/glcc/home/previousReview/index.jsx | 175 ++++++++++++++
src/glcc/home/timerShaft/index.jsx | 241 +++++++++----------
src/glcc/home/timerShaft/index.scss | 61 ++++-
src/glcc/img/banner2024.jpg | Bin 0 -> 1658342 bytes
src/glcc/img/lightspot-bg.png | Bin 163310 -> 469921 bytes
src/glcc/img/newsBg.png | Bin 0 -> 897680 bytes
src/glcc/img/time-bg1.png | Bin 0 -> 715588 bytes
src/glcc/index.jsx | 42 ++--
src/glcc/index.scss | 35 +++
src/glcc/news/index.jsx | 65 +++++
src/glcc/news/index.scss | 27 +++
src/glcc/openmmlab/projectTab/index.scss | 1 +
src/glcc/project/component/projectDetail.jsx | 5 +-
src/glcc/project/index.jsx | 8 +-
src/glcc/project/index.scss | 2 +-
src/glcc/project/taskDetail/index.jsx | 7 +-
src/glcc/project/taskDetail/index.scss | 1 +
src/glcc/project/taskList/index.jsx | 7 +-
src/glcc/siderBarHelp.js | 27 ++-
31 files changed, 735 insertions(+), 289 deletions(-)
create mode 100644 src/glcc/home/previousReview/index.jsx
create mode 100644 src/glcc/img/banner2024.jpg
create mode 100644 src/glcc/img/newsBg.png
create mode 100644 src/glcc/img/time-bg1.png
create mode 100644 src/glcc/news/index.jsx
create mode 100644 src/glcc/news/index.scss
diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js
index 965387554..cc82ec16b 100644
--- a/src/common/UrlTool.js
+++ b/src/common/UrlTool.js
@@ -6,7 +6,7 @@ const { Search } = Input;
const $ = window.$;
const isDev = window.location.port == 3007;
const isdev2= window.location.hostname ==='www.educoder.net'
-export const TEST_HOST = "https://testforgeplus.trustie.net/"
+export const TEST_HOST = "https://testforgeplus.trustie.net"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
@@ -144,7 +144,7 @@ export function getUrl(path, goTest) {
// if (isDev) {
// return `${local}${path?path:''}`
// }
- return `${path ? path: ''}`;
+ return `${path ? path: TEST_HOST}`;
}
export function getZoneUrl(path) {
diff --git a/src/glcc/api.js b/src/glcc/api.js
index 56d033149..7b25151c8 100644
--- a/src/glcc/api.js
+++ b/src/glcc/api.js
@@ -1,5 +1,10 @@
import fetch from './fetch';
+// 当前glcc
+export const currentRound = 3;
+export const rewardMoney = "现金奖励"
+export const rewardSettingRound = 3;
+
// 获取当前用户项目报名信息(项目、课题)
export function getUserApplyInfo(params) {
return fetch({
@@ -281,6 +286,14 @@ export function formatParsedResult(setting, type= "range") {
result= `${startYear}年${startMonth}月${startDay}日${startHour}点`;
}else if(type === "end"){
result= `${endYear}年${endMonth}月${endDay}日${endHour}点`;
+ } else if(type === "rangeDay"){
+ result = `${startYear}年${startMonth}月${startDay}日-${endYear}年${endMonth}月${endDay}日`;
+ } else if(type === "startMonthDay"){
+ result= `${startMonth}.${startDay}`;
+ } else if(type === "endMonthDay"){
+ result= `${endMonth}.${endDay}`;
+ } else if(type === "rangeConcatDot"){
+ result = `${startMonth}.${startDay}-${endMonth}.${endDay}`;
}
return result;
diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx
index cd037a6b6..86ecbf46f 100644
--- a/src/glcc/apply/editInfo.jsx
+++ b/src/glcc/apply/editInfo.jsx
@@ -1,5 +1,5 @@
import React , { useCallback, useEffect , useState } from 'react';
-import { Button, Form, Input, Select, Upload, message, Popconfirm } from 'antd';
+import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox } from 'antd';
import {getUploadActionUrl} from 'educoder';
import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api';
import TextArea from 'antd/lib/input/TextArea';
@@ -10,10 +10,10 @@ import { FlexAJ } from '../../forge/Component/layout';
const Option = Select.Option;
// 编辑项目、课题报名信息
function EditRepoApplyInfo(props) {
- const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount} = props;
+ const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount, rewardList} = props;
const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/
const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
- const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue } = form;
+ const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue, resetFields } = form;
const [imageUrl, setImageUrl] = useState(undefined);
// 提交按钮loading效果
const [loading, setLoading] = useState(false);
@@ -22,30 +22,41 @@ function EditRepoApplyInfo(props) {
useEffect(()=>{
if(applyInfo){
- const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId, contactMail} = applyInfo;
+ const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId, contactMail, joinCooperativeCommunity} = applyInfo;
const taskInfo = {};
+ const taskRewardRemark = {};
const taskCountArr = []
registrationTaskList.map((item, index)=>{
taskCountArr.push(index+1);
- const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone, id} = item;
+ const{taskName, taskUrl, taskDifficulty, tutorName, tutorMail, taskDesc, tutorPhone, id, settingRewardId, settingRewardRemark, tutorAddress} = item;
taskInfo[`taskName${index+1}`] = taskName;
taskInfo[`taskUrl${index+1}`] = taskUrl;
taskInfo[`taskDifficulty${index+1}`] = taskDifficulty;
- taskInfo[`taskReward${index+1}`] = taskReward;
taskInfo[`tutorName${index+1}`] = tutorName;
taskInfo[`tutorMail${index+1}`] = tutorMail;
taskInfo[`taskDesc${index+1}`] = taskDesc;
taskInfo[`tutorPhone${index+1}`] = tutorPhone;
+ taskInfo[`tutorAddress${index+1}`] = tutorAddress;
taskInfo[`taskId${index+1}`] = id;
+ taskInfo[`settingRewardId${index+1}`] = parseInt(settingRewardId);
+ // taskInfo[`settingRewardRemark${index+1}`] = settingRewardRemark;
+ taskRewardRemark[`settingRewardRemark${index+1}`] = settingRewardRemark;
})
setTaskCount(taskCountArr);
setTimeout(() => {
setFieldsValue({
projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail,
...taskInfo,
- logo: {file:{response:{id: projectLogoId}}}
+ logo: {file:{response:{id: projectLogoId}}},
+ joinCooperativeCommunity,
})
}, 100);
+ // 课题奖励备注要根据奖励方式注入select/input
+ setTimeout(() => {
+ setFieldsValue({
+ ...taskRewardRemark,
+ })
+ }, 300);
}else{
setTaskCount([1])
}
@@ -81,17 +92,19 @@ function EditRepoApplyInfo(props) {
taskName: values[`taskName${item}`],
taskUrl: values[`taskUrl${item}`],
taskDifficulty: values[`taskDifficulty${item}`],
- taskReward: values[`taskReward${item}`],
+ settingRewardId: values[`settingRewardId${item}`],
+ settingRewardRemark: values[`settingRewardRemark${item}`],
tutorName: values[`tutorName${item}`],
tutorMail: values[`tutorMail${item}`],
+ tutorAddress: values[`tutorAddress${item}`],
taskDesc: values[`taskDesc${item}`],
tutorPhone: values[`tutorPhone${item}`],
round
})
})
- const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail} = values;
+ const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail, joinCooperativeCommunity=false} = values;
const params ={
- projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail,
+ projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail, joinCooperativeCommunity,
projectLogoId: values.logo.file.response.id+"",
userId: current_user.user_id,
userName: current_user.username
@@ -101,27 +114,31 @@ function EditRepoApplyInfo(props) {
// 用户已经报名项目
params[`id`] = applyInfo.id;
updateApplyGlcc(params).then(response=>{
+ setLoading(false);
if(response && response.message === "success"){
message.success("修改成功");
setReload();
}
- setLoading(false);
setIsEdit(false);
setEditRepoCount(0);
setTimeout(() => {
scrollToRepoInfo()
}, 100);
+ }).catch(error=>{
+ setLoading(false);
})
return
}
applyGlcc(params).then(response=>{
+ setLoading(false);
if(response && response.message === "success"){
message.success("报名成功");
isAddRepo && setIsAddRepo(false);
setReload();
}
- setLoading(false);
window.scrollTo(0,950);
+ }).catch(error=>{
+ setLoading(false);
})
}
});
@@ -221,7 +238,25 @@ function EditRepoApplyInfo(props) {
{ max: 252, message: '超出限制长度252位字符,请重新编辑' }],
{verify("gitlink")}}/>
)}
- {helper('联系人姓名',
+
+ {getFieldDecorator("contactName", { rules: [{ required: true, message: "请输入项目联系人姓名" },
+ { max: 32, message: '超出限制长度32位字符,请重新编辑' }], validateFirst: true, initialValue: current_user.username })(
+ {verify("name")}}/>
+ )}
+
+
+ {getFieldDecorator("contactPhone", { rules: [{ required: true, message: "输入项目联系人手机号码" },
+ { pattern: phonereg, message: "请输入正确的手机号码"},], validateFirst: true, initialValue: current_user.phone })(
+ {verify("name")}}/>
+ )}
+
+
+ {getFieldDecorator("contactMail", { rules: [{ required: true, message: "输入项目联系人邮箱" },
+ { pattern: emailreg, message: "请输入正确的邮箱地址"},], validateFirst: true, initialValue: current_user.email })(
+ {verify("name")}}/>
+ )}
+
+ {/* {helper('联系人姓名',
'',
'contactName',
[{ required: true, message: "请输入项目联系人姓名" },
@@ -241,7 +276,7 @@ function EditRepoApplyInfo(props) {
[{ required: true, message: "输入项目联系人邮箱" },
{ pattern: emailreg, message: "请输入正确的邮箱地址"},],
{verify("name")}}/>
- )}
+ )} */}
{helper('项目简介',
'',
'projectIntro',
@@ -268,13 +303,20 @@ function EditRepoApplyInfo(props) {
}
)}
+
+
+ {getFieldDecorator("joinCooperativeCommunity", { rules: [], validateFirst: true, valuePropName: "checked" })(
+ 授权将社区加入合作社区名单,项目logo可用于GLCC网站和海报宣传
+ )}
+
+
{taskCount.map((item, index)=>{
return
课题信息({index+1}/5)
{index>0 && }
-
+
})}
{taskCount && taskCount.length<5 &&
@@ -282,7 +324,7 @@ function EditRepoApplyInfo(props) {
}
{(isAddRepo || applyInfo) && 取消编辑将清除已填写的所有项目信息,请谨慎操作}
+ title={取消将不保存所有修改,请谨慎操作}
onConfirm={cancelEdit}
okText="确定"
cancelText="取消"
diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx
index 7ee5d1782..fd70553c8 100644
--- a/src/glcc/apply/index.jsx
+++ b/src/glcc/apply/index.jsx
@@ -1,6 +1,6 @@
import React , { useEffect , useState } from 'react';
import { Breadcrumb, message } from 'antd';
-import {getUserApplyInfo} from '../api';
+import {getUserApplyInfo, getGlccSettings, currentRound, formatParsedResult} from '../api';
import axios from 'axios';
import RepoInfo from './repoInfo';
import EditInfo from './editInfo';
@@ -10,7 +10,7 @@ import './index.scss';
import { FlexAJ } from '../../forge/Component/layout';
// 项目、课题报名
function Apply(props) {
- const {current_user, round} = props;
+ const {current_user, round, glccSettings} = props;
const [reload, setReload] = useState(undefined);
const [cateList, setCateList] = useState([]);
const [userApplyInfo, setUserApplyInfo] = useState([]);
@@ -18,6 +18,9 @@ function Apply(props) {
const [isAddRepo, setIsAddRepo] = useState(false);
// 编辑项目个数
const [editRepoCount, setEditRepoCount] = useState(0);
+ // 课题奖励-后台配置
+ const [rewardList, setRewardList] = useState([]);
+ const applyTime = glccSettings && glccSettings.filter(item=>item.name === "repoApply");
useEffect(()=>{
// 进入此页面置顶
@@ -30,6 +33,12 @@ function Apply(props) {
setCateList(result.data.project_categories);
}
}).catch(error=>{})
+ // 获取课题奖励分类
+ getGlccSettings({round: currentRound, type: "rewardSetting"}).then(res=>{
+ if(res && res.data){
+ setRewardList(res.data);
+ }
+ })
}else{
window.location.href="/login?go_page=/glcc/apply";
}
@@ -74,20 +83,21 @@ function Apply(props) {
{userApplyInfo.length > 0 && 您已报名成功,可实时修改您的报名信息再次提交。请关注夏令营首页新闻公告获得更多活动资讯!
}
申请说明
-
1、项目报名时间为4月29日—5月30日,请在报名截止时间(北京时间2023年5月30日24点)前提交报名信息。
-
2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖金支持。
-
3、如果您的项目还未迁移到GitLink上,迁移事项请查看
迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
+
1、项目报名时间为{formatParsedResult(applyTime, "rangeDay")},请在报名截止时间(北京时间{formatParsedResult(applyTime, "end")})前提交报名信息。
+
2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖励支持。
+
3、如果您的项目还未迁移到GitLink上,迁移事项请查看
迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
4、提交社区和题目信息后,欢迎与组委会联系沟通宣传推广和后续合作工作。联系人微信: _TigerWang(备注GitLink编程夏令营)
-
5、奖金默认由项目方支持,请根据课题难度设定金额。若您可能无法支撑本课题奖金,GLCC组委会将进行资助评审,择优资助。如未获得资助,将下线该课题
+
5、在项目报名期间({formatParsedResult(applyTime, "rangeDay")}),您可以随时进入当前页调整项目或课题报名信息
+
6、课题奖励默认由项目方支持,可提供现金或者实习机会等其他形式的奖励,请根据课题难度设定奖励内容。若您可能无法支撑本课题奖励,GLCC组委会将进行资助评审,择优资助。如未获得资助,将下线该课题
项目报名
{userApplyInfo.length > 0 && 添加项目}
{userApplyInfo.length > 0 &&
- {userApplyInfo.map((item, index)=>
{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit}/>
)}
+ {userApplyInfo.map((item, index)=>
{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit} rewardList={rewardList}/>
)}
}
- {(!userApplyInfo.length || isAddRepo) && {setReload(Math.random())}}/>}
+ {(!userApplyInfo.length || isAddRepo) && {setReload(Math.random())}} rewardList={rewardList}/>}
)
diff --git a/src/glcc/apply/repoInfo.jsx b/src/glcc/apply/repoInfo.jsx
index fdd7d104e..b45ad0d01 100644
--- a/src/glcc/apply/repoInfo.jsx
+++ b/src/glcc/apply/repoInfo.jsx
@@ -4,7 +4,7 @@ import EditInfo from "./editInfo";
import { FlexAJ } from "../../forge/Component/layout";
import { main_site_url } from "../fetch";
import './index.scss';
-import { deleteApplyInfo } from "../api";
+import { deleteApplyInfo, rewardMoney } from "../api";
// 项目、课题信息展示
function RepoInfo(props) {
const {applyInfo:{id, projectLogoId, projectName, projectType, contactName, contactPhone, contactMail, gitlinkUrl, projectIntro, registrationTaskList}, setReload, editRepoCount, setEditRepoCount, repoCount, isAddRepo, scrollToEdit} = props;
@@ -34,20 +34,21 @@ function RepoInfo(props) {
// 课题信息展示
const showTask = (task) => {
- const {id, taskDifficulty, taskName, taskReward, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl} = task;
+ const {id, taskDifficulty, taskName, taskReward, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl, settingRewardValue, settingRewardRemark} = task;
return
{difficultyList[taskDifficulty]}
{taskName}
- ¥ {taskReward}
+ {settingRewardValue === rewardMoney ? `¥ ${settingRewardRemark}` : settingRewardValue}
导师信息:{tutorName}({tutorPhone} | {tutorMail})
课题链接:{taskUrl}
+ {settingRewardValue !== rewardMoney &&
奖励备注:{settingRewardRemark}
}
课题简介:{taskDesc}
diff --git a/src/glcc/apply/taskApply.jsx b/src/glcc/apply/taskApply.jsx
index 86ed6c5f0..8fe90d38a 100644
--- a/src/glcc/apply/taskApply.jsx
+++ b/src/glcc/apply/taskApply.jsx
@@ -1,27 +1,27 @@
-import React from 'react';
-import {Form, Input, Select } from 'antd';
+import React, { useEffect, useState } from 'react';
+import {Form, Input, Radio, Select } from 'antd';
import TextArea from 'antd/lib/input/TextArea';
+import { rewardMoney } from '../api';
const Option = Select.Option;
// 课题信息编辑
function TaskApply(props) {
- const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator} = props;
+ const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator, rewardList, getFieldValue, resetFields} = props;
// 低、中、高
const difficultyList = [
{id: 1, name: "低"},
{id: 2, name: "中"},
{id: 3, name: "高"}
]
- // 奖金
- const rewardList = [
- {id: 12000},
- {id: 11000},
- {id: 10000},
- {id: 9000},
- {id: 8000},
- {id: 7000},
- {id: 6000},
- {id: 0},
- ]
+ // 奖金数额
+ const amountList = [12000, 11000, 10000, 9000, 8000, 7000, 6000]
+ const disabledProps = {
+ disabled: disabled,
+ className: disabled? "disabledInput":""
+ }
+ // 选中的奖励方式
+ const rewardId = getFieldValue(`settingRewardId${taskKey}`);
+ const rewardItem = rewardId && rewardList && rewardList.filter(item=>item.id === rewardId);
+ const rewardName = rewardItem && rewardItem[0] && rewardItem[0].value;
return(
@@ -34,67 +34,95 @@ function TaskApply(props) {
`taskName${taskKey}`,
[{ required: true, message: "请输入课题名称,长度限制32个字符" },
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
-
+
)}
{helper('课题链接',
'',
`taskUrl${taskKey}`,
[{ required: true, message: "请输入课题链接" },
{ max: 252, message: '超出限制长度252位字符,请重新编辑' }],
-
+
)}
{helper('课题难度',
'',
`taskDifficulty${taskKey}`,
[{ required: true, message: "请选择课题难度" }],
-
diff --git a/src/glcc/freeProject/index.scss b/src/glcc/freeProject/index.scss
index b9551b814..2f8ad532f 100644
--- a/src/glcc/freeProject/index.scss
+++ b/src/glcc/freeProject/index.scss
@@ -52,6 +52,7 @@
}
// 项目详情框
.projectDetailBox{
+ word-break: break-all;
&.byTask{
background-image:linear-gradient(180deg,#f1f5ff 0%,#ffffff 100%);
border:1px solid #ffffff;
diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx
index a9f24b920..234faa9e5 100644
--- a/src/glcc/home/index.jsx
+++ b/src/glcc/home/index.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from "react";
+import React, { Fragment, useEffect, useState } from "react";
import { Link } from "react-router-dom";
// import Banner from "./banner";
import Lightspot from './lightspot';
@@ -7,7 +7,9 @@ import Award from "./award";
import News from './news';
import Partner from "./partner";
import Contact from "./contact";
+import PreviousReview from './previousReview';
import banner from "../img/banner.png";
+import banner2024 from "../img/banner2024.jpg";
import introduce from "../img/introduce.png";
import apply1 from "../img/apply1.png";
import apply2 from "../img/apply2.png";
@@ -15,14 +17,14 @@ import img1 from "../img/img1.png";
import img2 from "../img/img2.png";
import teacher from "../img/teacher.png";
import logo from "../img/openmmlab/logo1.png";
-import { hasAuditRole } from '../api';
+import { currentRound, hasAuditRole } from '../api';
import './index.scss';
// round:2022届(1) 2023届(2)
// period: 项目报名阶段("repoApply")
// match:{params:{id=2023}} 注意默认值记得每届修改
export default (props) => {
- const { current_user, history, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic, showMatchingBut, isResultPublic, hasRole, isMediumExamineByToTutor, isFinalExamineByToTutor, checkedTaskId} = props;
+ const { current_user, history, round, match:{params:{id=2024}}, period, showLoginDialog, glccSettings, repoPublic, showMatchingBut, isResultPublic, hasRole, isMediumExamineByToTutor, isFinalExamineByToTutor, checkedTaskId} = props;
useEffect(() => {
if (!current_user.user_id) {
history.push('/403');
@@ -40,16 +42,9 @@ export default (props) => {
return (
- {/*
*/}
-

- {/*
*/}
- {/*
{!isGlccApplyDate && showNotification("不在报名时间,报名时间为4月15日~5月20日")}}> */}
- {/*
*/}
+

{/* 往期回顾 */}
- {round !== 2 &&
+ {round !== currentRound ?

@@ -64,10 +59,8 @@ export default (props) => {
掌握项目课题详细信息
-
}
- {/* 当前glcc */}
- {round === 2 &&
- {/* 项目报名入口 */}
+
:
-
-
+ {round === currentRound ?
+
+
+ : }
-
+
diff --git a/src/glcc/home/lightspot/index.jsx b/src/glcc/home/lightspot/index.jsx
index 3c5aa6e10..009c56a29 100644
--- a/src/glcc/home/lightspot/index.jsx
+++ b/src/glcc/home/lightspot/index.jsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { Fragment } from 'react';
import lightspot1 from '../../img/lightspot1.png';
import lightspot2 from '../../img/lightspot2.png';
import lightspot3 from '../../img/lightspot3.png';
@@ -6,36 +6,12 @@ import lightspot4 from '../../img/lightspot4.png';
import './index.scss';
-function Lightspot(props) {
- const {current_user, period, history, round, showLoginDialog, id} = props;
-
- function goToApply(){
- const url = period === "repoApply" ? `/glcc/apply` : `/glcc/${id}/subjects`;
- if(current_user && !current_user.login){
- showLoginDialog(url);
- return;
- }
- history.push(url);
- }
-
+function Lightspot() {
return (
活动亮点
-
-
-
有兴趣成为GLCC的导师吗?
-
想要扩大项目知名度和影响力,为开源项目吸引新鲜血液,培养长期开发者。通过GitLink平台,与高校建立连接,指导开源新人传授他们的开源文化,享受开源的乐趣
- {period === "repoApply" && round === 2 ?
立即报名
:
项目报名已结束
}
-
-
-
你是开源新手,有兴趣参加GLCC吗?
-
想要参与一线开源项目开发,熟悉开源社区运作流程,接受资深开源软件专家指导,获得丰厚奖金和实习机会。参加GLCC,开启全新的开源之旅。
- {(period === "stuApply" || period === "stuApply1") && round === 2 ?
学生报名
:
学生报名{period === "repoApply" && round === 2 ? "敬请期待" : "已结束"}
}
-
-
-

@@ -60,11 +36,7 @@ function Lightspot(props) {
丰厚奖励&实习绿色通道
入选同学可获得丰厚奖金,并有机会进入优秀开源项目企业实习或工作,受邀参与开源大会等机会
-
-
-
-
diff --git a/src/glcc/home/lightspot/index.scss b/src/glcc/home/lightspot/index.scss
index 7b708f883..22a06c026 100644
--- a/src/glcc/home/lightspot/index.scss
+++ b/src/glcc/home/lightspot/index.scss
@@ -1,8 +1,7 @@
.lightspot {
background: url("../../img/lightspot-bg.png");
background-size: 100% 100%;
- height: 44.6875vw;
- min-height: 858px;
+ min-height: 620px;
.glcc-content{
padding-top:55px;
diff --git a/src/glcc/home/news/index.jsx b/src/glcc/home/news/index.jsx
index 866fd59aa..f2e1a1492 100644
--- a/src/glcc/home/news/index.jsx
+++ b/src/glcc/home/news/index.jsx
@@ -2,11 +2,13 @@ import React, { useEffect, useState } from 'react';
import { Button, Col, Row } from 'antd';
import axios from 'axios';
import './index.scss';
+import { Link } from 'react-router-dom';
+import { currentRound } from '../../api';
-function News() {
-
+function News({round}) {
const [list, setList] = useState([]);
+
useEffect(() => {
const url = `/topics.json?topic_type=glcc_news&limit=5`;
axios.get(url).then(result => {
@@ -20,6 +22,9 @@ function News() {
新闻中心
+ {round === currentRound &&
+ 查看更多
+
}
{list.length ?
diff --git a/src/glcc/home/news/index.scss b/src/glcc/home/news/index.scss
index f2339af88..cf4963e2d 100644
--- a/src/glcc/home/news/index.scss
+++ b/src/glcc/home/news/index.scss
@@ -1,5 +1,5 @@
.news {
- min-height: 529px;
+ min-height: 570px;
background-image: linear-gradient(180deg, #d6e6ff 0%, #f9fbff 100%);
.ant-btn-link {
@@ -81,4 +81,10 @@
}
}
}
+ .moreNews{
+ text-align: right;
+ &>a{
+ color: $primary-color;
+ }
+ }
}
diff --git a/src/glcc/home/previousReview/index.jsx b/src/glcc/home/previousReview/index.jsx
new file mode 100644
index 000000000..1573f0de6
--- /dev/null
+++ b/src/glcc/home/previousReview/index.jsx
@@ -0,0 +1,175 @@
+import React, { Fragment } from 'react';
+import Step from '../timerShaft/step';
+import lightspot1 from '../../img/lightspot1.png';
+import lightspot2 from '../../img/lightspot2.png';
+import lightspot3 from '../../img/lightspot3.png';
+import lightspot4 from '../../img/lightspot4.png';
+import '../lightspot/index.scss';
+import '../timerShaft/index.scss';
+
+
+function Lightspot({round}) {
+ const stepArr2022 = [{
+ title: "Step1",
+ date: "4.15",
+ content: "GLCC夏令营活动发布"
+ },
+ {
+ title: "Step2",
+ date: "4.15-5.19",
+ content: "社区项目报名,提交课题"
+ },
+ {
+ title: "Step2",
+ date: "5.20-5.25",
+ content: "公示社区项目名单"
+ },
+ {
+ title: "Step2",
+ date: "5.26-6.24",
+ content: "学生报名,提交Proposal"
+ },
+ {
+ title: "Step2",
+ date: "7.1",
+ content: "公示入选学生名单",
+ noArrow: true,
+ },
+ {
+ title: "Step2",
+ date: "7.1-8.12",
+ content: "项目开发第一阶段",
+ },
+ {
+ title: "Step2",
+ date: "8.12-9.30",
+ content: "项目开发第二阶段",
+ },
+ {
+ title: "Step2",
+ date: "10.1-10.21",
+ content: "结项审核,并公示考核结果",
+ },
+ {
+ title: "Step2",
+ date: "10.21-11.11",
+ content: "评选公布优秀项目和学员",
+ noArrow: true,
+ }
+ ]
+ const stepArr2023 = [{
+ title: "Step1",
+ date: "4.29",
+ content: "GLCC夏令营活动发布"
+ },
+ {
+ title: "Step2",
+ date: "4.29-5.30",
+ content: "社区项目报名,提交课题"
+ },
+ {
+ title: "Step2",
+ date: "5.31-6.3",
+ content: "课题审核及公布"
+ },
+ {
+ title: "Step2",
+ date: "6.4-6.21",
+ content: "学生报名,提交Proposal"
+ },
+ {
+ title: "Step2",
+ date: "7.1",
+ content: "公示入选学生名单",
+ noArrow: true,
+ },
+ {
+ title: "Step2",
+ date: "7.1-8.11",
+ content: "项目开发第一阶段",
+ },
+ {
+ title: "Step2",
+ date: "8.20",
+ content: "中期考核,公示考核结果",
+ },
+ {
+ title: "Step2",
+ date: "8.21-9.28",
+ content: "项目开发第二阶段",
+ },
+ {
+ title: "Step2",
+ date: "10.11",
+ content: "结项考核,公示考核结果",
+ },
+ {
+ title: "Step2",
+ date: "10.22",
+ content: "优秀项目/学生公布及颁奖",
+ noArrow: true,
+ }
+ ]
+ const step = round === 2 ? stepArr2023 : stepArr2022
+ return (
+
+
+
+
活动亮点
+
+
+
+
有兴趣成为GLCC的导师吗?
+
想要扩大项目知名度和影响力,为开源项目吸引新鲜血液,培养长期开发者。通过GitLink平台,与高校建立连接,指导开源新人传授他们的开源文化,享受开源的乐趣
+
项目报名已结束
+
+
+
你是开源新手,有兴趣参加GLCC吗?
+
想要参与一线开源项目开发,熟悉开源社区运作流程,接受资深开源软件专家指导,获得丰厚奖金和实习机会。参加GLCC,开启全新的开源之旅。
+
学生报名已结束
+
+
+
+
+

+
汇聚行业顶尖开源项目
+
平台汇聚腾讯、百度、阿里巴巴、亚马逊云科技、滴滴等行业尖端开源项目,把握开源生态发展脉搏
+
+
+
+

+
覆盖全国千所高校、万名会员
+
活动邀请10+全球顶尖开源基金会,100+顶级开源项目社区,致力营造专业、开放的开源社区
+
+
+
+

+
结识开源伙伴和技术大咖
+
每个项目配备一名导师,参与开源项目开发可接受一线资深开源项目专家专业指导,结识志同道合的开发伙伴
+
+
+
+

+
丰厚奖励&实习绿色通道
+
入选同学可获得丰厚奖金,并有机会进入优秀开源项目企业实习或工作,受邀参与开源大会等机会
+
+
+
+
+
+
+
+
时间规划
+
+ {
+ step.map((item, i) => {
+ return
+ })
+ }
+
+
+
+
+ )
+}
+export default Lightspot;
\ No newline at end of file
diff --git a/src/glcc/home/timerShaft/index.jsx b/src/glcc/home/timerShaft/index.jsx
index cd808db55..ae9b04e99 100644
--- a/src/glcc/home/timerShaft/index.jsx
+++ b/src/glcc/home/timerShaft/index.jsx
@@ -1,146 +1,121 @@
-import React from 'react';
+import React, { Fragment } from 'react';
import Step from './step';
import './index.scss';
+import { formatParsedResult } from '../../api';
-const stepArr2022 = [{
- title: "Step1",
- date: "4.15",
- content: "GLCC夏令营活动发布"
-},
-{
- title: "Step2",
- date: "4.15-5.19",
- content: "社区项目报名,提交课题"
-},
-{
- title: "Step2",
- date: "5.20-5.25",
- content: "公示社区项目名单"
-},
-{
- title: "Step2",
- date: "5.26-6.24",
- content: "学生报名,提交Proposal"
-},
-{
- title: "Step2",
- date: "7.1",
- content: "公示入选学生名单",
- noArrow: true,
-},
-{
- title: "Step2",
- date: "7.1-8.12",
- content: "项目开发第一阶段",
-},
-{
- title: "Step2",
- date: "8.12-9.30",
- content: "项目开发第二阶段",
-},
-{
- title: "Step2",
- date: "10.1-10.21",
- content: "结项审核,并公示考核结果",
-},
-{
- title: "Step2",
- date: "10.21-11.11",
- content: "评选公布优秀项目和学员",
- noArrow: true,
-}
-]
-const stepArr = [{
- title: "Step1",
- date: "4.29",
- content: "GLCC夏令营活动发布"
-},
-{
- title: "Step2",
- date: "4.29-5.30",
- content: "社区项目报名,提交课题"
-},
-{
- title: "Step2",
- date: "5.31-6.3",
- content: "课题审核及公布"
-},
-{
- title: "Step2",
- date: "6.4-6.21",
- content: "学生报名,提交Proposal"
-},
-{
- title: "Step2",
- date: "7.1",
- content: "公示入选学生名单",
- noArrow: true,
-},
-{
- title: "Step2",
- date: "7.1-8.11",
- content: "项目开发第一阶段",
-},
-{
- title: "Step2",
- date: "8.20",
- content: "中期考核,公示考核结果",
-},
-{
- title: "Step2",
- date: "8.21-9.28",
- content: "项目开发第二阶段",
-},
-{
- title: "Step2",
- date: "10.11",
- content: "结项考核,公示考核结果",
-},
-{
- title: "Step2",
- date: "10.22",
- content: "优秀项目/学生公布及颁奖",
- noArrow: true,
-}
-]
+function TimerShaft(props) {
+ const {current_user, period, history, showLoginDialog, id, glccSettings} = props;
+ const step = [{
+ title: "Step1",
+ date: "4.22",
+ content: "GLCC夏令营活动发布"
+ },
+ {
+ title: "Step2",
+ date: "4.22-5.24",
+ content: "社区项目报名,提交课题"
+ },
+ {
+ title: "Step2",
+ date: "5.29-5.31",
+ content: "课题审核及公布"
+ },
+ {
+ title: "Step2",
+ date: "5.31-6.23",
+ content: "学生报名,提交Proposal"
+ },
+ {
+ title: "Step2",
+ date: "7.1",
+ content: "公示入选学生名单",
+ noArrow: true,
+ },
+ {
+ title: "Step2",
+ date: "7.1-8.18",
+ content: "项目开发第一阶段",
+ },
+ {
+ title: "Step2",
+ date: "8.30",
+ content: "中期考核,公示考核结果",
+ },
+ {
+ title: "Step2",
+ date: "8.30-10.20",
+ content: "项目开发第二阶段",
+ },
+ {
+ title: "Step2",
+ date: "10.31",
+ content: "结项考核,公示考核结果",
+ },
+ {
+ title: "Step2",
+ date: "11月",
+ content: "优秀项目/学生公布及颁奖",
+ noArrow: true,
+ }]
-function TimerShaft({round, glccSettings}) {
- // if(glccSettings && glccSettings.length > 12){
- // stepArr[1].date = getRangeTime(glccSettings[0].value);
- // stepArr[2].date = getRangeTime(glccSettings[1].value);
- // stepArr[3].date = getRangeTime(glccSettings[2].value);
- // stepArr[4].date = getTime(glccSettings[3].value);
- // stepArr[5].date = getRangeTime(glccSettings[11].value);
- // stepArr[6].date = getTime(glccSettings[7].value);
- // stepArr[7].date = getRangeTime(glccSettings[12].value);
- // stepArr[8].date = getTime(glccSettings[9].value);
- // stepArr[9].date = getTime(glccSettings[4].value);
- // }
- const step = round === 2 ? stepArr : stepArr2022
-
- // 截取月份/日期
- function getRangeTime(value){
- return value.split(",").map(item=>`${new Date(item).getMonth()+1}.${new Date(item).getDate()}`).join("-");
+ function goToApply(){
+ const url = period === "repoApply" ? `/glcc/apply` : `/glcc/${id}/subjects`;
+ if(current_user && !current_user.login){
+ showLoginDialog(url);
+ return;
+ }
+ history.push(url);
}
-
- function getTime(value){
- const time = new Date(value.split(",")[0]);
- return `${new Date(time).getMonth()+1}.${new Date(time).getDate()}`;
+ if(glccSettings){
+ // 活动发布、项目课题报名
+ const repoApply = glccSettings.filter(item=>item.name === "repoApply");
+ repoApply[0] && (step[0].date = formatParsedResult(repoApply, "startMonthDay"))
+ repoApply[0] && (step[1].date = formatParsedResult(repoApply, "rangeConcatDot"))
+ // 学生报名
+ const stuApply = glccSettings.filter(item=>item.name === "stuApply");
+ stuApply[0] && (step[3].date = formatParsedResult(stuApply, "rangeConcatDot"))
+ // 入选学生名单公示-取配置的截止时间
+ const stuPublic = glccSettings.filter(item=>item.name === "stuPublic");
+ stuPublic[0] && (step[4].date = formatParsedResult(stuPublic, "startMonthDay"))
+ // 中期考核结果公示-取配置的截止时间
+ const mediumExamine = glccSettings.filter(item=>item.name === "mediumExamine3");
+ mediumExamine[0] && (step[6].date = formatParsedResult(mediumExamine, "startMonthDay"))
+ // 结项考核结果公示-取配置的截止时间
+ const finalExamine = glccSettings.filter(item=>item.name === "finalExamine3");
+ finalExamine[0] && (step[8].date = formatParsedResult(finalExamine, "startMonthDay"))
}
return (
-