From 74a874f274b8a93585eb733ae46d53840d99e745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 21 Aug 2019 17:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 28 +++++++--- .../src/modules/courses/new/Goldsubject.js | 54 +++++++++++-------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index ab3ebb02d..00eba8ea0 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -19,8 +19,8 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import AccountProfile from "./modules/user/AccountProfile"; -import Trialapplication from './modules/login/Trialapplication' - +import Trialapplication from './modules/login/Trialapplication'; +import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import NotFoundPage from './NotFoundPage' import Loading from './Loading' @@ -247,12 +247,24 @@ const Messagerouting= Loadable({ class App extends Component { constructor(props) { super(props) - // this.state = { - // isRenders:false, - // } + this.state = { + mydisplay:false + } } - + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + Addcoursestypes:false, + mydisplay:true, + occupation:i, + }) + }; + ModalCancelsy=()=>{ + this.setState({ + mydisplay:false, + }) + }; componentDidMount() { // force an update if the URL changes history.listen(() => { @@ -304,8 +316,8 @@ class App extends Component { - - {/**/} + this.HideAddcoursestypess(i)}/> + diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index 0fe39bcd1..bd427edf3 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -66,12 +66,12 @@ class Goldsubject extends Component { const { datatime } = this.state; var datatimes=""; - if(datatime!==undefined){ - datatimes=datatime; - datatimes=moment(datatimes, dateFormat).subtract(0, 'days');; - }else { - datatimes=datatime; - } + // if(datatime!==undefined){ + // datatimes=datatime; + datatimes=moment(datatime, dateFormat); + // }else { + // datatimes=datatime; + // } if (!startValue || !datatimes) { return false; } @@ -84,12 +84,12 @@ class Goldsubject extends Component { // console.log(moment(new Date(), dateFormat).add(2, 'days')); const { datatimetwo } = this.state; var startvalue=""; - if(datatimetwo!==undefined){ - startvalue=datatimetwo; - startvalue=moment(startvalue, dateFormat).add(1, 'days'); - }else { - startvalue=datatimetwo; - } + // if(datatimetwo!==undefined){ + // startvalue=datatimetwo; + startvalue=moment(datatimetwo, dateFormat); + // }else { + // startvalue=datatimetwo; + // } // console.log("结束时间"); // console.log(endValue); // console.log(startvalue); @@ -359,9 +359,12 @@ class Goldsubject extends Component { }); } else { + debugger + this.props.form.validateFields((err, values) => { console.log("错误信息信息信息2"); console.log(err); + console.log("xingxixingxi"); if (err) { return; } @@ -384,17 +387,22 @@ class Goldsubject extends Component { // console.log('Received values of form: ', values); let subjectid = this.props.match.params.subjectid; let url = "/courses.json"; - axios.post(url, { - subject_id:subjectid, //这是带过来的值 - name: values.classroom, - class_period: values.period, - credit: parseFloat(values.credit), - start_date:values.starttime, - end_date: values.endtime, - is_public: is_public, //这是也是带过来的值 - course_module_types: values.checkboxgroup, - school:values.school - } + var ysldatas={ + subject_id:subjectid, //这是带过来的值 + name: values.classroom, + class_period: values.period, + credit: parseFloat(values.credit), + start_date:values.starttime, + end_date: values.endtime, + is_public: is_public, //这是也是带过来的值 + course_module_types: values.checkboxgroup, + school:values.school + }; + console.log("提交的ysldatas数据"); + console.log(ysldatas); + console.log(JSON.stringify(ysldatas)); + axios.post(url, + ysldatas ).then((response) => { if (response.status === 200) { // this.goback