From 9c6e389630591ec84cf1950b8b93857a06d31aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 20:05:26 +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 --- .../modules/paths/PathDetail/DetailTop.css | 14 ++- .../src/modules/paths/PathDetail/DetailTop.js | 103 ++++++++++-------- 2 files changed, 68 insertions(+), 49 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.css b/public/react/src/modules/paths/PathDetail/DetailTop.css index 70291c7da..40363f056 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.css +++ b/public/react/src/modules/paths/PathDetail/DetailTop.css @@ -66,4 +66,16 @@ text-overflow: ellipsis; white-space: nowrap; height: 40px; -} \ No newline at end of file +} + +.mb100{ + margin-bottom: 100px !important; +} +.task-btn-28BE6C{ + background: #28BE6C !important; + color: #fff!important; +} +.mt43{ + margin-top: 43px; +} + diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index eddf7f62a..43bb5e1dd 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -50,33 +50,41 @@ class DetailTop extends Component{ }) }else{ - this.props.courses.map((item,key)=>{ - if(listtype===false){ - keys=key+1 - if(item.course_status.status===0) { - listtype=true - return ( - courseslist.push(item) - ) - } - } - }) + let type=undefined; + this.props.courses.map((item,key)=>{ - if(listtype===false){ + let arr=[] keys=key+1 if(item.course_status.status===2) { + type=key+1 + arr.push(item) + } + courseslist=arr; + }) + + this.props.courses.map((item,key)=>{ + let arr=[] + if(listtype===false){ + keys=key+1 + if(item.course_status.status===0) { listtype=true - return ( - courseslist.push(item) - ) + // courseslist.push(item) + arr.push(item) + courseslist=arr } } }) + console.log(courseslist) + + } - this.props.getMenuItemsindex(keys,courseslist[0].course_status.status) + if(courseslist.length!=0){ + this.props.getMenuItemsindex(keys,courseslist[0].course_status.status) + } + } this.setState({ @@ -339,11 +347,11 @@ 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) + let coursestypes=this.props.courses!=undefined&&this.props.courses.length===0; + console.log(coursestypes) return( -
+
+
{/*27?detailInfoList.name:""}>*/} @@ -477,12 +485,10 @@ 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)=>{ + {this.state.courseslist.map((item,key)=>{ if(item.course_identity<4){ return( @@ -524,7 +530,7 @@ class DetailTop extends Component{ 第 {this.state.MenuItemskey} 次开课 -
  • + } -
  • + {this.props.courses===undefined||this.props.courses.length===0?"":
  • {this.state.courseslist.map((item,key)=>{ return(
    @@ -588,12 +594,10 @@ class DetailTop extends Component{ }) } -
  • - -
  • - + } + + {this.props.courses===undefined||this.props.courses.length===0?"":
  • + {/* height: 158px; @@ -654,8 +660,8 @@ class DetailTop extends Component{
    {/*{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===2&&item.course_identity<6?
    已结束
    :""} + {/*
    已结束
    */} {item.course_status.status===0? item.course_identity<5? 进入课堂 @@ -672,21 +678,22 @@ class DetailTop extends Component{ {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? + + {applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true? 当前预约报名人数:{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()}>期待开课并预约报名: - 预约报名成功} + getappointmenttype===true?预约报名成功:this.putappointment()}>期待开课并预约报名: + 预约报名成功} :""}
    }