From 8fa0e46d52b7170c447117de5865b8ce8cfc84b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 22 Aug 2019 15:05:30 +0800 Subject: [PATCH 1/3] b --- .../src/modules/courses/coursesDetail/CoursesBanner.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index cc1a29965..edbd34d91 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -581,8 +581,8 @@ class CoursesBanner extends Component { this.tojoinclass(1)}>加入课堂 : - this.myyslgradin()}>加入课堂 + this.myyslgradin(1)}>加入课堂 ) : ""} @@ -591,8 +591,8 @@ class CoursesBanner extends Component { this.tojoinclass(1)}>加入课堂 : - this.myyslgradin()}>加入课堂 + this.myyslgradin(1)}>加入课堂 : ""} {coursedata.course_identity === 6&&coursedata.educoder_teacher===true? From 3affed7a52f146351c6755db8f3a3355a873221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 22 Aug 2019 16:01:36 +0800 Subject: [PATCH 2/3] =?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 | 7 ++++- .../src/modules/courses/new/Goldsubject.js | 3 ++- .../modules/modals/Certifiedprofessional.js | 27 ++++++++++--------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 7ec25ebc8..e6f55f5d2 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -275,6 +275,11 @@ class App extends Component { }) window.location.href = "/"; }; + ModalshowCancelsy=()=>{ + this.setState({ + mydisplay:true, + }) + }; componentDidMount() { // force an update if the URL changes history.listen(() => { @@ -327,7 +332,7 @@ 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 da7a12b3f..1e72d1995 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -442,7 +442,8 @@ class Goldsubject extends Component { var subjectids=this.props.match.params.subjectid; window.location.href=`/paths/${subjectids}` }else{ - this.props.history.goBack(); + // this.props.history.goBack(); + window.location.href=`/courses/${this.props.match.params.coursesId}/informs` } } diff --git a/public/react/src/modules/modals/Certifiedprofessional.js b/public/react/src/modules/modals/Certifiedprofessional.js index 5e3df4abb..af192273a 100644 --- a/public/react/src/modules/modals/Certifiedprofessional.js +++ b/public/react/src/modules/modals/Certifiedprofessional.js @@ -18,20 +18,23 @@ class Certifiedprofessional extends Component { componentDidMount() { // console.log("加入金品课堂"); // console.log(this.props); + axios.interceptors.response.use((response) => { + if (response != undefined) + if (response && response.data.status === 410) { + try { + this.props.ModalshowCancelsy(); + }catch (e) { + + } + + } + return response; + }, (error) => { + + }); } - componentDidMount() { - // axios.interceptors.response.use((response) => { - // if (response != undefined) - // if (response && response.data.status === -1) { - // - // } - // return response; - // }, (error) => { - // //TODO 这里如果样式变了会出现css不加载的情况 - // - // }); - } + modalCancel=()=>{ this.props.ModalCancelsy(); }; From 353f3ce839f5e6ba28c077f566e11e7b2ab49035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 16:04:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B7=B3=E8=BD=AC?= =?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/modules/modals/Jointheclass.js | 4 ++++ .../src/modules/paths/PathDetail/DetailTop.js | 17 +++++++++-------- .../modules/paths/PathDetail/PathDetailIndex.js | 11 +++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/modals/Jointheclass.js b/public/react/src/modules/modals/Jointheclass.js index d7570efe5..40f62a6ac 100644 --- a/public/react/src/modules/modals/Jointheclass.js +++ b/public/react/src/modules/modals/Jointheclass.js @@ -19,6 +19,7 @@ class Jointheclass extends Component { }; setDownload=()=>{ + let cousestype=this.props.pathcousestypeid; let id=this.props.Pathcourseid===undefined?this.props.match.params.coursesId:this.props.Pathcourseid let url = `/courses/${id}/join_excellent_course.json`; axios.post(url).then((result) => { @@ -27,6 +28,9 @@ class Jointheclass extends Component { if(result.data.status === 0){ this.props.showNotification(result.data.message); this.props.ysljoinmodalCanceltwo(); + if(cousestype===1){ + window.open(`/courses/${id}/informs`) + } }else { this.props.showNotification(result.data.message); } diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 0256cfb33..11f56169b 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -34,7 +34,7 @@ class DetailTop extends Component{ if(this.props.courses!=undefined&&this.props.courses.length!=0){ this.props.courses.map((item,key)=>{ - if(1===key+1){ + if(this.props.pathtopskey===key+1){ return( courseslist.push(item) ) @@ -52,7 +52,7 @@ class DetailTop extends Component{ if(this.props.courses!=undefined&&this.props.courses.length!=0){ this.props.courses.map((item,key)=>{ - if(1===key+1){ + if(this.props.pathtopskey===key+1){ return( courseslist.push(item) ) @@ -205,7 +205,7 @@ class DetailTop extends Component{ }) } - JoinnowCourse=(id)=>{ + JoinnowCourse=(id,typeid)=>{ if(this.props.checkIfLogin()===false){ this.props.showLoginDialog() @@ -220,7 +220,8 @@ class DetailTop extends Component{ this.setState({ yslJointhe:true, - Pathcourseid:id + Pathcourseid:id, + pathcousestypeid:typeid }) } ysljoinmodalCancel=()=>{ @@ -228,11 +229,11 @@ class DetailTop extends Component{ yslJointhe:false }) }; - ysljoinmodalCanceltwo=()=>{ + ysljoinmodalCanceltwo=(key)=>{ this.setState({ yslJointhe:false }) - this.props.getdatasindex() + this.props.getdatasindex(key) }; OpenCoursefun=()=>{ @@ -282,7 +283,7 @@ class DetailTop extends Component{ loadtype={loadtype} > - {this.state.yslJointhe===true?this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}>:""} + {this.state.yslJointhe===true?this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}>:""} {this.state.OpenCourseTypes===true?this.OpenCourseCancel()}/>:""} { @@ -541,7 +542,7 @@ class DetailTop extends Component{ 进入课堂 :item.course_identity<6? 立即学习 - :this.JoinnowCourse(item.course_id)}>立即加入:""} + :this.JoinnowCourse(item.course_id,item.course_status.status)}>立即加入:""} {item.course_status.status===2? item.course_identity<6? diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 5d63d5cf8..8237b1abf 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -82,7 +82,8 @@ class PathDetailIndex extends Component{ user_id:undefined, loadtype:false, courses:undefined, - items: getItems(10) + items: getItems(10), + pathtopskey:1 } this.onDragEnd = this.onDragEnd.bind(this); @@ -148,7 +149,8 @@ class PathDetailIndex extends Component{ this.getdatasindex() } - getdatasindex=()=>{ + getdatasindex=(key)=>{ + let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ @@ -166,7 +168,8 @@ class PathDetailIndex extends Component{ if(result.data.allow_visit===true){ this.setState({ detailInfoList:result.data, - courses:result.data.courses + courses:result.data.courses, + pathtopskey:key===undefined?1:key, // items: getItems(result.data.members.length), }) } @@ -372,7 +375,7 @@ class PathDetailIndex extends Component{ >
- this.getdatasindex()}> + this.getdatasindex(key)}>