|
|
|
@ -26,7 +26,9 @@ class DetailTop extends Component{
|
|
|
|
|
MenuItemskey:1,
|
|
|
|
|
courseslist:[],
|
|
|
|
|
Pathcourseid:undefined,
|
|
|
|
|
OpenCourseTypes:false
|
|
|
|
|
OpenCourseTypes:false,
|
|
|
|
|
putappointmenttype:false,
|
|
|
|
|
getappointmenttype:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount(){
|
|
|
|
@ -74,7 +76,9 @@ class DetailTop extends Component{
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
courseslist:courseslist,
|
|
|
|
|
MenuItemskey:keys,
|
|
|
|
@ -156,7 +160,8 @@ class DetailTop extends Component{
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
Modalsbottomval:'',
|
|
|
|
|
loadtype:false,
|
|
|
|
|
deletepathtype:false
|
|
|
|
|
deletepathtype:false,
|
|
|
|
|
putappointmenttype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -219,6 +224,8 @@ class DetailTop extends Component{
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
|
|
|
|
|
this.setState({
|
|
|
|
|
MenuItemskey:keys,
|
|
|
|
|
courseslist:courseslist,
|
|
|
|
@ -245,6 +252,20 @@ class DetailTop extends Component{
|
|
|
|
|
pathcousestypeid:typeid
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
putappointment=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:"是否确认立即预约?",
|
|
|
|
|
Modalsbottomval:"",
|
|
|
|
|
cardsModalcancel:()=>this.cardsModalcancel(),
|
|
|
|
|
putappointmenttype:true,
|
|
|
|
|
loadtype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ysljoinmodalCancel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
yslJointhe:false
|
|
|
|
@ -267,9 +288,34 @@ class DetailTop extends Component{
|
|
|
|
|
OpenCourseTypes:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getappointment=()=>{
|
|
|
|
|
let pathid=this.props.match.params.pathId;
|
|
|
|
|
let url=`/paths/${pathid}/appointment.json`
|
|
|
|
|
axios.post(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
this.setState({
|
|
|
|
|
getappointmenttype:true
|
|
|
|
|
})
|
|
|
|
|
this.cardsModalcancel()
|
|
|
|
|
// this.props.getlistdatas()
|
|
|
|
|
this.props.showNotification(response.data.message)
|
|
|
|
|
}else{
|
|
|
|
|
this.props.showNotification(response.data.message)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
this.cardsModalcancel()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let{detailInfoList}=this.props;
|
|
|
|
|
let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
|
|
|
|
|
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
|
|
|
|
|
const radioStyle = {
|
|
|
|
|
display: 'block',
|
|
|
|
|
height: '30px',
|
|
|
|
@ -292,6 +338,9 @@ 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)
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
|
|
|
|
@ -300,7 +349,7 @@ class DetailTop extends Component{
|
|
|
|
|
modalsTopval={Modalstopval}
|
|
|
|
|
modalsBottomval={Modalsbottomval}
|
|
|
|
|
modalCancel={cardsModalcancel}
|
|
|
|
|
modalSave={cardsModalsavetype===true?this.reovkissuePaths:this.cardsModalsave}
|
|
|
|
|
modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
|
|
|
|
|
loadtype={loadtype}
|
|
|
|
|
>
|
|
|
|
|
</Modals>
|
|
|
|
@ -428,7 +477,7 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">
|
|
|
|
|
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
|
|
|
|
|
|
|
|
|
|
<li className={"fl pd4020"}>
|
|
|
|
|
<style>
|
|
|
|
@ -565,14 +614,45 @@ class DetailTop extends Component{
|
|
|
|
|
.courseslistsa{
|
|
|
|
|
color:#fff !important;
|
|
|
|
|
}
|
|
|
|
|
.pathbtensbox{
|
|
|
|
|
width: 188px !important;
|
|
|
|
|
height: 46px !important;
|
|
|
|
|
background: rgba(76,172,255,1);
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
line-height: 46px !important;
|
|
|
|
|
}
|
|
|
|
|
.lineHeight0{
|
|
|
|
|
line-height: 0px;
|
|
|
|
|
}
|
|
|
|
|
.font153{
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: rgba(153,153,153,1);
|
|
|
|
|
line-height: 14px;
|
|
|
|
|
margin-left: 30px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.absolutewidth{
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: -21px;
|
|
|
|
|
right: 71px;
|
|
|
|
|
}
|
|
|
|
|
.relativewidth{
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
{/*
|
|
|
|
|
height: 158px;
|
|
|
|
|
}*/}
|
|
|
|
|
{this.state.courseslist.map((item,key)=>{
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div key={key}>
|
|
|
|
|
{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}
|
|
|
|
|
{/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/}
|
|
|
|
|
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
|
|
|
|
|
{item.course_status.status===2&&item.course_identity<6?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
|
|
|
|
|
|
|
|
|
@ -599,6 +679,16 @@ class DetailTop extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""}
|
|
|
|
|
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<span className={"fl ml20 lineHeight0 relativewidth"}>
|
|
|
|
|
<span>当前预约报名人数:<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span>人</span>
|
|
|
|
|
<span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
|
|
|
|
|
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
|
|
|
|
|
getappointmenttype===true?<a className="fr user_default_btn background191 font-18 pathbtensbox absolutewidth">预约报名成功</a>:<a className="fr user_default_btn task-btn-orange font-18 pathbtensbox absolutewidth" onClick={()=>this.putappointment()}>期待开课并预约报名</a>:
|
|
|
|
|
<a className="fr user_default_btn background191 font-18 pathbtensbox absolutewidth">预约报名成功</a>}
|
|
|
|
|
</span>:""}
|
|
|
|
|
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|