forked from Gitlink/forgeplus-react
提交报名信息二级确认框
This commit is contained in:
parent
cbf0f827dd
commit
13a54a3e29
|
@ -10,7 +10,7 @@ const Option = Select.Option;
|
||||||
function Apply(props) {
|
function Apply(props) {
|
||||||
const {form, current_user, showNotification, isGlccApplyDate} = props;
|
const {form, current_user, showNotification, isGlccApplyDate} = props;
|
||||||
// 可用于开发时不同账号报名
|
// 可用于开发时不同账号报名
|
||||||
// current_user && (current_user.user_id = 1)
|
// current_user && (current_user.user_id = 6)
|
||||||
// current_user && (current_user.userName = "创新使者")
|
// current_user && (current_user.userName = "创新使者")
|
||||||
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
|
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
|
||||||
const [reload, setReload] = useState(undefined);
|
const [reload, setReload] = useState(undefined);
|
||||||
|
@ -29,6 +29,8 @@ function Apply(props) {
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
// 进入此页面置顶
|
||||||
|
window.scrollTo(0,0);
|
||||||
if(!isGlccApplyDate){
|
if(!isGlccApplyDate){
|
||||||
// 不在开源夏令营报名时间之内
|
// 不在开源夏令营报名时间之内
|
||||||
window.location.href="/glcc";
|
window.location.href="/glcc";
|
||||||
|
@ -72,16 +74,22 @@ function Apply(props) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
validateFieldsAndScroll((err, values) => {
|
validateFieldsAndScroll((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
const params ={
|
Modal.confirm({
|
||||||
...values,
|
title: "报名",
|
||||||
projectLogoId: values.logo.file.response.data.id,
|
content: "确定提交报名信息,提交后报名信息将无法修改",
|
||||||
userId: current_user.user_id,
|
onOk: ()=>{
|
||||||
userName: current_user.username
|
const params ={
|
||||||
}
|
...values,
|
||||||
applyGlcc(params).then(response=>{
|
projectLogoId: values.logo.file.response.data.id,
|
||||||
if(response && response.message === "success"){
|
userId: current_user.user_id,
|
||||||
showNotification("报名成功");
|
userName: current_user.username
|
||||||
setReload(Math.random());
|
}
|
||||||
|
applyGlcc(params).then(response=>{
|
||||||
|
if(response && response.message === "success"){
|
||||||
|
showNotification("报名成功");
|
||||||
|
setReload(Math.random());
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue