|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { Modal,Radio,Input,Tooltip } from "antd";
|
|
|
|
|
import { Modal,Radio,Input,Tooltip, Menu, Dropdown, Icon,Breadcrumb } from "antd";
|
|
|
|
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
|
|
|
|
import SendPanel from "./sendPanel.js";
|
|
|
|
|
import { getImageUrl } from 'educoder';
|
|
|
|
@ -20,10 +20,25 @@ class DetailTop extends Component{
|
|
|
|
|
Modalsbottomval:'',
|
|
|
|
|
loadtype:false,
|
|
|
|
|
deletepathtype:false,
|
|
|
|
|
cardsModalsavetype:false
|
|
|
|
|
cardsModalsavetype:false,
|
|
|
|
|
MenuItemskey:1,
|
|
|
|
|
courseslist:[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount(){
|
|
|
|
|
let courseslist=[]
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(1===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
courseslist:courseslist
|
|
|
|
|
})
|
|
|
|
|
console.log(courseslist)
|
|
|
|
|
}
|
|
|
|
|
allow_deletepath=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
@ -141,6 +156,29 @@ class DetailTop extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVisibleChanges=(type)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
onVisibleChangestype:type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MenuItems=(keys)=>{
|
|
|
|
|
let courseslist=[]
|
|
|
|
|
this.props.courses.map((item,key)=>{
|
|
|
|
|
if(keys===key+1){
|
|
|
|
|
return(
|
|
|
|
|
courseslist.push(item)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log(courseslist)
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
MenuItemskey:keys,
|
|
|
|
|
courseslist:courseslist
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let{detailInfoList}=this.props;
|
|
|
|
|
let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
|
|
|
|
@ -150,9 +188,26 @@ class DetailTop extends Component{
|
|
|
|
|
lineHeight: '30px',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
console.log(this.props)
|
|
|
|
|
|
|
|
|
|
// <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
let menu = (
|
|
|
|
|
<Menu>
|
|
|
|
|
{this.props.courses&&this.props.courses.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<Menu.Item>
|
|
|
|
|
<a rel="noopener noreferrer" onClick={()=>this.MenuItems(key+1)}>
|
|
|
|
|
第{key+1}次开课
|
|
|
|
|
</a>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
<div className={this.props.courses===undefined?"subhead":"subhead mb70"}>
|
|
|
|
|
<Modals
|
|
|
|
@ -236,51 +291,184 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
|
|
|
|
|
<a className="user_default_btn user_bluebg_btn font-18 fl ml40 userbluebgfont"
|
|
|
|
|
onClick={this.applyissuePath}
|
|
|
|
|
>申请发布</a>:""
|
|
|
|
|
<a className="user_default_btn user_bluebg_btn font-18 fl ml40 userbluebgfont" onClick={this.applyissuePath}>申请发布</a>:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true?
|
|
|
|
|
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40"
|
|
|
|
|
onClick={this.cancelissuePath}
|
|
|
|
|
>撤销申请</a>:""
|
|
|
|
|
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.cancelissuePath}>撤销申请</a>:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
|
|
|
|
|
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40"
|
|
|
|
|
onClick={this.reovkissuePath}
|
|
|
|
|
>撤销发布</a>:""
|
|
|
|
|
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.reovkissuePath}>撤销发布</a>:""
|
|
|
|
|
}
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<div className="fr pr">
|
|
|
|
|
|
|
|
|
|
<a className={"fl font-18 color-white mt5 kaike mr20"}
|
|
|
|
|
|
|
|
|
|
>开课</a>
|
|
|
|
|
|
|
|
|
|
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike"
|
|
|
|
|
>
|
|
|
|
|
<a className={"fl font-18 color-white mt5 kaike mr20"}>开课</a>
|
|
|
|
|
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike">
|
|
|
|
|
学习统计
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/*{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">*/}
|
|
|
|
|
{this.props.courses===undefined?"":<div className="userNavs mt20">
|
|
|
|
|
<li className="active"><a href="/users/innov/courses">翻转课堂</a></li>
|
|
|
|
|
<li className=""><a href="/users/innov/shixuns">开发社区</a></li>
|
|
|
|
|
<li className=""><a href="/users/innov/paths">实践课程</a></li>
|
|
|
|
|
<li className=""><a href="/users/innov/projects">项目</a></li>
|
|
|
|
|
<li className=""><a href="/users/innov/package">众包</a></li>
|
|
|
|
|
<li className=""><a href="/users/innov/videoes">视频</a></li>
|
|
|
|
|
|
|
|
|
|
<li className={"fl"}>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.anticon-down{
|
|
|
|
|
font-size:14px !important;
|
|
|
|
|
transform:none !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-dropdown-menu-item:hover, .ant-dropdown-menu-submenu-title:hover {
|
|
|
|
|
background-color: rgba(240,240,240,1);
|
|
|
|
|
}
|
|
|
|
|
.alist{
|
|
|
|
|
color:#000;
|
|
|
|
|
}
|
|
|
|
|
.alist:hover{
|
|
|
|
|
color:#000;
|
|
|
|
|
}
|
|
|
|
|
.aIcons{
|
|
|
|
|
color:#CDCDCD;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Dropdown
|
|
|
|
|
overlay={menu}
|
|
|
|
|
onVisibleChange={this.onVisibleChanges}
|
|
|
|
|
>
|
|
|
|
|
<a className={"alist"}>
|
|
|
|
|
<i className="iconfont icon-bianji1 newbianji1"></i>第<span className={"color-orange"}>{this.state.MenuItemskey}</span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
|
|
|
|
|
</a>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</li>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.pdt28{
|
|
|
|
|
padding-top: 28px;
|
|
|
|
|
}
|
|
|
|
|
.ml23{
|
|
|
|
|
margin-left:23px;
|
|
|
|
|
}
|
|
|
|
|
.pathtime{
|
|
|
|
|
color: #9B9B9B;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
.pathtimes{
|
|
|
|
|
color: #05101A;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</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>
|
|
|
|
|
<div className="ant-breadcrumb-link fl mr23">
|
|
|
|
|
<div className={"pathtime"}>
|
|
|
|
|
开课时间:
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"pathtimes"}>
|
|
|
|
|
{item.start_date}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="fl solidright"></div>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
<div className="ant-breadcrumb-link fl mr23 ml23">
|
|
|
|
|
<div className={"pathtime"}>
|
|
|
|
|
结课时间:
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"pathtimes"}>
|
|
|
|
|
{item.end_date}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="fl solidright"></div>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
<div className="ant-breadcrumb-link fl mr23 ml23">
|
|
|
|
|
<div className={"pathtime"}>
|
|
|
|
|
报名人数:
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"pathtimes"}>
|
|
|
|
|
{item.student_count}人
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
<li className={"fr"}>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.user-colorgrey-9b{color:#9B9B9B}
|
|
|
|
|
.user-colorgrey-green{color:#7ED321}
|
|
|
|
|
.background191{
|
|
|
|
|
background: rgba(191,191,191,1) !important;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
{this.state.courseslist.map((item,key)=>{
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div key={key}>
|
|
|
|
|
{item.course_status.status===0?<a className="mr30 shixun_detail pointer fl user-colorgrey-green">即将开课</a>:""}
|
|
|
|
|
{item.course_status.status===1?<a className="mr30 shixun_detail pointer fl color-orange">{item.course_status.time}</a>:""}
|
|
|
|
|
{item.course_status.status===2?
|
|
|
|
|
detailInfoList.is_creator===true?<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:item.course_identity<6?
|
|
|
|
|
<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:"":""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{item.course_status.status===0?
|
|
|
|
|
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
|
|
|
|
|
进入课堂
|
|
|
|
|
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt25">报名成功</div>
|
|
|
|
|
:<a className="fr user_default_btn task-btn-orange font-18 mt25" >立即报名</a>:""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{item.course_status.status===1?
|
|
|
|
|
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
|
|
|
|
|
进入课堂
|
|
|
|
|
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
|
|
|
|
|
立即学习
|
|
|
|
|
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt25" >立即加入</a>:""}
|
|
|
|
|
|
|
|
|
|
{item.course_status.status===2?
|
|
|
|
|
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
|
|
|
|
|
进入课堂
|
|
|
|
|
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
|
|
|
|
|
进入课堂
|
|
|
|
|
</a>:<div className="fr user_default_btn background191 font-18 mt25">已结束</div>:""}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
)})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|