This commit is contained in:
谢思 2022-05-20 14:23:36 +08:00
parent cf361ad002
commit 50d92c2bdd
4 changed files with 10 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import "./index.scss";
import Loadable from "react-loadable";
import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import { useState } from "react";
//
@ -43,6 +44,8 @@ const Project = Loadable({
const Glcc = (propsF) => {
// 415~520
const isGlccApplyDate = Date.parse(new Date()) < 1653062400000;
//
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
return (
<div className="newMain clearfix">
@ -51,7 +54,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/student/apply/:taskId"
render={(props) => (
<Student {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
<Student {...propsF} {...props} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
)}
></Route>
{/* 开源夏令营报名页面 */}
@ -72,7 +75,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/student"
render={(props) => (
<Project {...propsF} {...props} />
<Project {...propsF} {...props} studentInfoReset={studentInfoReset} setStudentInfoReset={setStudentInfoReset}/>
)}
></Route>
{/* 首页 */}

View File

@ -20,7 +20,7 @@ const TaskList = Loadable({
});
function Project(propsF) {
const {location, current_user, showLoginDialog} = propsF;
const {location, current_user, showLoginDialog, studentInfoReset, setStudentInfoReset} = propsF;
const {pathname} = location;
const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000;
const studentApplyEnd = Date.parse(new Date()) > 1656086400000;
@ -29,8 +29,6 @@ function Project(propsF) {
// id
const [applyTaskId, setApplyTaskId] = useState({});
//
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
useEffect(()=>{
// current_user user_id

View File

@ -133,7 +133,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
ids.includes(item.id.toString()) && toFirst(data, index);
})
setData(response.data.rows);
setTotal(response.data.total)
setTotal(response.data.total);
}
setLoading(false);
})

View File

@ -22,7 +22,7 @@ const gradeList = [
{ id: '研二', name: '研二' },
{ id: '研三', name: '研三' }];
function Apply(props) {
const { form, current_user, showNotification, match } = props;
const { form, current_user, showNotification, match, setStudentInfoReset } = props;
const taskId = Number(match.params.taskId);
//
// current_user && (current_user.user_id = 6)
@ -189,6 +189,7 @@ function Apply(props) {
studentApplyEdit(params).then(response => {
if (response && response.message === "success") {
showNotification("修改信息成功");
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}
@ -197,6 +198,7 @@ function Apply(props) {
studentApply(params).then(response => {
if (response && response.message === "success") {
showNotification("报名成功");
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}