Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
jingquan huang 6 years ago
commit 52c353e07d

@ -275,6 +275,11 @@ class App extends Component {
}) })
window.location.href = "/"; window.location.href = "/";
}; };
ModalshowCancelsy=()=>{
this.setState({
mydisplay:true,
})
};
componentDidMount() { componentDidMount() {
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
@ -327,7 +332,7 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/> <Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/>
<AccountProfile {...this.props} {...this.state} /> <AccountProfile {...this.props} {...this.state} />
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/> <Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy} ModalshowCancelsy={this.ModalshowCancelsy}/>
<Router> <Router>
<Switch> <Switch>

@ -581,8 +581,8 @@ class CoursesBanner extends Component {
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a> onClick={() => this.tojoinclass(1)}>加入课堂</a>
: :
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}} <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.myyslgradin()}>加入课堂</a> onClick={() => this.myyslgradin(1)}>加入课堂</a>
) )
: ""} : ""}
@ -591,8 +591,8 @@ class CoursesBanner extends Component {
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a> onClick={() => this.tojoinclass(1)}>加入课堂</a>
: :
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}} <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.myyslgradin()}>加入课堂</a> onClick={() => this.myyslgradin(1)}>加入课堂</a>
: ""} : ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true? {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?

@ -442,7 +442,8 @@ class Goldsubject extends Component {
var subjectids=this.props.match.params.subjectid; var subjectids=this.props.match.params.subjectid;
window.location.href=`/paths/${subjectids}` window.location.href=`/paths/${subjectids}`
}else{ }else{
this.props.history.goBack(); // this.props.history.goBack();
window.location.href=`/courses/${this.props.match.params.coursesId}/informs`
} }
} }

@ -18,20 +18,23 @@ class Certifiedprofessional extends Component {
componentDidMount() { componentDidMount() {
// console.log("加入金品课堂"); // console.log("加入金品课堂");
// console.log(this.props); // console.log(this.props);
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 410) {
try {
this.props.ModalshowCancelsy();
}catch (e) {
}
}
return response;
}, (error) => {
});
} }
componentDidMount() {
// axios.interceptors.response.use((response) => {
// if (response != undefined)
// if (response && response.data.status === -1) {
//
// }
// return response;
// }, (error) => {
// //TODO 这里如果样式变了会出现css不加载的情况
//
// });
}
modalCancel=()=>{ modalCancel=()=>{
this.props.ModalCancelsy(); this.props.ModalCancelsy();
}; };

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