权限跳转调整

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

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

@ -34,7 +34,7 @@ class DetailTop extends Component{
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(1===key+1){
if(this.props.pathtopskey===key+1){
return(
courseslist.push(item)
)
@ -52,7 +52,7 @@ class DetailTop extends Component{
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(1===key+1){
if(this.props.pathtopskey===key+1){
return(
courseslist.push(item)
)
@ -205,7 +205,7 @@ class DetailTop extends Component{
})
}
JoinnowCourse=(id)=>{
JoinnowCourse=(id,typeid)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
@ -220,7 +220,8 @@ class DetailTop extends Component{
this.setState({
yslJointhe:true,
Pathcourseid:id
Pathcourseid:id,
pathcousestypeid:typeid
})
}
ysljoinmodalCancel=()=>{
@ -228,11 +229,11 @@ class DetailTop extends Component{
yslJointhe:false
})
};
ysljoinmodalCanceltwo=()=>{
ysljoinmodalCanceltwo=(key)=>{
this.setState({
yslJointhe:false
})
this.props.getdatasindex()
this.props.getdatasindex(key)
};
OpenCoursefun=()=>{
@ -282,7 +283,7 @@ class DetailTop extends Component{
loadtype={loadtype}
>
</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()}/>:""}
{
@ -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>:<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_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,
loadtype:false,
courses:undefined,
items: getItems(10)
items: getItems(10),
pathtopskey:1
}
this.onDragEnd = this.onDragEnd.bind(this);
@ -148,7 +149,8 @@ class PathDetailIndex extends Component{
this.getdatasindex()
}
getdatasindex=()=>{
getdatasindex=(key)=>{
let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{
@ -166,7 +168,8 @@ class PathDetailIndex extends Component{
if(result.data.allow_visit===true){
this.setState({
detailInfoList:result.data,
courses:result.data.courses
courses:result.data.courses,
pathtopskey:key===undefined?1:key,
// items: getItems(result.data.members.length),
})
}
@ -372,7 +375,7 @@ class PathDetailIndex extends Component{
>
</Modals>
<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="with65 fl">
<div className="produce-content mb10">

Loading…
Cancel
Save