diff --git a/public/react/src/modules/modals/Modals.js b/public/react/src/modules/modals/Modals.js index b67bc0ddc..552e34017 100644 --- a/public/react/src/modules/modals/Modals.js +++ b/public/react/src/modules/modals/Modals.js @@ -1,47 +1,56 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Spin, Icon , Modal} from 'antd'; -class Modals extends Component { - constructor(props) { - super(props); - this.state = { - funmodalsType:false, - istype:false - } - } -render() { - const antIcons = - return( - - -
-

{this.props.modalsTopval}

-

{this.props.modalsBottomval}

- {this.props.loadtype===true? -
- 知道啦 -
- : -
- 取消 - {this.props.okText || '确定'} -
- } -
-
-
- ) - } -} - +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Spin, Icon , Modal} from 'antd'; +class Modals extends Component { + constructor(props) { + super(props); + this.state = { + funmodalsType:false, + istype:false + } + } +render() { + const antIcons = + return( + + {this.props.modalsType===true?:""} + +
+

{this.props.modalsTopval}

+

{this.props.modalsBottomval}

+ {this.props.loadtype===true? +
+ 知道啦 +
+ : + + } +
+
+
+ ) + } +} + export default Modals; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 6c4fb9a09..2a0ad15ea 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -495,7 +495,7 @@ class DetailCards extends Component{ :
  • { - showparagraphkey===key&&showparagraphindex===index?
    + showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":
    查看详情 {line.shixun_status==="暂未公开"?"":this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战}
    :"" diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 9a460d696..eddf7f62a 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -26,7 +26,9 @@ class DetailTop extends Component{ MenuItemskey:1, courseslist:[], Pathcourseid:undefined, - OpenCourseTypes:false + OpenCourseTypes:false, + putappointmenttype:false, + getappointmenttype:false } } componentDidMount(){ @@ -74,7 +76,9 @@ class DetailTop extends Component{ }) } + this.props.getMenuItemsindex(keys,courseslist[0].course_status.status) } + this.setState({ courseslist:courseslist, MenuItemskey:keys, @@ -156,7 +160,8 @@ class DetailTop extends Component{ Modalstype:false, Modalsbottomval:'', loadtype:false, - deletepathtype:false + deletepathtype:false, + putappointmenttype:false }) } @@ -219,6 +224,8 @@ class DetailTop extends Component{ ) } }) + + this.props.getMenuItemsindex(keys,courseslist[0].course_status.status) this.setState({ MenuItemskey:keys, courseslist:courseslist, @@ -245,6 +252,20 @@ class DetailTop extends Component{ pathcousestypeid:typeid }) } + + putappointment=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"是否确认立即预约?", + Modalsbottomval:"", + cardsModalcancel:()=>this.cardsModalcancel(), + putappointmenttype:true, + loadtype:false + }) + } + + + ysljoinmodalCancel=()=>{ this.setState({ yslJointhe:false @@ -267,9 +288,34 @@ class DetailTop extends Component{ OpenCourseTypes:false }) } + + getappointment=()=>{ + let pathid=this.props.match.params.pathId; + let url=`/paths/${pathid}/appointment.json` + axios.post(url).then((response) => { + + if (response.status === 200) { + + if(response.data.status===0){ + this.setState({ + getappointmenttype:true + }) + this.cardsModalcancel() + // this.props.getlistdatas() + this.props.showNotification(response.data.message) + }else{ + this.props.showNotification(response.data.message) + } + + } + }).catch((error) => { + console.log(error) + this.cardsModalcancel() + }) + } render(){ let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; + let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state; const radioStyle = { display: 'block', height: '30px', @@ -292,6 +338,9 @@ class DetailTop extends Component{ + let applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false; + + // console.log(this.props.courses) return(
    @@ -300,7 +349,7 @@ class DetailTop extends Component{ modalsTopval={Modalstopval} modalsBottomval={Modalsbottomval} modalCancel={cardsModalcancel} - modalSave={cardsModalsavetype===true?this.reovkissuePaths:this.cardsModalsave} + modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()} loadtype={loadtype} > @@ -428,12 +477,12 @@ class DetailTop extends Component{
    - {this.props.courses===undefined||this.props.courses.length===0?"":
    + {this.props.courses===undefined||this.props.courses.length===0?"":
    -
  • - - - - {this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{ - if(item.course_identity<4){ - return( - - - - - - )}}) - } + } + - - - 第 {this.state.MenuItemskey} 次开课 - - -
  • - -
  • - {this.state.courseslist.map((item,key)=>{ - return( -
    + } + +
  • + {this.state.courseslist.map((item,key)=>{ + return( +
    @@ -512,7 +561,7 @@ class DetailTop extends Component{
    - +
    结课时间: @@ -524,7 +573,7 @@ class DetailTop extends Component{
    - +
    报名人数: @@ -534,17 +583,17 @@ class DetailTop extends Component{
    -
    - ) - }) - } +
    + ) + }) + } -
  • + -
  • - - {this.state.courseslist.map((item,key)=>{ + } + + + {/* + height: 158px; + }*/} + {this.state.courseslist.map((item,key)=>{ + + return( +
    + {/*{item.course_status.status===0?
    即将开课
    :""}*/} + {item.course_status.status===1?
    {item.course_status.time}
    :""} + {item.course_status.status===2&&item.course_identity<6?
    已结束
    :""} + + {item.course_status.status===0? + item.course_identity<5? + 进入课堂 + :item.course_identity<6?
    报名成功
    + :this.JoinnowCourse(item.course_id)}>立即报名:""} + + {item.course_status.status===1? + item.course_identity<5? + 进入课堂 + :item.course_identity<6? + 立即学习 + :this.JoinnowCourse(item.course_id,item.course_status.status)}>立即加入:""} + + {item.course_status.status===2? + item.course_identity<6? + 进入课堂 + :
    已结束
    :""} + +
    + )})} + + +
  • + + {applypath===false?"":this.state.MenuItemskey===this.props.courses.length?
    :""} + {applypath===false?"":this.state.MenuItemskey===this.props.courses.length? + 当前预约报名人数:{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count} + 当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课 + {this.props.detailInfoList&&this.props.detailInfoList.has_participate===false? + getappointmenttype===true?预约报名成功:this.putappointment()}>期待开课并预约报名: + 预约报名成功} + :""} - return( -
    - {item.course_status.status===0?
    即将开课
    :""} - {item.course_status.status===1?
    {item.course_status.time}
    :""} - {item.course_status.status===2&&item.course_identity<6?
    已结束
    :""} - - {item.course_status.status===0? - item.course_identity<5? - 进入课堂 - :item.course_identity<6?
    报名成功
    - :this.JoinnowCourse(item.course_id)}>立即报名:""} - - {item.course_status.status===1? - item.course_identity<5? - 进入课堂 - :item.course_identity<6? - 立即学习 - :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 883ed6875..7129b820f 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -85,6 +85,8 @@ class PathDetailIndex extends Component{ items: getItems(10), pathtopskey:1, dataquerys:{}, + MenuItemsindex:1, + MenuItemsindextype:2 } this.onDragEnd = this.onDragEnd.bind(this); @@ -147,7 +149,10 @@ class PathDetailIndex extends Component{ } componentDidMount(){ + this.getlistdatas() + } + getlistdatas=()=>{ const query = this.props.location.search; // const type = query.split('?chinaoocTimestamp='); // console.log("Eduinforms12345"); @@ -254,7 +259,13 @@ class PathDetailIndex extends Component{ console.log(error); }) }; + getMenuItemsindex=(key,status)=>{ + this.setState({ + MenuItemsindex:key, + MenuItemsindextype:status + }) + } getdatasindex=(key)=>{ // yslwebobject 后端需要的接口 let pathid=this.props.match.params.pathId; @@ -460,9 +471,13 @@ class PathDetailIndex extends Component{ members, tags, courses, + MenuItemsindex, + MenuItemsindextype } = this.state + // console.log(MenuItemsindex) + // console.log(MenuItemsindextype===2&&detailInfoList&&detailInfoList.allow_statistics===false) return(