权限跳转调整

dev_hs
杨树明 6 years ago
parent b0941e9b2a
commit 353f3ce839

@ -19,6 +19,7 @@ class Jointheclass extends Component {
}; };
setDownload=()=>{ setDownload=()=>{
let cousestype=this.props.pathcousestypeid;
let id=this.props.Pathcourseid===undefined?this.props.match.params.coursesId:this.props.Pathcourseid let id=this.props.Pathcourseid===undefined?this.props.match.params.coursesId:this.props.Pathcourseid
let url = `/courses/${id}/join_excellent_course.json`; let url = `/courses/${id}/join_excellent_course.json`;
axios.post(url).then((result) => { axios.post(url).then((result) => {
@ -27,6 +28,9 @@ class Jointheclass extends Component {
if(result.data.status === 0){ if(result.data.status === 0){
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.props.ysljoinmodalCanceltwo(); this.props.ysljoinmodalCanceltwo();
if(cousestype===1){
window.open(`/courses/${id}/informs`)
}
}else { }else {
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
} }

@ -34,7 +34,7 @@ class DetailTop extends Component{
if(this.props.courses!=undefined&&this.props.courses.length!=0){ if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(1===key+1){ if(this.props.pathtopskey===key+1){
return( return(
courseslist.push(item) courseslist.push(item)
) )
@ -52,7 +52,7 @@ class DetailTop extends Component{
if(this.props.courses!=undefined&&this.props.courses.length!=0){ if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(1===key+1){ if(this.props.pathtopskey===key+1){
return( return(
courseslist.push(item) courseslist.push(item)
) )
@ -205,7 +205,7 @@ class DetailTop extends Component{
}) })
} }
JoinnowCourse=(id)=>{ JoinnowCourse=(id,typeid)=>{
if(this.props.checkIfLogin()===false){ if(this.props.checkIfLogin()===false){
this.props.showLoginDialog() this.props.showLoginDialog()
@ -220,7 +220,8 @@ class DetailTop extends Component{
this.setState({ this.setState({
yslJointhe:true, yslJointhe:true,
Pathcourseid:id Pathcourseid:id,
pathcousestypeid:typeid
}) })
} }
ysljoinmodalCancel=()=>{ ysljoinmodalCancel=()=>{
@ -228,11 +229,11 @@ class DetailTop extends Component{
yslJointhe:false yslJointhe:false
}) })
}; };
ysljoinmodalCanceltwo=()=>{ ysljoinmodalCanceltwo=(key)=>{
this.setState({ this.setState({
yslJointhe:false yslJointhe:false
}) })
this.props.getdatasindex() this.props.getdatasindex(key)
}; };
OpenCoursefun=()=>{ OpenCoursefun=()=>{
@ -282,7 +283,7 @@ class DetailTop extends Component{
loadtype={loadtype} loadtype={loadtype}
> >
</Modals> </Modals>
{this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>:""} {this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}></Jointheclass>:""}
{this.state.OpenCourseTypes===true?<OpenCourse {...this.props} {...this.state} OpenCourseCancel={()=>this.OpenCourseCancel()}/>:""} {this.state.OpenCourseTypes===true?<OpenCourse {...this.props} {...this.state} OpenCourseCancel={()=>this.OpenCourseCancel()}/>:""}
{ {
@ -541,7 +542,7 @@ class DetailTop extends Component{
进入课堂 进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> </a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习 立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""} </a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id,item.course_status.status)}></a>:""}
{item.course_status.status===2? {item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">

@ -82,7 +82,8 @@ class PathDetailIndex extends Component{
user_id:undefined, user_id:undefined,
loadtype:false, loadtype:false,
courses:undefined, courses:undefined,
items: getItems(10) items: getItems(10),
pathtopskey:1
} }
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
@ -148,7 +149,8 @@ class PathDetailIndex extends Component{
this.getdatasindex() this.getdatasindex()
} }
getdatasindex=()=>{ getdatasindex=(key)=>{
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json"; let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
@ -166,7 +168,8 @@ class PathDetailIndex extends Component{
if(result.data.allow_visit===true){ if(result.data.allow_visit===true){
this.setState({ this.setState({
detailInfoList:result.data, detailInfoList:result.data,
courses:result.data.courses courses:result.data.courses,
pathtopskey:key===undefined?1:key,
// items: getItems(result.data.members.length), // items: getItems(result.data.members.length),
}) })
} }
@ -372,7 +375,7 @@ class PathDetailIndex extends Component{
> >
</Modals> </Modals>
<div className="newMain clearfix"> <div className="newMain clearfix">
<DetailTop {...this.state} {...this.props} getdatasindex={()=>this.getdatasindex()}></DetailTop> <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop>
<div className="educontent clearfix mb80"> <div className="educontent clearfix mb80">
<div className="with65 fl"> <div className="with65 fl">
<div className="produce-content mb10"> <div className="produce-content mb10">

Loading…
Cancel
Save