|
@@ -987,135 +987,137 @@ export default {
|
|
getRecord(item) {
|
|
getRecord(item) {
|
|
this.$request.studyrecordgetUserStudyLast().then(async (res) => {
|
|
this.$request.studyrecordgetUserStudyLast().then(async (res) => {
|
|
// if (res.data && res.data.sectionId) {
|
|
// if (res.data && res.data.sectionId) {
|
|
- await this.getGoodsData(res);
|
|
|
|
- var stop = false;
|
|
|
|
- for (let y = 0; y < this.goodsTeacher.length; y++) {
|
|
|
|
- for (let i = 0; i < this.goodsTeacher[y].courseList.length; i++) {
|
|
|
|
- if (stop) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- this.goodsTeacher[y].courseList[i].courseId == res.data.courseId
|
|
|
|
|
|
+ await this.getGoodsData(res);
|
|
|
|
+ var stop = false;
|
|
|
|
+ for (let y = 0; y < this.goodsTeacher.length; y++) {
|
|
|
|
+ for (let i = 0; i < this.goodsTeacher[y].courseList.length; i++) {
|
|
|
|
+ if (stop) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].courseId == res.data.courseId
|
|
|
|
+ ) {
|
|
|
|
+ await this.changeStatus(this.goodsTeacher[y].courseList[i]);
|
|
|
|
+ for (
|
|
|
|
+ let k = 0;
|
|
|
|
+ k < this.goodsTeacher[y].courseList[i].children.length;
|
|
|
|
+ k++
|
|
) {
|
|
) {
|
|
- await this.changeStatus(this.goodsTeacher[y].courseList[i]);
|
|
|
|
- for (
|
|
|
|
- let k = 0;
|
|
|
|
- k < this.goodsTeacher[y].courseList[i].children.length;
|
|
|
|
- k++
|
|
|
|
- ) {
|
|
|
|
- if (res.data.moduleId) {
|
|
|
|
- console.log(1);
|
|
|
|
- if (
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
- res.data.moduleId
|
|
|
|
|
|
+ if (res.data.moduleId) {
|
|
|
|
+ console.log(1);
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
+ res.data.moduleId
|
|
|
|
+ ) {
|
|
|
|
+ await this.changeModuleStatus(
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
+ i,
|
|
|
|
+ k,
|
|
|
|
+ y
|
|
|
|
+ );
|
|
|
|
+ for (
|
|
|
|
+ let j = 0;
|
|
|
|
+ j <
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].children
|
|
|
|
+ .length;
|
|
|
|
+ j++
|
|
) {
|
|
) {
|
|
- await this.changeModuleStatus(
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
- i,
|
|
|
|
- k,
|
|
|
|
- y
|
|
|
|
- );
|
|
|
|
- for (
|
|
|
|
- let j = 0;
|
|
|
|
- j <
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k].children
|
|
|
|
- .length;
|
|
|
|
- j++
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].children[
|
|
|
|
+ j
|
|
|
|
+ ].chapterId == res.data.chapterId
|
|
) {
|
|
) {
|
|
- if (
|
|
|
|
|
|
+ await this.changeChapterStatus(
|
|
|
|
+ y,
|
|
|
|
+ 2,
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
- .children[j].chapterId == res.data.chapterId
|
|
|
|
- ) {
|
|
|
|
- await this.changeChapterStatus(
|
|
|
|
- y,
|
|
|
|
- 2,
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k]
|
|
|
|
- .children[j],
|
|
|
|
- i,
|
|
|
|
- k,
|
|
|
|
- j
|
|
|
|
- );
|
|
|
|
|
|
+ .children[j],
|
|
|
|
+ i,
|
|
|
|
+ k,
|
|
|
|
+ j
|
|
|
|
+ );
|
|
|
|
|
|
- for (
|
|
|
|
- let m = 0;
|
|
|
|
- m <
|
|
|
|
|
|
+ for (
|
|
|
|
+ let m = 0;
|
|
|
|
+ m <
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k]
|
|
|
|
+ .children[j].children.length;
|
|
|
|
+ m++
|
|
|
|
+ ) {
|
|
|
|
+ if (
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
- .children[j].children.length;
|
|
|
|
- m++
|
|
|
|
|
|
+ .children[j].children[m].sectionId ==
|
|
|
|
+ res.data.sectionId
|
|
) {
|
|
) {
|
|
- if (
|
|
|
|
|
|
+ this.$set(
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
- .children[j].children[m].sectionId ==
|
|
|
|
- res.data.sectionId
|
|
|
|
- ) {
|
|
|
|
- this.$set(
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k]
|
|
|
|
- .children[j].children[m],
|
|
|
|
- "recordStatus",
|
|
|
|
- true
|
|
|
|
- );
|
|
|
|
- stop = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ .children[j].children[m],
|
|
|
|
+ "recordStatus",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ stop = true;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if (res.data.chapterId) {
|
|
|
|
- console.log(2);
|
|
|
|
- if (
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
- res.data.chapterId
|
|
|
|
|
|
+ }
|
|
|
|
+ } else if (res.data.chapterId) {
|
|
|
|
+ console.log(2);
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
+ res.data.chapterId
|
|
|
|
+ ) {
|
|
|
|
+ await this.changeChapterStatus(
|
|
|
|
+ y,
|
|
|
|
+ 1,
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
+ i,
|
|
|
|
+ k
|
|
|
|
+ );
|
|
|
|
+ for (
|
|
|
|
+ let j = 0;
|
|
|
|
+ j <
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].children
|
|
|
|
+ .length;
|
|
|
|
+ j++
|
|
) {
|
|
) {
|
|
- await this.changeChapterStatus(
|
|
|
|
- y,
|
|
|
|
- 1,
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
- i,
|
|
|
|
- k
|
|
|
|
- );
|
|
|
|
- for (
|
|
|
|
- let j = 0;
|
|
|
|
- j <
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k].children
|
|
|
|
- .length;
|
|
|
|
- j++
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].children[
|
|
|
|
+ j
|
|
|
|
+ ].sectionId == res.data.sectionId
|
|
) {
|
|
) {
|
|
- if (
|
|
|
|
|
|
+ this.$set(
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
this.goodsTeacher[y].courseList[i].children[k]
|
|
- .children[j].sectionId == res.data.sectionId
|
|
|
|
- ) {
|
|
|
|
- this.$set(
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k]
|
|
|
|
- .children[j],
|
|
|
|
- "recordStatus",
|
|
|
|
- true
|
|
|
|
- );
|
|
|
|
- stop = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ .children[j],
|
|
|
|
+ "recordStatus",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ stop = true;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- console.log(3);
|
|
|
|
- if (
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
- res.data.sectionId
|
|
|
|
- ) {
|
|
|
|
- this.$set(
|
|
|
|
- this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
- "recordStatus",
|
|
|
|
- true
|
|
|
|
- );
|
|
|
|
- stop = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ console.log(3);
|
|
|
|
+ if (
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k].menuId ==
|
|
|
|
+ res.data.sectionId
|
|
|
|
+ ) {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.goodsTeacher[y].courseList[i].children[k],
|
|
|
|
+ "recordStatus",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ stop = true;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
// } else {
|
|
// } else {
|
|
// this.resultCourseGoodsList();
|
|
// this.resultCourseGoodsList();
|
|
// }
|
|
// }
|
|
@@ -1423,7 +1425,7 @@ export default {
|
|
},
|
|
},
|
|
async getResource(courseLists, section, type, flag) {
|
|
async getResource(courseLists, section, type, flag) {
|
|
//type:1章卷,2节卷,3模考卷,4习题
|
|
//type:1章卷,2节卷,3模考卷,4习题
|
|
-
|
|
|
|
|
|
+
|
|
if (!this.checkCanLearn()) {
|
|
if (!this.checkCanLearn()) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1478,6 +1480,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -1494,6 +1497,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -1568,6 +1572,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -1583,6 +1588,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -1621,6 +1627,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
@@ -1637,6 +1644,7 @@ export default {
|
|
moduleId: section.moduleId || 0,
|
|
moduleId: section.moduleId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
sectionId: section.sectionId || 0,
|
|
examId: section.typeId,
|
|
examId: section.typeId,
|
|
|
|
+ learning: section.learning,
|
|
type: type,
|
|
type: type,
|
|
chapterId: section.chapterId || 0,
|
|
chapterId: section.chapterId || 0,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|