|
|
@@ -595,7 +595,6 @@ export default {
|
|
|
teaIndex: 0,
|
|
|
nowTime: 0,
|
|
|
treeList: [],
|
|
|
- query: this.$route.query,
|
|
|
sectionExam: [],
|
|
|
sectionExamList: [],
|
|
|
dialogPalyVisible: false,
|
|
|
@@ -608,32 +607,22 @@ export default {
|
|
|
methods: {
|
|
|
async init() {
|
|
|
this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
+ await this.getAllSectionList();
|
|
|
this.treeList = await this.getDoubleTeacherList();
|
|
|
let sectionItem = await this.backNextItem(
|
|
|
this.treeList.find((e) => e.courseId == this.activeCourseId),
|
|
|
0,
|
|
|
false
|
|
|
);
|
|
|
- console.log(sectionItem, "sectionItem");
|
|
|
if (this.query.sectionType == 1 && !!this.query.rebuild == this.rebuild) {
|
|
|
this.toPlay(sectionItem);
|
|
|
}
|
|
|
- this.getAllSectionList();
|
|
|
},
|
|
|
activeFunc(courseId, index) {
|
|
|
let { courseId: nowCourseId, courseList } = this.treeList[index];
|
|
|
if (courseId == nowCourseId) {
|
|
|
return;
|
|
|
}
|
|
|
- // if (index) {
|
|
|
- // let { stuAllNum, secAllNum } = this.treeList[index - 1];
|
|
|
- // if (stuAllNum != secAllNum) {
|
|
|
- // return this.$message({
|
|
|
- // type: "warning",
|
|
|
- // message: "需按课程顺序学习",
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
let course = this.courseList.find((e) => e.courseId == courseId);
|
|
|
if (course) {
|
|
|
course.courseList = courseList;
|
|
|
@@ -675,6 +664,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
openModule(module, isFresh = false) {
|
|
|
+ console.log("openModule");
|
|
|
let { list, isRebuild, id, courseId, showList } = module;
|
|
|
if (!isFresh) {
|
|
|
module.showList = !showList;
|
|
|
@@ -746,14 +736,25 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getAllSectionList() {
|
|
|
- this.$request
|
|
|
+ return this.$request
|
|
|
.getAllSectionList({
|
|
|
gradeId: this.gradeId,
|
|
|
goodsId: this.goodsId,
|
|
|
rebuild: this.rebuild,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ let { skipPort } = this.query;
|
|
|
+ if (skipPort) {
|
|
|
+ let { moduleId, chapterId, sectionId } = res.data[0];
|
|
|
+ const query = JSON.parse(JSON.stringify(this.$route.query));
|
|
|
+ query.moduleId = moduleId;
|
|
|
+ query.chapterId = chapterId;
|
|
|
+ query.sectionId = sectionId;
|
|
|
+ query.skipPort = undefined;
|
|
|
+ this.$router.push({ path: this.$route.path, query });
|
|
|
+ }
|
|
|
this.allSectionList = res.data;
|
|
|
+ return Promise.resolve(res.data);
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
@@ -1128,11 +1129,18 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
+ query() {
|
|
|
+ return this.$route.query;
|
|
|
+ },
|
|
|
gradeId() {
|
|
|
return this.query.gradeId;
|
|
|
},
|
|
|
activeCourseId() {
|
|
|
- return this.query.courseId;
|
|
|
+ let courseId = this.query.courseId;
|
|
|
+ if (!courseId) {
|
|
|
+ courseId = this.treeList[0].courseId;
|
|
|
+ }
|
|
|
+ return courseId;
|
|
|
},
|
|
|
goodsId() {
|
|
|
return this.$route.params.goodsId;
|
|
|
@@ -1154,6 +1162,9 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
+ orderGoodsId() {
|
|
|
+ return this.query.orderGoodsId;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|