|
|
@@ -1317,7 +1317,7 @@ export default {
|
|
|
learningStatus,
|
|
|
learningTimeStart,
|
|
|
} = this.goodsData;
|
|
|
- console.log(interfaceAccountId,learnStatus,"xzx")
|
|
|
+ console.log(interfaceAccountId, learnStatus, "xzx");
|
|
|
if (interfaceAccountId > 0) {
|
|
|
learnStatus == 1
|
|
|
? this.rebuildSubmit(this.goodsData, section)
|
|
|
@@ -1355,7 +1355,10 @@ export default {
|
|
|
if (!this.checkCanLearn(items)) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (!(await this.orderTopTobottom(courseItem, items, 99))) {
|
|
|
+ if (
|
|
|
+ !(await this.orderTopTobottom(courseItem, items, 99)) &&
|
|
|
+ items.sectionType != 2
|
|
|
+ ) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请按顺序学习视频课程",
|
|
|
@@ -1438,6 +1441,7 @@ export default {
|
|
|
if (res.rows.length) {
|
|
|
// this.$emit("backData", item);
|
|
|
// this.dialogVisible = false;
|
|
|
+ console.log("可以学习");
|
|
|
this.comeStyle(courseItem, items);
|
|
|
// this.$router.push({
|
|
|
// path: `/my-course-detail/${item.goodsId}`,
|
|
|
@@ -1492,8 +1496,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async orderTopTobottom(courseLists, section, type) {
|
|
|
- let { rebuild, moduleId, chapterId } = section;
|
|
|
-
|
|
|
+ let { rebuild, moduleId, chapterId, parentId, menuId } = section;
|
|
|
if (this.goodsData.goodsLearningOrder != 2 || rebuild) {
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1511,13 +1514,34 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let list = await this.studyRecordMenuAllList(courseLists);
|
|
|
+ console.log(
|
|
|
+ "section:",
|
|
|
+ section,
|
|
|
+ "list:",
|
|
|
+ list,
|
|
|
+ "parentId:",
|
|
|
+ parentId,
|
|
|
+ "menuId:",
|
|
|
+ menuId
|
|
|
+ );
|
|
|
if (type == 99) {
|
|
|
- let index = list.findIndex(
|
|
|
- (e) =>
|
|
|
- e.moduleId == moduleId &&
|
|
|
- e.chapterId == chapterId &&
|
|
|
- e.id == section.sectionId
|
|
|
- );
|
|
|
+ if (parentId >= 0 && menuId >= 0) {
|
|
|
+ var index = list.findIndex((e) => {
|
|
|
+ return parentId
|
|
|
+ ? e.moduleId == moduleId &&
|
|
|
+ e.chapterId == chapterId &&
|
|
|
+ e.id == section.sectionId
|
|
|
+ : e.id == menuId;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var index = list.findIndex(
|
|
|
+ (e) =>
|
|
|
+ e.moduleId == moduleId &&
|
|
|
+ e.chapterId == chapterId &&
|
|
|
+ e.id == section.sectionId
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
list = list.slice(0, index);
|
|
|
} else if (type != 3) {
|
|
|
list = list.filter(
|