+ showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":
:""
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index 9a460d696..eddf7f62a 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -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(
@@ -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}
>
@@ -428,12 +477,12 @@ class DetailTop extends Component{
- {this.props.courses===undefined||this.props.courses.length===0?"":
+ {this.props.courses===undefined||this.props.courses.length===0?"":
-
-
-
-
- {this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{
- if(item.course_identity<4){
- return(
-
-
-
-
-
- )}})
- }
+ }
+
-
-
- 第 {this.state.MenuItemskey} 次开课
-
-
-
-
-
- {this.state.courseslist.map((item,key)=>{
- return(
-
+ }
+
+
+ {this.state.courseslist.map((item,key)=>{
+ return(
+
@@ -512,7 +561,7 @@ class DetailTop extends Component{
-
+
结课时间:
@@ -524,7 +573,7 @@ class DetailTop extends Component{
-
+
报名人数:
@@ -534,17 +583,17 @@ class DetailTop extends Component{
-
- )
- })
- }
+
+ )
+ })
+ }
-
+
-
-
- {this.state.courseslist.map((item,key)=>{
+ }
+
+
+ {/*
+ height: 158px;
+ }*/}
+ {this.state.courseslist.map((item,key)=>{
+
+ return(
+
+ )})}
+
+
+
+
+ {applypath===false?"":this.state.MenuItemskey===this.props.courses.length?:""}
+ {applypath===false?"":this.state.MenuItemskey===this.props.courses.length?
+ 当前预约报名人数:{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}人
+ 当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课
+ {this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
+ getappointmenttype===true?预约报名成功:this.putappointment()}>期待开课并预约报名:
+ 预约报名成功}
+ :""}
- return(
-
- )})}
-
-
-
}
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index 883ed6875..7129b820f 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -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(