|
@@ -4306,29 +4306,50 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- //提交保存观看历史
|
|
|
- if (this.playSectionId) {
|
|
|
- this.postStudyRecord(0, this.playSectionId);
|
|
|
- }
|
|
|
+ if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
|
|
|
+ //要按从头到尾顺序学习, 且不是重修课程
|
|
|
|
|
|
- this.player &&
|
|
|
- this.player.HTML5.video.removeEventListener(
|
|
|
- "timeupdate",
|
|
|
- this.timeEvent
|
|
|
- );
|
|
|
- //播放视频
|
|
|
- this.showRecordStatus = false; //隐藏播放记录提示
|
|
|
- this.sectionItem = section;
|
|
|
- console.log(section, "section");
|
|
|
- this.isPlayRebuild = section.rebuild;
|
|
|
- this.moduleId = section.moduleId || 0;
|
|
|
- this.chapterId = section.chapterId || 0;
|
|
|
- this.playSectionId = section.sectionId || section.menuId;
|
|
|
- // console.log(this.moduleId, this.chapterId, this.playSectionId);
|
|
|
- await this.getPhotoLastRecord();
|
|
|
- this.recordObj = await this.getRecordLast();
|
|
|
- this.getNoteList();
|
|
|
- this.initVideo(section);
|
|
|
+ let rows = await this.studyRecordMenuAllList();
|
|
|
+ if (!this.hasPreItem(rows, section)) {
|
|
|
+ //判断是否有上一节
|
|
|
+ let newRows = [];
|
|
|
+ for (let i = 0; i < rows.length; i++) {
|
|
|
+ let moduleTrue =
|
|
|
+ rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
|
|
|
+ let chapterTrue =
|
|
|
+ rows[i].chapterId == section.chapterId ||
|
|
|
+ rows[i].chapterId == 0;
|
|
|
+ let sectionTrue =
|
|
|
+ rows[i].sectionId == section.sectionId ||
|
|
|
+ rows[i].sectionId == section.menuId;
|
|
|
+ if (moduleTrue && chapterTrue && sectionTrue) {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ if (rows[i].sectionType != 2) {
|
|
|
+ newRows.push(rows[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let isAllLearn = newRows.every((item) => {
|
|
|
+ return item.studyStatus == 1;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (isAllLearn) {
|
|
|
+ this.initVideo(section);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请按顺序学习视频课程",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //第一章第一节
|
|
|
+ this.initVideo(section);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.initVideo(section);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -4375,71 +4396,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async initVideo(option) {
|
|
|
- if (this.businessData.goodsLearningOrder == 2 && !option.isRebuild) {
|
|
|
- //要按从头到尾顺序学习, 且不是重修课程
|
|
|
-
|
|
|
- let rows = await this.studyRecordMenuAllList();
|
|
|
- if (!this.hasPreItem(rows, option)) {
|
|
|
- //判断是否有上一节
|
|
|
- let newRows = [];
|
|
|
- for (let i = 0; i < rows.length; i++) {
|
|
|
- let moduleTrue =
|
|
|
- rows[i].moduleId == option.moduleId || rows[i].moduleId == 0;
|
|
|
- let chapterTrue =
|
|
|
- rows[i].chapterId == option.chapterId || rows[i].chapterId == 0;
|
|
|
- let sectionTrue =
|
|
|
- rows[i].sectionId == option.sectionId ||
|
|
|
- rows[i].sectionId == option.menuId;
|
|
|
- if (moduleTrue && chapterTrue && sectionTrue) {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- if (rows[i].sectionType != 2) {
|
|
|
- newRows.push(rows[i]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- let isAllLearn = newRows.every((item) => {
|
|
|
- return item.studyStatus == 1;
|
|
|
- });
|
|
|
-
|
|
|
- if (isAllLearn) {
|
|
|
- this.playVideo(option);
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "请按顺序学习视频课程",
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- //第一章第一节
|
|
|
- this.playVideo(option);
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.playVideo(option);
|
|
|
- }
|
|
|
-
|
|
|
- return;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 判断是否是当前播放的节
|
|
|
- */
|
|
|
- isActive(section) {
|
|
|
- let moduleId = section.moduleId || 0;
|
|
|
- let chapterId = section.chapterId || 0;
|
|
|
- let sectionId = section.sectionId || section.menuId;
|
|
|
- if (
|
|
|
- moduleId == this.moduleId &&
|
|
|
- chapterId == this.chapterId &&
|
|
|
- sectionId == this.playSectionId
|
|
|
- ) {
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- async playVideo(option) {
|
|
|
if (option.sectionType == 1 || option.sectionType == 3) {
|
|
|
//录播
|
|
|
|
|
@@ -4473,13 +4429,8 @@ export default {
|
|
|
// let oldSectionId = this.playSectionId;
|
|
|
// uni.$emit("changeSection", oldSectionId);
|
|
|
}
|
|
|
- //设置播放的节ID
|
|
|
- await this.clears();
|
|
|
- this.vid = option.recordingUrl;
|
|
|
- this.loadPlayerScript(this.loadPlayer);
|
|
|
- // uni.$emit("levelId", this.levelId);
|
|
|
- // uni.$emit("getSection", this.menuItem);
|
|
|
- // uni.$emit("isRebuild", this.isRebuild);
|
|
|
+
|
|
|
+ this.playVideo(option);
|
|
|
}
|
|
|
if (option.sectionType == 2) {
|
|
|
//直播
|
|
@@ -4503,6 +4454,89 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ this.playVideo(option);
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 判断是否是当前播放的节
|
|
|
+ */
|
|
|
+ isActive(section) {
|
|
|
+ let moduleId = section.moduleId || 0;
|
|
|
+ let chapterId = section.chapterId || 0;
|
|
|
+ let sectionId = section.sectionId || section.menuId;
|
|
|
+ if (
|
|
|
+ moduleId == this.moduleId &&
|
|
|
+ chapterId == this.chapterId &&
|
|
|
+ sectionId == this.playSectionId
|
|
|
+ ) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ async playVideo(option) {
|
|
|
+ if (option.sectionType == 1 || option.sectionType == 3) {
|
|
|
+ //录播
|
|
|
+
|
|
|
+ //设置播放的节ID
|
|
|
+
|
|
|
+ //提交保存观看历史
|
|
|
+ if (this.playSectionId) {
|
|
|
+ this.postStudyRecord(0, this.playSectionId);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.player &&
|
|
|
+ this.player.HTML5.video.removeEventListener(
|
|
|
+ "timeupdate",
|
|
|
+ this.timeEvent
|
|
|
+ );
|
|
|
+ //播放视频
|
|
|
+ this.showRecordStatus = false; //隐藏播放记录提示
|
|
|
+ this.sectionItem = option;
|
|
|
+ console.log(option, "option");
|
|
|
+ this.isPlayRebuild = option.rebuild;
|
|
|
+ this.moduleId = option.moduleId || 0;
|
|
|
+ this.chapterId = option.chapterId || 0;
|
|
|
+ this.playSectionId = option.sectionId || option.menuId;
|
|
|
+ // console.log(this.moduleId, this.chapterId, this.playSectionId);
|
|
|
+ await this.getPhotoLastRecord();
|
|
|
+ this.recordObj = await this.getRecordLast();
|
|
|
+ this.getNoteList();
|
|
|
+ await this.clears();
|
|
|
+ this.vid = option.recordingUrl;
|
|
|
+ this.loadPlayerScript(this.loadPlayer);
|
|
|
+ // uni.$emit("levelId", this.levelId);
|
|
|
+ // uni.$emit("getSection", this.menuItem);
|
|
|
+ // uni.$emit("isRebuild", this.isRebuild);
|
|
|
+ }
|
|
|
+ if (option.sectionType == 2) {
|
|
|
+ //直播
|
|
|
+
|
|
|
+ //提交保存观看历史
|
|
|
+ if (this.playSectionId) {
|
|
|
+ this.postStudyRecord(0, this.playSectionId);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.player &&
|
|
|
+ this.player.HTML5.video.removeEventListener(
|
|
|
+ "timeupdate",
|
|
|
+ this.timeEvent
|
|
|
+ );
|
|
|
+ //播放视频
|
|
|
+ this.showRecordStatus = false; //隐藏播放记录提示
|
|
|
+ this.sectionItem = option;
|
|
|
+ console.log(section, "section");
|
|
|
+ this.isPlayRebuild = option.rebuild;
|
|
|
+ this.moduleId = option.moduleId || 0;
|
|
|
+ this.chapterId = option.chapterId || 0;
|
|
|
+ this.playSectionId = option.sectionId || option.menuId;
|
|
|
+ // console.log(this.moduleId, this.chapterId, this.playSectionId);
|
|
|
+ await this.getPhotoLastRecord();
|
|
|
+ this.recordObj = await this.getRecordLast();
|
|
|
+ this.getNoteList();
|
|
|
//设置播放的节ID
|
|
|
await this.clears();
|
|
|
this.vidzb = option.liveUrl;
|