|
@@ -20,7 +20,7 @@
|
|
|
<i
|
|
|
:class="{
|
|
|
'el-icon-caret-right': !courseItem.showList,
|
|
|
- 'el-icon-caret-bottom': courseItem.showList,
|
|
|
+ 'el-icon-caret-bottom': courseItem.showList
|
|
|
}"
|
|
|
></i>
|
|
|
{{ courseItem.courseName }}
|
|
@@ -35,13 +35,11 @@
|
|
|
<i
|
|
|
:class="{
|
|
|
'el-icon-caret-right': !menu.showList,
|
|
|
- 'el-icon-caret-bottom': menu.showList,
|
|
|
+ 'el-icon-caret-bottom': menu.showList
|
|
|
}"
|
|
|
></i>
|
|
|
<div class="MenuNames">
|
|
|
- {{
|
|
|
- menu.menuName
|
|
|
- }}
|
|
|
+ {{ menu.menuName }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item__content">
|
|
@@ -59,7 +57,7 @@
|
|
|
<i
|
|
|
:class="{
|
|
|
'el-icon-caret-right': !chapter.showList,
|
|
|
- 'el-icon-caret-bottom': chapter.showList,
|
|
|
+ 'el-icon-caret-bottom': chapter.showList
|
|
|
}"
|
|
|
></i
|
|
|
>{{ chapter.name }}
|
|
@@ -70,9 +68,10 @@
|
|
|
v-if="chapter.showList && chapter.type == 1"
|
|
|
>
|
|
|
<div
|
|
|
+ :id="'section-'+section.typeId"
|
|
|
class="bank-section__item"
|
|
|
:class="{
|
|
|
- active: isActive(section),
|
|
|
+ active: isActive(section)
|
|
|
}"
|
|
|
v-for="(section, sectionIndex) in chapter.list"
|
|
|
:key="sectionIndex"
|
|
@@ -106,8 +105,8 @@
|
|
|
section.liveStartTime,
|
|
|
(isDay = false)
|
|
|
)
|
|
|
- }}</span
|
|
|
- > -
|
|
|
+ }}</span>
|
|
|
+ -
|
|
|
<span>{{
|
|
|
$tools.timestampToTime(
|
|
|
section.liveEndTime,
|
|
@@ -154,7 +153,7 @@
|
|
|
class="live-btn live-btn--yellow"
|
|
|
v-if="
|
|
|
section.liveStartTime <= nowTime &&
|
|
|
- section.liveEndTime > nowTime
|
|
|
+ section.liveEndTime > nowTime
|
|
|
"
|
|
|
>
|
|
|
直播中
|
|
@@ -278,7 +277,7 @@
|
|
|
<i
|
|
|
:class="{
|
|
|
'el-icon-caret-right': !menu.showList,
|
|
|
- 'el-icon-caret-bottom': menu.showList,
|
|
|
+ 'el-icon-caret-bottom': menu.showList
|
|
|
}"
|
|
|
></i
|
|
|
>{{ menu.menuName }}
|
|
@@ -286,9 +285,10 @@
|
|
|
|
|
|
<div class="bank-section" v-if="menu.showList">
|
|
|
<div
|
|
|
+ :id="'section-'+menu.typeId"
|
|
|
class="bank-section__item"
|
|
|
:class="{
|
|
|
- active: isActive(section),
|
|
|
+ active: isActive(section)
|
|
|
}"
|
|
|
v-for="(section, sectionIndex) in menu.list"
|
|
|
:key="sectionIndex"
|
|
@@ -323,8 +323,8 @@
|
|
|
section.liveStartTime,
|
|
|
(isDay = false)
|
|
|
)
|
|
|
- }}</span
|
|
|
- > -
|
|
|
+ }}</span>
|
|
|
+ -
|
|
|
<span>{{
|
|
|
$tools.timestampToTime(
|
|
|
section.liveEndTime,
|
|
@@ -369,7 +369,7 @@
|
|
|
class="live-btn live-btn--yellow"
|
|
|
v-if="
|
|
|
section.liveStartTime <= nowTime &&
|
|
|
- section.liveEndTime > nowTime
|
|
|
+ section.liveEndTime > nowTime
|
|
|
"
|
|
|
>
|
|
|
直播中
|
|
@@ -450,9 +450,10 @@
|
|
|
<div class="item__content">
|
|
|
<div class="bank-section">
|
|
|
<div
|
|
|
+ :id="'section-'+menu.typeId"
|
|
|
class="bank-section__item"
|
|
|
:class="{
|
|
|
- active: isActive(menu),
|
|
|
+ active: isActive(menu)
|
|
|
}"
|
|
|
@click="getResource(menu, 1, courseIndex)"
|
|
|
>
|
|
@@ -475,8 +476,8 @@
|
|
|
menu.liveStartTime,
|
|
|
(isDay = false)
|
|
|
)
|
|
|
- }}</span
|
|
|
- > -
|
|
|
+ }}</span>
|
|
|
+ -
|
|
|
<span>{{
|
|
|
$tools.timestampToTime(
|
|
|
menu.liveEndTime,
|
|
@@ -513,7 +514,7 @@
|
|
|
class="live-btn live-btn--yellow"
|
|
|
v-if="
|
|
|
menu.liveStartTime <= nowTime &&
|
|
|
- menu.liveEndTime > nowTime
|
|
|
+ menu.liveEndTime > nowTime
|
|
|
"
|
|
|
>
|
|
|
直播中
|
|
@@ -551,7 +552,7 @@
|
|
|
:close-on-press-escape="false"
|
|
|
:show-close="false"
|
|
|
>
|
|
|
- <template v-if="!isLastVideo">
|
|
|
+ <template v-if="isLastVideo == 0">
|
|
|
<p>当前视频已学完,继续学习下一个视频?</p>
|
|
|
<div class="btn1">
|
|
|
<el-button type="info" plain round @click="dialogPalyVisible = false"
|
|
@@ -560,6 +561,19 @@
|
|
|
<el-button type="primary" @click="comfirm" round>确定</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template v-else-if="isLastVideo == 2">
|
|
|
+ <p>
|
|
|
+ 本章视频已学习完成,继续进行下一个考试?
|
|
|
+ </p>
|
|
|
+ <div class="btn2" style="display: flex;">
|
|
|
+ <el-button type="primary" round @click="dialogPalyVisible = false"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" round @click="gotoExamination"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template v-else>
|
|
|
<p>
|
|
|
当前是最后一个视频并已学习完,请检查所有章节的视频是否已学习完成。
|
|
@@ -581,24 +595,24 @@ export default {
|
|
|
type: Array,
|
|
|
default: () => {
|
|
|
return [];
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
goodsLearningOrder: {
|
|
|
- type: Number,
|
|
|
+ type: Number
|
|
|
},
|
|
|
sectionMaxNum: {
|
|
|
- type: Number,
|
|
|
+ type: Number
|
|
|
},
|
|
|
sectionItem: {
|
|
|
type: Object,
|
|
|
default: () => {
|
|
|
return {};
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
rebuild: {
|
|
|
type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -608,19 +622,42 @@ export default {
|
|
|
sectionExam: [],
|
|
|
sectionExamList: [],
|
|
|
dialogPalyVisible: false,
|
|
|
- allSectionList: [],
|
|
|
+ allSectionList: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
+ gotoExamination() {
|
|
|
+ let A = this.allSectionList.findIndex(
|
|
|
+ i =>
|
|
|
+ i.moduleId == this.sectionItem.moduleId &&
|
|
|
+ i.chapterId == this.sectionItem.chapterId &&
|
|
|
+ i.sectionId == this.sectionItem.sectionId
|
|
|
+ );
|
|
|
+ if(A !== -1){
|
|
|
+ var a = 'section-'+this.allSectionList[A+1].examId
|
|
|
+ const btn = document.getElementById(a)
|
|
|
+ btn.onclick = () => {
|
|
|
+ //
|
|
|
+ };
|
|
|
+ const event = new MouseEvent("click", {
|
|
|
+ view: window,
|
|
|
+ bubbles: true,
|
|
|
+ cancelable: true,
|
|
|
+ });
|
|
|
+ btn.dispatchEvent(event);
|
|
|
+ console.log(a)
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ },
|
|
|
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),
|
|
|
+ this.treeList.find(e => e.courseId == this.activeCourseId),
|
|
|
0,
|
|
|
false
|
|
|
);
|
|
@@ -636,7 +673,7 @@ export default {
|
|
|
if (courseId == nowCourseId) {
|
|
|
return;
|
|
|
}
|
|
|
- let course = this.courseList.find((e) => e.courseId == courseId);
|
|
|
+ let course = this.courseList.find(e => e.courseId == courseId);
|
|
|
if (course) {
|
|
|
course.courseList = courseList;
|
|
|
course.list = [];
|
|
@@ -655,14 +692,14 @@ export default {
|
|
|
.reSectionExamList({
|
|
|
chapterId: 0,
|
|
|
courseId,
|
|
|
- gradeId: this.gradeId,
|
|
|
+ gradeId: this.gradeId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
this.sectionExamList = res.data;
|
|
|
});
|
|
|
return this.$request
|
|
|
.reMenuList({ courseId, gradeId: this.gradeId })
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
for (let i = 0; i < res.rows.length; i++) {
|
|
|
let item = res.rows[i];
|
|
|
item.id = item.menuId;
|
|
@@ -688,9 +725,9 @@ export default {
|
|
|
moduleId: id,
|
|
|
gradeId: this.gradeId,
|
|
|
courseId: courseId,
|
|
|
- rebuild: isRebuild ? 1 : undefined,
|
|
|
+ rebuild: isRebuild ? 1 : undefined
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
let item = res.data[i];
|
|
|
item.id = item.chapterId;
|
|
@@ -712,7 +749,7 @@ export default {
|
|
|
id,
|
|
|
isRebuild,
|
|
|
courseId,
|
|
|
- showList,
|
|
|
+ showList
|
|
|
} = chapter;
|
|
|
if (!isFresh) {
|
|
|
chapter.showList = !showList;
|
|
@@ -723,9 +760,9 @@ export default {
|
|
|
.reSectionExamList({
|
|
|
chapterId: chapterId || menuId,
|
|
|
courseId,
|
|
|
- gradeId: this.gradeId,
|
|
|
+ gradeId: this.gradeId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
this.sectionExam = [...this.sectionExam, ...res.data];
|
|
|
});
|
|
|
return this.$request
|
|
@@ -734,13 +771,13 @@ export default {
|
|
|
gradeId: this.gradeId,
|
|
|
courseId,
|
|
|
rebuild: isRebuild ? 1 : undefined,
|
|
|
- moduleId: moduleId || 0,
|
|
|
+ moduleId: moduleId || 0
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
chapter.canLearn = res.data
|
|
|
- .filter((item) => item.type != 2)
|
|
|
- .every((item) => item.learning == 1);
|
|
|
- res.data.forEach((section) => {
|
|
|
+ .filter(item => item.type != 2)
|
|
|
+ .every(item => item.learning == 1);
|
|
|
+ res.data.forEach(section => {
|
|
|
section.parent = chapter;
|
|
|
section.courseId = courseId;
|
|
|
});
|
|
@@ -750,12 +787,12 @@ export default {
|
|
|
},
|
|
|
getAllSectionList() {
|
|
|
return this.$request
|
|
|
- .getAllSectionList({
|
|
|
+ .studyrecordgoodsAllListWithExam({
|
|
|
gradeId: this.gradeId,
|
|
|
goodsId: this.goodsId,
|
|
|
- rebuild: this.rebuild,
|
|
|
+ rebuild: this.rebuild
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
let { skipPort } = this.query;
|
|
|
if (skipPort) {
|
|
|
let { moduleId, chapterId, sectionId } = res.data[0];
|
|
@@ -764,10 +801,10 @@ export default {
|
|
|
query.chapterId = chapterId;
|
|
|
query.sectionId = sectionId;
|
|
|
query.skipPort = undefined;
|
|
|
- console.log("route",{ path: this.$route.path, query })
|
|
|
+ console.log("route", { path: this.$route.path, query });
|
|
|
this.$router.push({ path: this.$route.path, query });
|
|
|
}
|
|
|
- this.allSectionList = res.data;
|
|
|
+ this.allSectionList = res.data.filter(i => i.doType != 1);
|
|
|
return Promise.resolve(res.data);
|
|
|
});
|
|
|
},
|
|
@@ -794,14 +831,13 @@ export default {
|
|
|
// 自动播放下一个视频
|
|
|
async playNextVideo(sectionItem = this.sectionItem) {
|
|
|
let { menuId, parent, courseId, projectId } = sectionItem;
|
|
|
- let list = (
|
|
|
- menuId
|
|
|
- ? this.treeList.find((e) => e.courseId == courseId).list
|
|
|
- : projectId
|
|
|
- ? this.treeList
|
|
|
- : parent.list
|
|
|
- ).filter((e) => !e.doType);
|
|
|
- let index = list.findIndex((e) => e.id == sectionItem.id);
|
|
|
+ let list = (menuId
|
|
|
+ ? this.treeList.find(e => e.courseId == courseId).list
|
|
|
+ : projectId
|
|
|
+ ? this.treeList
|
|
|
+ : parent.list
|
|
|
+ ).filter(e => !e.doType);
|
|
|
+ let index = list.findIndex(e => e.id == sectionItem.id);
|
|
|
let nextItem = {};
|
|
|
if (list.length - 1 > index) {
|
|
|
nextItem = list[index + 1];
|
|
@@ -820,11 +856,11 @@ export default {
|
|
|
? nextItem.list
|
|
|
: await this[key](nextItem);
|
|
|
if (isNext) {
|
|
|
- nextItem = type == 2 ? list.find((e) => e.type == 1) : list[0];
|
|
|
+ nextItem = type == 2 ? list.find(e => e.type == 1) : list[0];
|
|
|
} else {
|
|
|
// 初始化 获取播放位置
|
|
|
let { moduleId, chapterId, sectionId } = this.query;
|
|
|
- nextItem = list.find((e) => {
|
|
|
+ nextItem = list.find(e => {
|
|
|
if (moduleId * 1 && type == 0) {
|
|
|
return e.menuId == moduleId;
|
|
|
}
|
|
@@ -839,6 +875,11 @@ export default {
|
|
|
return this.backNextItem(nextItem, nextItem.menuType, isNext);
|
|
|
},
|
|
|
async getResource(section, type, courseIndex) {
|
|
|
+ console.error(section, "section");
|
|
|
+ if (section.doType != 1 && section.learning == 1 && section.type == 2) {
|
|
|
+ this.$message.warning("考试已通过,请勿重复考试");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if (
|
|
|
section.type != 2 &&
|
|
|
this.isActive(section) &&
|
|
@@ -858,7 +899,7 @@ export default {
|
|
|
message:
|
|
|
section.type == 2
|
|
|
? "请学完视频课程再进行练习和测试"
|
|
|
- : "请按顺序学习视频课程",
|
|
|
+ : "请按顺序学习视频课程"
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -867,7 +908,7 @@ export default {
|
|
|
if (!section.recordingUrl) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: `暂无播放地址数据`,
|
|
|
+ message: `暂无播放地址数据`
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -877,7 +918,7 @@ export default {
|
|
|
if (!section.liveUrl) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: `暂无直播地址数据`,
|
|
|
+ message: `暂无直播地址数据`
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -885,7 +926,7 @@ export default {
|
|
|
if (data.watchStatus == "end" || data.watchStatus == "playback") {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: `直播已结束`,
|
|
|
+ message: `直播已结束`
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -893,7 +934,7 @@ export default {
|
|
|
if (data.watchStatus == "waiting") {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: `直播未开始`,
|
|
|
+ message: `直播未开始`
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -928,13 +969,13 @@ export default {
|
|
|
learning: section.learning,
|
|
|
type: type,
|
|
|
chapterId: section.chapterId || 0,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- },
|
|
|
+ orderGoodsId: this.orderGoodsId
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: "该试卷只能答题" + section.answerNum + "次",
|
|
|
+ message: "该试卷只能答题" + section.answerNum + "次"
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -944,7 +985,7 @@ export default {
|
|
|
if (type == 3) {
|
|
|
//节卷
|
|
|
let data = this.sectionExamList.filter(
|
|
|
- (x) => x.sectionId == section.menuId
|
|
|
+ x => x.sectionId == section.menuId
|
|
|
);
|
|
|
if (data && data.length > 0) {
|
|
|
section = data[0];
|
|
@@ -952,7 +993,7 @@ export default {
|
|
|
} else if (type == 2) {
|
|
|
//节卷
|
|
|
let data = this.sectionExam.filter(
|
|
|
- (x) => x.sectionId == section.sectionId
|
|
|
+ x => x.sectionId == section.sectionId
|
|
|
);
|
|
|
|
|
|
if (data && data.length > 0) {
|
|
@@ -970,8 +1011,8 @@ export default {
|
|
|
learning: section.learning,
|
|
|
type: type,
|
|
|
chapterId: section.chapterId || 0,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- },
|
|
|
+ orderGoodsId: this.orderGoodsId
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
async exceedLearnNum(section) {
|
|
@@ -983,7 +1024,7 @@ export default {
|
|
|
if (learnNum >= this.sectionMaxNum && !hasLearn) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: `每天最多学习${this.sectionMaxNum}节`,
|
|
|
+ message: `每天最多学习${this.sectionMaxNum}节`
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -991,34 +1032,34 @@ export default {
|
|
|
return true;
|
|
|
},
|
|
|
goodsTodayStudySectionNum() {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.$request
|
|
|
.goodsTodayStudySectionNum({
|
|
|
goodsId: this.goodsId,
|
|
|
- gradeId: this.gradeId,
|
|
|
+ gradeId: this.gradeId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
resolve(res.data);
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
gradeCheckGoodsStudy(option) {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.$request
|
|
|
.gradeCheckGoodsStudy({
|
|
|
goodsId: this.goodsId,
|
|
|
gradeId: this.gradeId,
|
|
|
moduleId: option.moduleId || 0,
|
|
|
chapterId: option.chapterId || 0,
|
|
|
- sectionId: option.sectionId || option.menuId,
|
|
|
+ sectionId: option.sectionId || option.menuId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
resolve(res.data);
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
bankRecordDoNum(section) {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.$request
|
|
|
.bankRecordDoNum({
|
|
|
goodsId: this.goodsId,
|
|
@@ -1026,9 +1067,9 @@ export default {
|
|
|
chapterId: section.chapterId,
|
|
|
courseId: this.courseId,
|
|
|
moduleId: 0,
|
|
|
- examId: section.typeId,
|
|
|
+ examId: section.typeId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
resolve(res.data);
|
|
|
});
|
|
|
});
|
|
@@ -1039,17 +1080,17 @@ export default {
|
|
|
//获取商品双师资模板
|
|
|
getDoubleTeacherList() {
|
|
|
let rows = JSON.parse(JSON.stringify(this.courseList));
|
|
|
- rows.forEach((e) => {
|
|
|
+ rows.forEach(e => {
|
|
|
e.list = [];
|
|
|
e.showList = false;
|
|
|
e.id = e.courseId;
|
|
|
});
|
|
|
return this.$request
|
|
|
.courseTeacherList({
|
|
|
- goodsId: this.$route.params.goodsId,
|
|
|
+ goodsId: this.$route.params.goodsId
|
|
|
})
|
|
|
.then(({ data }) => {
|
|
|
- data.forEach((ele) => {
|
|
|
+ data.forEach(ele => {
|
|
|
rows.forEach((e, i) => {
|
|
|
let actvieIndex = ele.courseIds.indexOf(this.activeCourseId);
|
|
|
let index = ele.courseIds.indexOf(e.courseId);
|
|
@@ -1069,7 +1110,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- return Promise.resolve(rows.filter((e) => e));
|
|
|
+ return Promise.resolve(rows.filter(e => e));
|
|
|
});
|
|
|
},
|
|
|
async orderTopTobottom(section, type, courseIndex) {
|
|
@@ -1082,7 +1123,7 @@ export default {
|
|
|
if (this.treeList.length > 1 && courseIndex > 0) {
|
|
|
let isAllLear = this.treeList
|
|
|
.filter((e, i) => i < courseIndex)
|
|
|
- .every((ele) => ele.stuAllNum == ele.secAllNum);
|
|
|
+ .every(ele => ele.stuAllNum == ele.secAllNum);
|
|
|
if (!isAllLear) return false;
|
|
|
}
|
|
|
let list = await this.studyRecordMenuAllList(
|
|
@@ -1091,7 +1132,7 @@ export default {
|
|
|
type = type == 1 && section.type == 2 ? 2 : type;
|
|
|
if (type == 1) {
|
|
|
if (parentId >= 0 && menuId >= 0) {
|
|
|
- var index = list.findIndex((e) => {
|
|
|
+ var index = list.findIndex(e => {
|
|
|
return parentId
|
|
|
? e.moduleId == moduleId &&
|
|
|
e.chapterId == chapterId &&
|
|
@@ -1100,7 +1141,7 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
var index = list.findIndex(
|
|
|
- (e) =>
|
|
|
+ e =>
|
|
|
e.moduleId == moduleId &&
|
|
|
e.chapterId == chapterId &&
|
|
|
e.id == section.sectionId
|
|
@@ -1109,20 +1150,27 @@ export default {
|
|
|
list = list.slice(0, index);
|
|
|
} else if (type != 3) {
|
|
|
list = list.filter(
|
|
|
- (e) => e.moduleId == moduleId && e.chapterId == chapterId
|
|
|
+ e => e.moduleId == moduleId && e.chapterId == chapterId
|
|
|
+ );
|
|
|
+ var index = list.findIndex(
|
|
|
+ e =>
|
|
|
+ e.moduleId == moduleId &&
|
|
|
+ e.chapterId == chapterId &&
|
|
|
+ e.examId == section.typeId
|
|
|
);
|
|
|
+ list = list.slice(0, index);
|
|
|
}
|
|
|
- return list.every((item) => item.studyStatus == 1);
|
|
|
+ return list.every(item => item.studyStatus == 1);
|
|
|
},
|
|
|
studyRecordMenuAllList(courseId) {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.$request
|
|
|
- .studyRecordMenuAllList({
|
|
|
+ .studyRecordMenuAllListWithExam({
|
|
|
courseId,
|
|
|
gradeId: this.gradeId,
|
|
|
- goodsId: this.goodsId,
|
|
|
+ goodsId: this.goodsId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
resolve(res.data);
|
|
|
});
|
|
|
});
|
|
@@ -1133,7 +1181,7 @@ export default {
|
|
|
if (_data.length == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
- return _data.some((section) => section.sectionId == sectionId);
|
|
|
+ return _data.some(section => section.sectionId == sectionId);
|
|
|
},
|
|
|
// 刷新数据
|
|
|
refreshList() {
|
|
@@ -1145,17 +1193,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
studyRecordGetChannelBasicInfo(channelId) {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(resolve => {
|
|
|
this.$request
|
|
|
.studyRecordGetChannelBasicInfo({
|
|
|
- channelId,
|
|
|
+ channelId
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
resolve(res.data);
|
|
|
})
|
|
|
- .catch((err) => {});
|
|
|
+ .catch(err => {});
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
query() {
|
|
@@ -1178,27 +1226,45 @@ export default {
|
|
|
return this.sectionItem.courseId;
|
|
|
},
|
|
|
playCourse() {
|
|
|
- return this.treeList.find((e) => e.courseId == this.playCourseId);
|
|
|
+ return this.treeList.find(e => e.courseId == this.playCourseId);
|
|
|
},
|
|
|
isLastVideo() {
|
|
|
try {
|
|
|
- let sectionId = this.sectionItem.sectionId || this.sectionItem.menuId || 0
|
|
|
- let chapterId = this.sectionItem.chapterId || 0
|
|
|
- let courseId = this.sectionItem.courseId || 0
|
|
|
+ let sectionId =
|
|
|
+ this.sectionItem.sectionId || this.sectionItem.menuId || 0;
|
|
|
+ let chapterId = this.sectionItem.chapterId || 0;
|
|
|
+ let courseId = this.sectionItem.courseId || 0;
|
|
|
let lastVideo = this.allSectionList.slice(-1)[0];
|
|
|
- return (
|
|
|
+ if (
|
|
|
sectionId == lastVideo.sectionId &&
|
|
|
chapterId == lastVideo.chapterId &&
|
|
|
courseId == lastVideo.courseId
|
|
|
- );
|
|
|
+ ) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ const index = this.allSectionList.findIndex(
|
|
|
+ i =>
|
|
|
+ i.sectionId == sectionId &&
|
|
|
+ i.chapterId == chapterId &&
|
|
|
+ i.courseId == courseId
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ this.allSectionList[index + 1].type == 4 ||
|
|
|
+ this.allSectionList[index + 1].type == 5
|
|
|
+ ) {
|
|
|
+ return 2;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
- return false;
|
|
|
+ return 0;
|
|
|
}
|
|
|
},
|
|
|
orderGoodsId() {
|
|
|
return this.query.orderGoodsId;
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -1301,8 +1367,8 @@ export default {
|
|
|
.el-icon-caret-bottom {
|
|
|
color: #999;
|
|
|
}
|
|
|
- & > div > span {
|
|
|
- font-size: 12px!important;
|
|
|
+ & > div > span {
|
|
|
+ font-size: 12px !important;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1452,4 +1518,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|