From 424742665b33bea7b5ed16d4c68bc88e80efaa19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= Date: Fri, 20 May 2022 16:48:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=8A=A5=E5=90=8D=E9=80=9A?= =?UTF-8?q?=E9=81=93=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/api.js | 9 +++++ src/glcc/home/index.jsx | 10 +++++- src/glcc/home/lightspot/index.jsx | 10 +++++- src/glcc/index.jsx | 6 ++-- src/glcc/project/component/projectDetail.jsx | 6 ++-- src/glcc/project/index.jsx | 6 ++-- src/glcc/project/index.scss | 26 ++++++++++----- src/glcc/project/taskList/index.jsx | 35 ++++++++++++++++---- src/glcc/project/taskList/index.scss | 11 ++++++ src/glcc/student/index.jsx | 4 +-- 10 files changed, 95 insertions(+), 28 deletions(-) diff --git a/src/glcc/api.js b/src/glcc/api.js index 71130f98..217d7870 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -80,3 +80,12 @@ export function cancelTaskApply(data) { data: data }); } + +// 学生报名课题列表 +export function studentApplyList(params) { + return fetch({ + url: `/api/studentApply/list`, + method: 'get', + params + }); +} \ No newline at end of file diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx index 359fa641..c3085b39 100644 --- a/src/glcc/home/index.jsx +++ b/src/glcc/home/index.jsx @@ -28,6 +28,14 @@ export default (props) => { } } + function goToStudent(){ + // 学生报名时间 + const studentApply = Date.parse(new Date()) > 1653494400000; + if(!studentApply){ + showNotification("不在报名时间,报名开始时间为5月26日"); + } + } + return (
{/* */} @@ -50,7 +58,7 @@ export default (props) => {
项目报名开启,导师席位虚位以待
{/* 学生报名 */} -
{window.location.href="/glcc/student/2"}}> +
学生报名 > diff --git a/src/glcc/home/lightspot/index.jsx b/src/glcc/home/lightspot/index.jsx index 8cfdb9ed..b8ba6af0 100644 --- a/src/glcc/home/lightspot/index.jsx +++ b/src/glcc/home/lightspot/index.jsx @@ -27,6 +27,14 @@ function Lightspot(props) { } } + function goToStudent(){ + // 学生报名时间 + const studentApply = Date.parse(new Date()) > 1653494400000; + if(!studentApply){ + showNotification("不在报名时间,报名开始时间为5月26日"); + } + } + return (
@@ -44,7 +52,7 @@ function Lightspot(props) {

你是开源新手,有兴趣参加GLCC吗?

想要参与一线开源项目开发,熟悉开源社区运作流程,接受资深开源软件专家指导,获得丰厚奖金和实习机会。参加GLCC,开启全新的开源之旅。
{/* {!isGlccApplyDate && showNotification("不在报名时间,报名时间为4月15日~5月20日")}}>立即报名 */} -
{window.location.href="/glcc/student/2"}}>学生报名
+
学生报名
{/* */}
diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index ab4a17cc..1778b66d 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -44,8 +44,6 @@ const Project = Loadable({ const Glcc = (propsF) => { // 判断时间是否在开源夏令营报名时间内(4月15日~5月20日) const isGlccApplyDate = Date.parse(new Date()) < 1653062400000; - // 刷新用户课题报名信息 - const [studentInfoReset, setStudentInfoReset] = useState(undefined); return (
@@ -54,7 +52,7 @@ const Glcc = (propsF) => { ( - + )} > {/* 开源夏令营报名页面 */} @@ -75,7 +73,7 @@ const Glcc = (propsF) => { ( - + )} > {/* 首页 */} diff --git a/src/glcc/project/component/projectDetail.jsx b/src/glcc/project/component/projectDetail.jsx index fe4b9ad9..e8575d90 100644 --- a/src/glcc/project/component/projectDetail.jsx +++ b/src/glcc/project/component/projectDetail.jsx @@ -50,11 +50,11 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
邮箱地址:   {item.tutorMail}
-
{item.taskDesc}
-
课题链接:   {item.taskUrl}
+
      {item.taskDesc}
+
奖金:   {item.taskReward}
+ {item.taskUrl &&
课题链接:   {item.taskUrl}
}
{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? : isStudentApplyDate && )}
-
¥ {item.taskReward}
}) : }
:
diff --git a/src/glcc/project/index.jsx b/src/glcc/project/index.jsx index 7b164118..652de14c 100644 --- a/src/glcc/project/index.jsx +++ b/src/glcc/project/index.jsx @@ -20,7 +20,7 @@ const TaskList = Loadable({ }); function Project(propsF) { - const {location, current_user, showLoginDialog, studentInfoReset, setStudentInfoReset} = propsF; + const {location, current_user, showLoginDialog} = propsF; const {pathname} = location; const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000; const studentApplyEnd = Date.parse(new Date()) > 1656086400000; @@ -29,6 +29,8 @@ function Project(propsF) { // 用户已报名课题id数组 const [applyTaskId, setApplyTaskId] = useState({}); + // 刷新用户课题报名信息 + const [studentInfoReset, setStudentInfoReset] = useState(undefined); useEffect(()=>{ // 获取用户课题报名信息current_user user_id @@ -65,7 +67,7 @@ function Project(propsF) { ( - + )} > {(current-1)*pageSize+index + 1} }, { title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '28%', ellipsis: true, render: (text, item) => {window.location.href=item.taskUrl}}>{text} }, { title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '28%', ellipsis: true, render: (text) => {text} }, - { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) => ¥ {text} }, + { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) => {text} }, { title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => { return ( @@ -132,17 +134,36 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial data.map((item, index)=>{ ids.includes(item.id.toString()) && toFirst(data, index); }) - setData(response.data.rows); + setData(data); setTotal(response.data.total); } setLoading(false); }) - }, [keyword, current, pageSize]) + }, [keyword, current, pageSize, applyTaskId]) + + useEffect(()=>{ + // if(apply){ + // // 判断用户是否已经登录 + // if(current_user && current_user.login){ + // apply && studentApplyList().then(response => { + // if (response && response.message === "success") { + // console.log(response); + // } + // }) + // }else{ + // showLoginDialog(); + // } + // } + },[apply]) return (
-
{ setCurrent(1); setKeyword(value) }} />
+
+ {setApply(e.target.checked)}}>已报名 + { setCurrent(1); setKeyword(value) }} /> +
+
{ if (response && response.message === "success") { showNotification("修改信息成功"); - setStudentInfoReset(Math.random()); + // setStudentInfoReset(Math.random()); setReload(Math.random()); setLoading(false); } @@ -198,7 +198,7 @@ function Apply(props) { studentApply(params).then(response => { if (response && response.message === "success") { showNotification("报名成功"); - setStudentInfoReset(Math.random()); + // setStudentInfoReset(Math.random()); setReload(Math.random()); setLoading(false); }