|
@@ -1182,11 +1182,11 @@ export default {
|
|
|
},
|
|
|
// 原来onshow里面的内容
|
|
|
originOnShow() {
|
|
|
- this.getbaseprofiletplists().then((res) => {
|
|
|
+ this.getbaseprofiletplists().then(async (res) => {
|
|
|
this.courseDetail();
|
|
|
this.getGoodsDetail();
|
|
|
this.getAnswerList();
|
|
|
- this.studyRecordMenuAllList();
|
|
|
+ await this.studyRecordMenuAllList();
|
|
|
// this.answerTimer = setInterval(() => {
|
|
|
// this.getAnswerList();
|
|
|
// }, 5000);
|
|
@@ -1615,6 +1615,36 @@ export default {
|
|
|
this.updateLiveLast(res.data.data);
|
|
|
});
|
|
|
},
|
|
|
+ async initPlayVideo(sectionItem) {
|
|
|
+ this.moduleId = sectionItem.moduleId;
|
|
|
+ this.chapterId = sectionItem.chapterId;
|
|
|
+ if (sectionItem.sectionType == 1) {
|
|
|
+ //录播
|
|
|
+ this.$store.commit("setPlaySectionId", {
|
|
|
+ playSectionId: sectionItem.sectionId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setPlayVID", {
|
|
|
+ playVID: sectionItem.recordingUrl,
|
|
|
+ });
|
|
|
+
|
|
|
+ this.sectionItem = sectionItem;
|
|
|
+ await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
+ this.playVideo(sectionItem);
|
|
|
+ } else if (sectionItem.sectionType == 2) {
|
|
|
+ //直播
|
|
|
+ this.studyRecordGetLastLive();
|
|
|
+ } else if (sectionItem.sectionType == 3) {
|
|
|
+ //回放
|
|
|
+ this.$store.commit("setPlaySectionId", {
|
|
|
+ playSectionId: sectionItem.sectionId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setPlayVID", {
|
|
|
+ playVID: sectionItem.recordingUrl,
|
|
|
+ });
|
|
|
+ this.sectionItem = sectionItem;
|
|
|
+ this.playVideo(sectionItem);
|
|
|
+ }
|
|
|
+ },
|
|
|
studyRecordQueryLiveLast() {
|
|
|
// /study/record/queryLiveLast
|
|
|
this.$api
|
|
@@ -1623,50 +1653,61 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
courseId: this.courseId,
|
|
|
})
|
|
|
- .then(async (res) => {
|
|
|
- if (res.data.data) {
|
|
|
- this.moduleId = res.data.data.moduleId;
|
|
|
- this.chapterId = res.data.data.chapterId;
|
|
|
- if (res.data.data.sectionType == 1) {
|
|
|
- //录播
|
|
|
- this.$store.commit("setPlaySectionId", {
|
|
|
- playSectionId: res.data.data.sectionId,
|
|
|
- });
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: res.data.data.recordingUrl,
|
|
|
- });
|
|
|
+ .then((res) => {
|
|
|
+ let { data } = res.data;
|
|
|
+ if (!data.sectionId) {
|
|
|
+ data = this.menuAllList[0];
|
|
|
+ }
|
|
|
+ this.initPlayVideo(data);
|
|
|
+ // if (res.data.data) {
|
|
|
+ // this.moduleId = res.data.data.moduleId;
|
|
|
+ // this.chapterId = res.data.data.chapterId;
|
|
|
+ // if (res.data.data.sectionType == 1) {
|
|
|
+ // //录播
|
|
|
+ // this.$store.commit("setPlaySectionId", {
|
|
|
+ // playSectionId: res.data.data.sectionId,
|
|
|
+ // });
|
|
|
+ // this.$store.commit("setPlayVID", {
|
|
|
+ // playVID: res.data.data.recordingUrl,
|
|
|
+ // });
|
|
|
|
|
|
- this.sectionItem = res.data.data;
|
|
|
- await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
- this.playVideo(res.data.data);
|
|
|
- } else if (res.data.data.sectionType == 2) {
|
|
|
- //直播
|
|
|
- this.studyRecordGetLastLive();
|
|
|
- } else if (res.data.data.sectionType == 3) {
|
|
|
- //回放
|
|
|
- this.$store.commit("setPlaySectionId", {
|
|
|
- playSectionId: res.data.data.sectionId,
|
|
|
- });
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: res.data.data.recordingUrl,
|
|
|
- });
|
|
|
- this.sectionItem = res.data.data;
|
|
|
- this.playVideo(res.data.data);
|
|
|
- }
|
|
|
+ // this.sectionItem = res.data.data;
|
|
|
+ // await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
+ // this.playVideo(res.data.data);
|
|
|
+ // } else if (res.data.data.sectionType == 2) {
|
|
|
+ // //直播
|
|
|
+ // this.studyRecordGetLastLive();
|
|
|
+ // } else if (res.data.data.sectionType == 3) {
|
|
|
+ // //回放
|
|
|
+ // this.$store.commit("setPlaySectionId", {
|
|
|
+ // playSectionId: res.data.data.sectionId,
|
|
|
+ // });
|
|
|
+ // this.$store.commit("setPlayVID", {
|
|
|
+ // playVID: res.data.data.recordingUrl,
|
|
|
+ // });
|
|
|
+ // this.sectionItem = res.data.data;
|
|
|
+ // this.playVideo(res.data.data);
|
|
|
+ // }
|
|
|
|
|
|
- // 查询用户最后一次看的录播的信息
|
|
|
- this.$http({
|
|
|
- url: "/study/record/getUserWatchLast",
|
|
|
- method: "get",
|
|
|
- data: {
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.sectionItem = res.data.data || {};
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 查询用户最后一次看的录播的信息
|
|
|
+ // this.$http({
|
|
|
+ // url: "/study/record/getUserWatchLast",
|
|
|
+ // method: "get",
|
|
|
+ // data: {
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // },
|
|
|
+ // }).then((res) => {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // let { data } = res.data;
|
|
|
+ // if (!data) {
|
|
|
+ // const sectionItem = this.menuAllList[0];
|
|
|
+ // sectionItem.sectionType == 1 && (data = sectionItem);
|
|
|
+ // // initPlayVideo
|
|
|
+ // }
|
|
|
+ // this.sectionItem = data;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
@@ -1898,7 +1939,7 @@ export default {
|
|
|
},
|
|
|
studyRecordMenuAllList() {
|
|
|
// study/record/menuAllList
|
|
|
- this.$api
|
|
|
+ return this.$api
|
|
|
.studyRecordMenuAllList({
|
|
|
courseId: this.courseId,
|
|
|
gradeId: this.gradeId,
|
|
@@ -1908,12 +1949,12 @@ export default {
|
|
|
let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
if (res.data.data) {
|
|
|
this.menuAllList = res.data.data;
|
|
|
- // console.log('======0', this.sectionItem);
|
|
|
this.livingItem = res.data.data.find(
|
|
|
(item) =>
|
|
|
item.liveStartTime <= nowTime && item.liveEndTime > nowTime
|
|
|
);
|
|
|
}
|
|
|
+ return Promise.resolve();
|
|
|
});
|
|
|
},
|
|
|
getbaseprofiletplists() {
|