首页页面

This commit is contained in:
zhaofang
2022-09-25 18:50:47 +08:00
parent fb32fdf509
commit 14f7157caf
12 changed files with 730 additions and 421 deletions

View File

@@ -770,7 +770,8 @@ export default {
apiCoursePortal.detail(this.courseId,false).then(rs => {
if (rs.status == 200) {
//设置必须的字段
rs.result.sections.forEach(sec => {
if(rs.result.course.type == 20) {
rs.result.sections.forEach(sec => {
sec.status = 0; //加入状态表未开始
rs.result.contents.forEach(c => {
c.status = 0; //初始化状态 ,未开始
@@ -779,6 +780,7 @@ export default {
});
});
this.sectionList = rs.result.sections;
}
this.courseInfo = rs.result.course;
this.teachers = rs.result.teachers;
if (rs.result.teachers && rs.result.teachers.length > 0) {
@@ -836,24 +838,26 @@ export default {
}
});
});
//如果没有,就定位第一项内容
if (playIndex === -1) {
// this.showRes(this.contentList[0]);
this.showRes(this.catalogTree[0].children[0])
} else {
this.showRes(this.contentList[playIndex]);
}
if(this.courseInfo.type == 10) {
this.showRes(this.contentList[0]);
} else {
//如果没有,就定位第一项内容
if (playIndex === -1) {
// this.showRes(this.contentList[0]);
this.showRes(this.catalogTree[0].children[0])
} else {
this.showRes(this.contentList[playIndex]);
}
}
} else {
this.$message.error('您还未报名');
if (this.courseInfo.type == 10) {
location.href = this.webBaseUrl + '/course/micro?id=' + this.courseId;
} else {
// if (this.courseInfo.type == 10) {
// location.href = this.webBaseUrl + '/course/micro?id=' + this.courseId;
// } else {
location.href = this.webBaseUrl + '/course/detail?id=' + this.courseId;
}
// }
}
} else {
this.$message.error(res.message);