|
|
|
@ -5,6 +5,7 @@ import SendPanel from "./sendPanel.js";
|
|
|
|
|
import { getImageUrl } from 'educoder';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import Modals from '../../modals/Modals';
|
|
|
|
|
import OpenCourse from './OpenCourse';
|
|
|
|
|
import Jointheclass from '../../modals/Jointheclass'
|
|
|
|
|
import './DetailTop.css';
|
|
|
|
|
|
|
|
|
@ -24,18 +25,21 @@ class DetailTop extends Component{
|
|
|
|
|
cardsModalsavetype:false,
|
|
|
|
|
MenuItemskey:1,
|
|
|
|
|
courseslist:[],
|
|
|
|
|
Pathcourseid:undefined
|
|
|
|
|
Pathcourseid:undefined,
|
|
|
|
|
OpenCourseTypes:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount(){
|
|
|
|
|
let courseslist=[]
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(1===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(this.props.courses!=undefined&&this.props.courses.length!=0){
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(1===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
courseslist:courseslist
|
|
|
|
|
})
|
|
|
|
@ -196,21 +200,28 @@ class DetailTop extends Component{
|
|
|
|
|
this.props.getdatasindex()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
OpenCoursefun=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
OpenCourseTypes:true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
OpenCourseCancel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
OpenCourseTypes:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let{detailInfoList}=this.props;
|
|
|
|
|
let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
|
|
|
|
|
let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
|
|
|
|
|
const radioStyle = {
|
|
|
|
|
display: 'block',
|
|
|
|
|
height: '30px',
|
|
|
|
|
lineHeight: '30px',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
|
|
|
|
|
|
|
|
|
|
let menu = (
|
|
|
|
|
<Menu>
|
|
|
|
|
{this.props.courses&&this.props.courses.map((item,key)=>{
|
|
|
|
|
{this.props.courses===undefined||this.props.courses.length===0?"":this.props.courses.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<Menu.Item>
|
|
|
|
|
<a rel="noopener noreferrer" onClick={()=>this.MenuItems(key+1)}>
|
|
|
|
@ -226,7 +237,7 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
<div className={this.props.courses===undefined?"subhead":"subhead mb70"}>
|
|
|
|
|
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
|
|
|
|
|
<Modals
|
|
|
|
|
modalsType={Modalstype}
|
|
|
|
|
modalsTopval={Modalstopval}
|
|
|
|
@ -236,11 +247,12 @@ class DetailTop extends Component{
|
|
|
|
|
loadtype={loadtype}
|
|
|
|
|
>
|
|
|
|
|
</Modals>
|
|
|
|
|
<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
|
|
|
|
|
{/*<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}>*/}
|
|
|
|
|
{this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>:""}
|
|
|
|
|
{this.state.OpenCourseTypes===true?<OpenCourse {...this.props} {...this.state} OpenCourseCancel={()=>this.OpenCourseCancel()}/>:""}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
detailInfoList &&
|
|
|
|
|
<div className={this.props.courses===undefined?"subhead_content":"subhead_content pt100"}>
|
|
|
|
|
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}>
|
|
|
|
|
<div className="font-28 color-white clearfix">
|
|
|
|
|
<span className="fl lineh-40">
|
|
|
|
|
{detailInfoList.name}
|
|
|
|
@ -326,7 +338,7 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<div className="fr pr">
|
|
|
|
|
<a className={"fl font-18 color-white mt5 kaike mr20"}>开课</a>
|
|
|
|
|
<a className={"fl font-18 color-white mt5 kaike mr20"} onClick={()=>this.OpenCoursefun()}>开课</a>
|
|
|
|
|
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike">
|
|
|
|
|
学习统计
|
|
|
|
|
</Link>
|
|
|
|
@ -334,8 +346,7 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/*{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">*/}
|
|
|
|
|
{this.props.courses===undefined?"":<div className="userNavs mt20">
|
|
|
|
|
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">
|
|
|
|
|
|
|
|
|
|
<li className={"fl"}>
|
|
|
|
|
<style>
|
|
|
|
@ -391,10 +402,6 @@ class DetailTop extends Component{
|
|
|
|
|
</style>
|
|
|
|
|
<li className={"ml20"}>
|
|
|
|
|
{this.state.courseslist.map((item,key)=>{
|
|
|
|
|
// course_id: 1309
|
|
|
|
|
// course_identity: 5
|
|
|
|
|
// course_status: {status: 1, time: "进行至第5周,共1642周"}
|
|
|
|
|
// first_category_url: "/courses/1309/informs"
|
|
|
|
|
return(
|
|
|
|
|
<div className={"ant-breadcrumb pdt28"} key={key}>
|
|
|
|
|
<span>
|
|
|
|
@ -467,7 +474,7 @@ class DetailTop extends Component{
|
|
|
|
|
:<a className="fr user_default_btn task-btn-orange font-18 mt28" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
|
|
|
|
|
|
|
|
|
|
{item.course_status.status===1?
|
|
|
|
|
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
|
|
|
|
|
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28" onClick={()=>this.JoinnowCourse(item.course_id)}>
|
|
|
|
|
进入课堂
|
|
|
|
|
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
|
|
|
|
|
立即学习
|
|
|
|
|