|
|
|
@ -30,38 +30,41 @@ class DetailTop extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount(){
|
|
|
|
|
let courseslist=[]
|
|
|
|
|
|
|
|
|
|
this.getdatalist();
|
|
|
|
|
}
|
|
|
|
|
getdatalist=()=>{
|
|
|
|
|
let courseslist=[];
|
|
|
|
|
let keys=1;
|
|
|
|
|
if(this.props.courses!=undefined&&this.props.courses.length!=0){
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(this.props.pathtopskey===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(this.props.detailInfoList.has_start===true){
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(item.course_status.status===1){
|
|
|
|
|
keys=key+1
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(this.props.pathtopskey===key+1){
|
|
|
|
|
keys=key+1
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
courseslist:courseslist
|
|
|
|
|
courseslist:courseslist,
|
|
|
|
|
MenuItemskey:keys,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate=(prevProps)=> {
|
|
|
|
|
if(prevProps.courses!=this.props.courses){
|
|
|
|
|
let courseslist=[]
|
|
|
|
|
|
|
|
|
|
if(this.props.courses!=undefined&&this.props.courses.length!=0){
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(this.props.pathtopskey===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
courseslist:courseslist
|
|
|
|
|
})
|
|
|
|
|
this.getdatalist();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|