|
@@ -12,6 +12,7 @@
|
|
|
<view v-for="(itemM, indexM) in list" :key="indexM">
|
|
|
<view v-if="itemM.type != 2">
|
|
|
<courseSection
|
|
|
+ ref="ChapterSection"
|
|
|
:isLive="isLive"
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="sectionMaxNum"
|
|
@@ -26,6 +27,9 @@
|
|
|
:gradeId="gradeId"
|
|
|
:menuItem="itemM"
|
|
|
:levelId="levelId + '-' + itemM.sectionId"
|
|
|
+ :testType="2"
|
|
|
+ :ChapterSectionExam='sectionExam'
|
|
|
+ @togoBack='togoBack()'
|
|
|
></courseSection>
|
|
|
<u-line v-if="indexM < list.length - 1"></u-line>
|
|
|
</view>
|
|
@@ -141,6 +145,7 @@ export default {
|
|
|
list: [],
|
|
|
examList: {},
|
|
|
canLearn: false, //是否全部视频看完才可以练习、测试
|
|
|
+ sectionExam: [],
|
|
|
};
|
|
|
},
|
|
|
onLoad() {},
|
|
@@ -158,6 +163,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["updateChapterOpen"]),
|
|
|
+ // 调用节的方法
|
|
|
+ togoBack(value) {
|
|
|
+ this.$refs.ChapterSection[0].ChapterExam()
|
|
|
+ },
|
|
|
goodsTodayStudySectionNum() {
|
|
|
return new Promise((resolve) => {
|
|
|
this.$api
|
|
@@ -173,7 +182,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
refreshList(isRebuild) {
|
|
|
- console.log(9999);
|
|
|
let moduleId = this.menuItem.moduleId ? this.menuItem.moduleId : 0;
|
|
|
if (this.isRebuild) {
|
|
|
this.getReSectionList(
|
|
@@ -191,7 +199,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$emit("playEnd", { isRebuild: isRebuild.isRebuild });
|
|
|
- console.log(10000);
|
|
|
// let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
|
|
|
// this.getBuySectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
|
|
|
},
|
|
@@ -269,14 +276,14 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.learningOrder, "this.learningOrder");
|
|
|
+ // console.log(this.learningOrder, "this.learningOrder");
|
|
|
if (this.learningOrder == 1) {
|
|
|
if (this.canLearn) {
|
|
|
let num = await this.bankRecordDoNum(item.typeId);
|
|
|
//有次数限制
|
|
|
if (item.answerNum - num > 0 && item.answerNum > 0) {
|
|
|
// this.$set(this.list[index],'doNum',(item.doNum+1))
|
|
|
- console.log(this.list[index]);
|
|
|
+ // console.log(this.list[index]);
|
|
|
uni.navigateTo({
|
|
|
url:
|
|
|
"/pages2/class/questionBank?courseId=" +
|
|
@@ -292,7 +299,9 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1"
|
|
|
+ ,
|
|
|
});
|
|
|
this.studyLog()
|
|
|
//没有答题次数限制
|
|
@@ -312,7 +321,8 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1",
|
|
|
});
|
|
|
this.studyLog()
|
|
|
} else {
|
|
@@ -354,7 +364,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(newRows);
|
|
|
+ // console.log(newRows);
|
|
|
let isAllLearn = newRows.every((item) => {
|
|
|
return item.studyStatus == 1;
|
|
|
});
|
|
@@ -368,7 +378,7 @@ export default {
|
|
|
//有次数限制
|
|
|
if (item.answerNum - num > 0 && item.answerNum > 0) {
|
|
|
// this.$set(this.list[index],'doNum',(item.doNum+1))
|
|
|
- console.log(this.list[index]);
|
|
|
+ // console.log(this.list[index]);
|
|
|
uni.navigateTo({
|
|
|
url:
|
|
|
"/pages2/class/questionBank?courseId=" +
|
|
@@ -384,7 +394,8 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1",
|
|
|
});
|
|
|
this.studyLog()
|
|
|
//没有答题次数限制
|
|
@@ -404,7 +415,8 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1",
|
|
|
});
|
|
|
this.studyLog()
|
|
|
} else {
|
|
@@ -426,7 +438,7 @@ export default {
|
|
|
//有次数限制
|
|
|
if (item.answerNum - item.doNum > 0 && item.answerNum > 0) {
|
|
|
// this.$set(this.list[index],'doNum',(item.doNum+1))
|
|
|
- console.log(this.list[index]);
|
|
|
+ // console.log(this.list[index]);
|
|
|
uni.navigateTo({
|
|
|
url:
|
|
|
"/pages2/class/questionBank?courseId=" +
|
|
@@ -442,7 +454,8 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1",
|
|
|
});
|
|
|
this.studyLog()
|
|
|
//没有答题次数限制
|
|
@@ -462,7 +475,8 @@ export default {
|
|
|
"&chapterId=" +
|
|
|
chapterId +
|
|
|
"&orderGoodsId=" +
|
|
|
- this.orderGoodsId,
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&types=1",
|
|
|
});
|
|
|
this.studyLog()
|
|
|
} else {
|
|
@@ -491,11 +505,22 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- openChapter(item) {
|
|
|
- console.log('---zhang',this.menuItem, this.down,this.list, item.id, item.courseId, item.moduleId);
|
|
|
+ async openChapter(item) {
|
|
|
+ // console.log('---zhang',this.menuItem, this.down,this.list, item.id, item.courseId, item.moduleId);
|
|
|
this.down = !this.down;
|
|
|
if (!this.down && this.list.length == 0) {
|
|
|
- console.log(item.id, 69);
|
|
|
+ // console.log(item.id, 69);
|
|
|
+ //获取章下面所有节试卷列表
|
|
|
+ await this.$api.reSectionExamList({
|
|
|
+ chapterId: item.chapterId || item.menuId,
|
|
|
+ courseId: item.courseId,
|
|
|
+ gradeId: item.gradeId
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.sectionExam = res.data.data || []
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
if (this.isBuy) {
|
|
|
let moduleId = item.moduleId ? item.moduleId : 0;
|
|
|
if (this.isRebuild) {
|
|
@@ -509,6 +534,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
getMenuExamList(chapterId, courseId, moduleId) {
|
|
|
let self = this;
|
|
|
this.$api
|
|
@@ -524,7 +550,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getSectionList(chapterId) {
|
|
|
- console.log('=============2', 'chapterId:', chapterId)
|
|
|
let self = this;
|
|
|
// url: '/app/common/course/sectionList/'+data,
|
|
|
this.$api.sectionList(chapterId).then((res) => {
|
|
@@ -541,11 +566,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
let newArr = res.data.data.filter((item) => {
|
|
|
- console.log(item);
|
|
|
return item.type != 2;
|
|
|
});
|
|
|
this.canLearn = newArr.every((item) => {
|
|
|
- console.log(item);
|
|
|
if (item.learning == 1) {
|
|
|
return true;
|
|
|
} else {
|
|
@@ -553,12 +576,12 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
self.list = res.data.data;
|
|
|
- console.log('=============2', self.list)
|
|
|
+ // console.log('=============2', self.list)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
getReSectionList(chapterId, courseId, moduleId) {
|
|
|
- console.log('=============3', 'chapterId:', chapterId, 'courseId:', courseId, 'moduleId:', moduleId)
|
|
|
+ // console.log('=============3', 'chapterId:', chapterId, 'courseId:', courseId, 'moduleId:', moduleId)
|
|
|
let self = this;
|
|
|
this.$api
|
|
|
.reSectionList({
|
|
@@ -581,11 +604,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let newArr = res.data.data.filter((item) => {
|
|
|
- console.log(item);
|
|
|
return item.type != 2;
|
|
|
});
|
|
|
this.canLearn = newArr.every((item) => {
|
|
|
- console.log(item);
|
|
|
if (item.learning == 1) {
|
|
|
return true;
|
|
|
} else {
|
|
@@ -593,12 +614,11 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
self.list = res.data.data;
|
|
|
- console.log('=============3', self.list)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
getBuySectionList(chapterId, courseId, moduleId) {
|
|
|
- console.log('=============1', 'chapterId:', chapterId, 'courseId:', courseId, 'moduleId:', moduleId)
|
|
|
+ // console.log('=============1', 'chapterId:', chapterId, 'courseId:', courseId, 'moduleId:', moduleId)
|
|
|
let self = this;
|
|
|
this.$api
|
|
|
.reSectionList({
|
|
@@ -623,7 +643,6 @@ export default {
|
|
|
return item.type != 2;
|
|
|
});
|
|
|
this.canLearn = newArr.every((item) => {
|
|
|
- console.log(item);
|
|
|
if (item.learning == 1) {
|
|
|
return true;
|
|
|
} else {
|
|
@@ -631,8 +650,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
self.list = res.data.data;
|
|
|
- console.log('=============1', self.list)
|
|
|
- this.$emit('sectionList', self.list)
|
|
|
}
|
|
|
});
|
|
|
},
|