From 91d4803a848b8123c91c62ed84d82681c77e5883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 19 Aug 2019 15:25:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 6 +-- .../courses/coursesDetail/CoursesBanner.js | 4 +- .../src/modules/courses/new/Goldsubject.js | 2 +- .../react/src/modules/modals/Jointheclass.js | 17 +++--- .../modules/paths/PathDetail/DetailTop.css | 10 ++++ .../src/modules/paths/PathDetail/DetailTop.js | 50 ++++++++++++------ .../paths/PathDetail/PathDetailIndex.js | 52 ++++++++++--------- public/react/src/modules/tpm/SiderBar.js | 9 ++++ 8 files changed, 94 insertions(+), 56 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 1409e8468..1d03004ab 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -72,7 +72,7 @@ const WrappedCoursesNewApp= Loadable({ loader: () => import('./new/CoursesNew'), loading: Loading, }) -//新建金品课堂 +//新建精品课堂 const WrappedCoursesNewAppGoldclass= Loadable({ loader: () => import('./new/Goldsubject'), loading: Loading, @@ -825,7 +825,7 @@ class CoursesIndex extends Component{ (props) => () } > - {/*新建金品课堂*/} + {/*新建精品课堂*/} {/*coursesId 课堂id */} {/*id 是否是私有或者公有*/} () } > - {/*修改金品课堂*/} + {/*修改精品课堂*/} () diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 6accc0bb1..4a3db9694 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -46,7 +46,7 @@ class CoursesBanner extends Component { antIcon:false, coursedata:undefined, is_guide:false, - excellent:false,//是否是金品课堂 + excellent:false,//是否是精品课堂 yslJointhe:false, } } @@ -111,7 +111,7 @@ class CoursesBanner extends Component { }; - //金品课堂的弹框 + //精品课堂的弹框 myyslgradin=()=>{ this.setState({ yslJointhe:true diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index c61d045bd..a34ee9900 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -99,7 +99,7 @@ class Goldsubject extends Component { }; componentDidMount() { - console.log("新建金品课堂的数据"); + console.log("新建精品课堂的数据"); console.log(this.props); let coursesId = this.props.match.params.coursesId; diff --git a/public/react/src/modules/modals/Jointheclass.js b/public/react/src/modules/modals/Jointheclass.js index f61b1cbbe..3d1eeb384 100644 --- a/public/react/src/modules/modals/Jointheclass.js +++ b/public/react/src/modules/modals/Jointheclass.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Modal} from 'antd'; import axios from 'axios'; -//加入金品课堂 +//加入精品课堂 class Jointheclass extends Component { constructor(props) { @@ -9,7 +9,7 @@ class Jointheclass extends Component { } componentDidMount() { - // console.log("加入金品课堂"); + // console.log("加入精品课堂"); // console.log(this.props); } @@ -19,9 +19,8 @@ class Jointheclass extends Component { }; setDownload=()=>{ - var id=this.props.match.params.coursesId - - var url = `/courses/${id}/join_excellent_course.json`; + 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) => { if(result){ if(result.data){ @@ -42,8 +41,8 @@ class Jointheclass extends Component { render() { - // console.log("加入金品课堂2"); - // console.log(this.props); + // console.log("加入精品课堂2"); + //console.log(this.props.Pathcourseid); return(
-

是否确认该加入课堂?

-
+

是否确认该加入课堂?

+ diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.css b/public/react/src/modules/paths/PathDetail/DetailTop.css index 17ff8507f..17fdf3996 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.css +++ b/public/react/src/modules/paths/PathDetail/DetailTop.css @@ -43,4 +43,14 @@ .solidright{ border-right: 1px solid #000; height: 42px; +} +.ant-modal-title { + height: 38px; + line-height:38px !important; +} +.ant-modal-title { + font-size: 16px; + font-weight: 700!important; + color: #333; + text-align: center; } \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 902a6d8bf..6270ffb06 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -5,6 +5,7 @@ import SendPanel from "./sendPanel.js"; import { getImageUrl } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; +import Jointheclass from '../../modals/Jointheclass' import './DetailTop.css'; const Search = Input.Search; @@ -22,7 +23,8 @@ class DetailTop extends Component{ deletepathtype:false, cardsModalsavetype:false, MenuItemskey:1, - courseslist:[] + courseslist:[], + Pathcourseid:undefined } } componentDidMount(){ @@ -37,7 +39,6 @@ class DetailTop extends Component{ this.setState({ courseslist:courseslist }) - console.log(courseslist) } allow_deletepath=()=>{ this.setState({ @@ -171,15 +172,31 @@ class DetailTop extends Component{ ) } }) - - console.log(courseslist) - this.setState({ MenuItemskey:keys, courseslist:courseslist }) } - render(){ + + JoinnowCourse=(id)=>{ + this.setState({ + yslJointhe:true, + Pathcourseid:id + }) + } + ysljoinmodalCancel=()=>{ + this.setState({ + yslJointhe:false + }) + }; + ysljoinmodalCanceltwo=()=>{ + this.setState({ + yslJointhe:false + }) + this.props.getdatasindex() + }; + + render(){ let{detailInfoList}=this.props; let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; const radioStyle = { @@ -219,6 +236,7 @@ class DetailTop extends Component{ loadtype={loadtype} > + this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}> {/*
*/} { detailInfoList && @@ -442,27 +460,25 @@ class DetailTop extends Component{ detailInfoList.is_creator===true?已结束:item.course_identity<6? 已结束:"":""} - {item.course_status.status===0? - detailInfoList.is_creator===true? + detailInfoList.is_creator===true? 进入课堂 - :item.course_identity<6?
报名成功
- :立即报名:""} - + :item.course_identity<6?
报名成功
+ :this.JoinnowCourse(item.course_id)}>立即报名:""} {item.course_status.status===1? - detailInfoList.is_creator===true? + detailInfoList.is_creator===true? 进入课堂 - :item.course_identity<6? + :item.course_identity<6? 立即学习 - :立即加入:""} + :this.JoinnowCourse(item.course_id)}>立即加入:""} {item.course_status.status===2? - detailInfoList.is_creator===true? + detailInfoList.is_creator===true? 进入课堂 - :item.course_identity<6? + :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 43128e446..0ee4a3904 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -170,31 +170,35 @@ class PathDetailIndex extends Component{ } componentDidMount(){ - let pathid=this.props.match.params.pathId; - let url="/paths/"+pathid+".json"; - axios.get(url).then((result)=>{ - if (result.data.status === 407 || result.data.status === 401) { - debugger - return; - } + this.getdatasindex() + } - if (result.data.status === 403) { - debugger - // window.location.href = "/403"; - return; - } + getdatasindex=()=>{ + let pathid=this.props.match.params.pathId; + let url="/paths/"+pathid+".json"; + axios.get(url).then((result)=>{ + if (result.data.status === 407 || result.data.status === 401) { + debugger + return; + } - if(result.data.allow_visit===true){ - this.setState({ - detailInfoList:result.data, - // courses:result.data.courses - // items: getItems(result.data.members.length), - }) - } + if (result.data.status === 403) { + debugger + // window.location.href = "/403"; + return; + } - }).catch((error)=>{ - console.log(error); - }) + if(result.data.allow_visit===true){ + this.setState({ + detailInfoList:result.data, + // courses:result.data.courses + // items: getItems(result.data.members.length), + }) + } + + }).catch((error)=>{ + console.log(error); + }) let righturl="/paths/"+pathid+"/right_banner.json"; @@ -221,7 +225,7 @@ class PathDetailIndex extends Component{ }).catch((error)=>{ console.log(error); }) - } + } updatadetailInfoList=()=>{ let pathid=this.props.match.params.pathId; @@ -416,7 +420,7 @@ class PathDetailIndex extends Component{ >
- + this.getdatasindex()}>
diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index 39d9df55b..11369024d 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -106,6 +106,15 @@ class SiderBar extends Component {

+

微信扫一扫

关注公众号