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( -