forked from Gitlink/forgeplus-react
报名提交确认框
This commit is contained in:
parent
fc6b6dbede
commit
ad7f878357
|
@ -1,5 +1,5 @@
|
|||
import React , { useCallback, useEffect , useState } from 'react';
|
||||
import { Breadcrumb, Button, Form, Input, Select, Upload } from 'antd';
|
||||
import { Breadcrumb, Button, Form, Input, Select, Upload, Modal } from 'antd';
|
||||
import {getUserApplyInfo, applyGlcc} from '../api';
|
||||
import axios from 'axios';
|
||||
import TextArea from 'antd/lib/input/TextArea';
|
||||
|
@ -10,8 +10,8 @@ const Option = Select.Option;
|
|||
function Apply(props) {
|
||||
const {form, current_user, showNotification, isGlccApplyDate} = props;
|
||||
// 可用于开发时不同账号报名
|
||||
// current_user && (current_user.user_id = 1061)
|
||||
// current_user && (current_user.userName = "美女")
|
||||
// current_user && (current_user.user_id = 1)
|
||||
// current_user && (current_user.userName = "创新使者")
|
||||
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
|
||||
const [reload, setReload] = useState(undefined);
|
||||
const [imageUrl, setImageUrl] = useState(undefined);
|
||||
|
@ -72,17 +72,23 @@ function Apply(props) {
|
|||
e.preventDefault();
|
||||
validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
const params ={
|
||||
...values,
|
||||
projectLogoId: values.logo.file.response.data.id,
|
||||
userId: current_user.user_id,
|
||||
userName: current_user.username
|
||||
}
|
||||
applyGlcc(params).then(response=>{
|
||||
if(response && response.message === "success"){
|
||||
setReload(Math.random());
|
||||
}
|
||||
})
|
||||
Modal.confirm({
|
||||
title: "确认提交",
|
||||
content: "确定提交报名信息,提交后报名信息将无法修改。",
|
||||
onOk: ()=>{
|
||||
const params ={
|
||||
...values,
|
||||
projectLogoId: values.logo.file.response.data.id,
|
||||
userId: current_user.user_id,
|
||||
userName: current_user.username
|
||||
}
|
||||
applyGlcc(params).then(response=>{
|
||||
if(response && response.message === "success"){
|
||||
showNotification("报名成功");
|
||||
setReload(Math.random());
|
||||
}
|
||||
})}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue