|
@@ -225,6 +225,12 @@ export default {
|
|
|
default: () => {
|
|
|
return 0;
|
|
|
}
|
|
|
+ },
|
|
|
+ activeSection: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ } //当前节数据
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -232,7 +238,6 @@ export default {
|
|
|
courseList: [], //商品的课程列表
|
|
|
courseDataList: [], //课程内容
|
|
|
allSectionList: [], //商品下所有节和试卷
|
|
|
- activeSection: {}, //当前节数据
|
|
|
nowTime: 0 //当前时间
|
|
|
};
|
|
|
},
|
|
@@ -425,13 +430,20 @@ export default {
|
|
|
this.init();
|
|
|
this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.$bus.$on("BackVideoFunc", () => {
|
|
|
+ this.BackVideoFunc(); //已学完,重新定位
|
|
|
+ });
|
|
|
+ },
|
|
|
methods: {
|
|
|
async init() {
|
|
|
await this.getGoodsCourseList(); //获取商品课程列表
|
|
|
await this.getCourseData(this.courseList[0].courseId); //获取课程内容
|
|
|
await this.getAllSectionList(); //获取所有节列表
|
|
|
/**播放逻辑 */
|
|
|
- this.playBackLogic();
|
|
|
+ if (!(this.rebuild > 0)) {
|
|
|
+ this.playBackLogic();
|
|
|
+ }
|
|
|
},
|
|
|
//获取商品课程列表
|
|
|
getGoodsCourseList() {
|
|
@@ -507,8 +519,8 @@ export default {
|
|
|
moduleId: item.moduleId,
|
|
|
gradeId: this.goodsData.gradeId,
|
|
|
courseId: this.courseDataList[0].courseId,
|
|
|
- orderGoodsId: this.goodsData.orderGoodsId
|
|
|
- // rebuild: isRebuild ? 1 : undefined
|
|
|
+ orderGoodsId: this.goodsData.orderGoodsId,
|
|
|
+ rebuild: this.rebuild
|
|
|
})
|
|
|
.then(res => {
|
|
|
this.$set(item, "showStatus", true);
|
|
@@ -564,7 +576,7 @@ export default {
|
|
|
chapterId: item.chapterId,
|
|
|
gradeId: this.goodsData.gradeId,
|
|
|
courseId: item.courseId,
|
|
|
- // rebuild: isRebuild ? 1 : undefined,
|
|
|
+ rebuild: this.rebuild,
|
|
|
moduleId: item.moduleId,
|
|
|
orderGoodsId: this.goodsData.orderGoodsId
|
|
|
})
|
|
@@ -613,8 +625,8 @@ export default {
|
|
|
gradeId: this.goodsData.gradeId,
|
|
|
goodsId: this.goodsData.goodsId,
|
|
|
courseId: this.courseList[0].courseId,
|
|
|
- orderGoodsId: this.goodsData.orderGoodsId
|
|
|
- // rebuild: this.rebuild
|
|
|
+ orderGoodsId: this.goodsData.orderGoodsId,
|
|
|
+ rebuild: this.rebuild
|
|
|
})
|
|
|
.then(res => {
|
|
|
let ary = res.data.map(i => {
|
|
@@ -651,7 +663,7 @@ export default {
|
|
|
await this.openChapter(item); //展开章
|
|
|
} else {
|
|
|
try {
|
|
|
- await this.waitCheckStatus(item); //检查是否可以继续执行
|
|
|
+ // await this.waitCheckStatus(item); //检查是否可以继续执行
|
|
|
if (item.type == 3) {
|
|
|
if (item.sectionType == 1) {
|
|
|
this.watchSection(item);
|
|
@@ -682,12 +694,7 @@ export default {
|
|
|
});
|
|
|
return reject();
|
|
|
}
|
|
|
- if (
|
|
|
- item.type == -1 &&
|
|
|
- item.doType != 1 &&
|
|
|
- item.learning == 1 &&
|
|
|
- !(item.rebuild > 0)
|
|
|
- ) {
|
|
|
+ if (item.type == -1 && item.doType != 1 && item.learning == 1) {
|
|
|
this.$message.warning("考试已通过,请勿重复考试");
|
|
|
return reject();
|
|
|
}
|
|
@@ -712,8 +719,7 @@ export default {
|
|
|
watchSection(item) {
|
|
|
if (this.isActive(item)) return;
|
|
|
this.$bus.$emit("toPlay", item);
|
|
|
- this.$emit("backActiveSection", item);
|
|
|
- this.activeSection = item;
|
|
|
+ this.$emit("update:activeSection", item);
|
|
|
let query = {
|
|
|
gradeId: this.goodsData.gradeId,
|
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -953,7 +959,65 @@ export default {
|
|
|
var ary = this.courseDataList.find(i => i.chapterId == item.chapterId);
|
|
|
await this.openChapter(ary);
|
|
|
}
|
|
|
+ },
|
|
|
+ //已学完,重新定位
|
|
|
+ BackVideoFunc() {
|
|
|
+ if (this.businessData.goodsLearningOrder == 2) {
|
|
|
+ let ary = this.allSectionList.find(i => i.studyStatus != 1);
|
|
|
+ if (ary) {
|
|
|
+ if (ary.type != 3) {
|
|
|
+ this.$confirm(
|
|
|
+ "本章视频已学习完成,继续进行下一个考试?",
|
|
|
+ "温馨提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ // this.openMenu(ary);
|
|
|
+ // this.unfoldFunc(ary);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ this.$confirm("当前视频已学完,继续学习下一个视频?", "温馨提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // this.openMenu(ary);
|
|
|
+ // this.unfoldFunc(ary);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$alert(
|
|
|
+ "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
|
|
|
+ "温馨提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ showClose: false,
|
|
|
+ callback: action => {
|
|
|
+ if (action == "confirm") {
|
|
|
+ this.jumpPage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //回到个人中心
|
|
|
+ jumpPage() {
|
|
|
+ this.$router.replace({
|
|
|
+ path: "person-center/my-course"
|
|
|
+ });
|
|
|
}
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ this.$bus.$off("BackVideoFunc");
|
|
|
}
|
|
|
};
|
|
|
</script>
|