金课调整

dev_cs
杨树明 6 years ago
parent 774c5babf6
commit a030a500d0

@ -23,6 +23,15 @@ render() {
centered={true}
width="530px"
>
{this.props.modalsType===true?<style>
{
`
body{
overflow: hidden !important;
}
`
}
</style>:""}
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>

@ -495,7 +495,7 @@ class DetailCards extends Component{
:
<li className={showparagraph===false?"none":"fr status_li"}>
{
showparagraphkey===key&&showparagraphindex===index?<div>
showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:""

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

@ -85,6 +85,8 @@ class PathDetailIndex extends Component{
items: getItems(10),
pathtopskey:1,
dataquerys:{},
MenuItemsindex:1,
MenuItemsindextype:2
}
this.onDragEnd = this.onDragEnd.bind(this);
@ -147,7 +149,10 @@ class PathDetailIndex extends Component{
}
componentDidMount(){
this.getlistdatas()
}
getlistdatas=()=>{
const query = this.props.location.search;
// const type = query.split('?chinaoocTimestamp=');
// console.log("Eduinforms12345");
@ -254,7 +259,13 @@ class PathDetailIndex extends Component{
console.log(error);
})
};
getMenuItemsindex=(key,status)=>{
this.setState({
MenuItemsindex:key,
MenuItemsindextype:status
})
}
getdatasindex=(key)=>{
// yslwebobject 后端需要的接口
let pathid=this.props.match.params.pathId;
@ -460,9 +471,13 @@ class PathDetailIndex extends Component{
members,
tags,
courses,
MenuItemsindex,
MenuItemsindextype
} = this.state
// console.log(MenuItemsindex)
// console.log(MenuItemsindextype===2&&detailInfoList&&detailInfoList.allow_statistics===false)
return(
<div className="newContainer">
<style>
@ -487,7 +502,7 @@ class PathDetailIndex extends Component{
>
</Modals>
<div className="newMain clearfix">
<DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop>
<DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)} getMenuItemsindex={(key,status)=>this.getMenuItemsindex(key,status)} getlistdatas={()=>this.getlistdatas()}></DetailTop>
<div className="educontent clearfix mb80">
<div className="with65 fl">
<div className="produce-content mb10">

Loading…
Cancel
Save