|
@@ -307,7 +307,6 @@ export default {
|
|
|
return {
|
|
|
markContent: "http://admin.zhujianpeixun.com/",
|
|
|
showMark: false,
|
|
|
- hasStart: false,
|
|
|
lockTimer: null,
|
|
|
orderGoodsId: 0,
|
|
|
noticeShow: false,
|
|
@@ -318,7 +317,7 @@ export default {
|
|
|
vid: "",
|
|
|
goodsId: 0,
|
|
|
goodsData: {},
|
|
|
- photoPopup: false,
|
|
|
+ showCamera: false,
|
|
|
goodsPlayConfig: null,
|
|
|
autoplay: false,
|
|
|
isAllowSeek: "no",
|
|
@@ -367,12 +366,13 @@ export default {
|
|
|
jjShiGongYuan: false,
|
|
|
pauseTime: 0,
|
|
|
pauseTimer: null,
|
|
|
- barTimer: null,
|
|
|
isReach: false,
|
|
|
noticeShow1: false,
|
|
|
refPlv: null,
|
|
|
- isCache: true,
|
|
|
+ isCache: false,
|
|
|
isHaverebuild: false,
|
|
|
+ isPlaying: false,
|
|
|
+ beforeHideIsPlaying: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -440,7 +440,6 @@ export default {
|
|
|
this.courseId = Number(id) || "";
|
|
|
this.goodsId = Number(goodsId);
|
|
|
this.gradeId = Number(gradeId);
|
|
|
- this.isCache = false;
|
|
|
if (skipPort) {
|
|
|
await this.$method.skipLogin(skipPort);
|
|
|
}
|
|
@@ -449,10 +448,11 @@ export default {
|
|
|
}
|
|
|
// 公众号模板消息的数据埋点
|
|
|
informId && this.clickOfficial(informId);
|
|
|
- await this.init();
|
|
|
+ this.init();
|
|
|
},
|
|
|
async onShow() {
|
|
|
if (this.isCache) {
|
|
|
+ this.isCache = false;
|
|
|
// #ifdef H5
|
|
|
location.reload();
|
|
|
// #endif
|
|
@@ -460,6 +460,14 @@ export default {
|
|
|
this.init();
|
|
|
// #endif
|
|
|
}
|
|
|
+ if (this.beforeHideIsPlaying) {
|
|
|
+ console.log("🚀 ~ file: detail.vue:464 ~ onShow ~ beforeHideIsPlaying:", this.beforeHideIsPlaying)
|
|
|
+ // 二建二造提示弹出来
|
|
|
+ if (this.playSecIsLearn && this.erJianErZao && this.pauseTimer == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.refPlv.resumeVideo();
|
|
|
+ }
|
|
|
},
|
|
|
onUnload() {
|
|
|
console.log("onUnloadonUnloadonUnloadonUnload");
|
|
@@ -467,16 +475,16 @@ export default {
|
|
|
clearInterval(this.lockTimer);
|
|
|
},
|
|
|
onHide() {
|
|
|
- setTimeout(() => {
|
|
|
- this.isCache = true;
|
|
|
- }, 2000);
|
|
|
+ this.beforeHideIsPlaying = this.isPlaying;
|
|
|
+ if (this.isPlaying) {
|
|
|
+ this.refPlv.playPause();
|
|
|
+ }
|
|
|
this.originUnload();
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
...mapMutations(["updateChapterOpen", "updateLiveLast"]),
|
|
|
async init() {
|
|
|
- this.isCache = false;
|
|
|
// #ifdef MP-WEIXIN
|
|
|
this.isAllowSeek = "no";
|
|
|
// #endif
|
|
@@ -486,8 +494,15 @@ export default {
|
|
|
// 锁
|
|
|
lockAction();
|
|
|
this.lockTimer = setInterval(lockAction, 10000);
|
|
|
- await this.isCanLearn();
|
|
|
- this.courseCourseList();
|
|
|
+ this.isCanLearn()
|
|
|
+ .then((res) => {
|
|
|
+ this.courseCourseList();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isCache = true; // onshowc重新触发校验
|
|
|
+ }, 2000);
|
|
|
+ });
|
|
|
},
|
|
|
// 七大员是否能进入学习
|
|
|
async qCheckIsCanLearn() {
|
|
@@ -666,8 +681,11 @@ export default {
|
|
|
console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
|
|
|
if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
|
|
|
// 5 * 60 * 1000
|
|
|
- let text = this.photoPopup ? "拍照停留" : "暂停";
|
|
|
- this.photoPopup = false;
|
|
|
+ let text = "暂停";
|
|
|
+ if (this.showCamera) {
|
|
|
+ text = "拍照停留";
|
|
|
+ this.refPlv.closeCamera();
|
|
|
+ }
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
showCancel: false,
|
|
@@ -712,7 +730,6 @@ export default {
|
|
|
this.postStudyRecord(0);
|
|
|
//清除直播
|
|
|
this.studyTimer && clearInterval(this.studyTimer);
|
|
|
- this.hasStart = false;
|
|
|
this.photoConfig = false;
|
|
|
this.moduleId = item.moduleId || null;
|
|
|
this.chapterId = item.chapterId || null;
|
|
@@ -730,15 +747,9 @@ export default {
|
|
|
this.pauseTimer = null;
|
|
|
}
|
|
|
},
|
|
|
- clearBarTimer() {
|
|
|
- if (this.barTimer) {
|
|
|
- clearInterval(this.barTimer);
|
|
|
- this.barTimer = null;
|
|
|
- }
|
|
|
- },
|
|
|
// 原来onUnload里面的内容
|
|
|
originUnload() {
|
|
|
- if (this.sectionId > 0 && this.hasStart) {
|
|
|
+ if (this.sectionId > 0 && this.isPlaying) {
|
|
|
//退出提交记录
|
|
|
this.postStudyRecord();
|
|
|
}
|
|
@@ -752,10 +763,8 @@ export default {
|
|
|
|
|
|
if (this.studyTimer) {
|
|
|
clearInterval(this.studyTimer);
|
|
|
- this.hasStart = false;
|
|
|
}
|
|
|
this.clearPauseTimer();
|
|
|
- this.clearBarTimer();
|
|
|
if (this.lockTimer) {
|
|
|
clearInterval(this.lockTimer);
|
|
|
this.$api
|
|
@@ -1487,6 +1496,7 @@ export default {
|
|
|
},
|
|
|
playing() {
|
|
|
console.log("playing");
|
|
|
+ this.isPlaying = true;
|
|
|
this.studyLog();
|
|
|
if (!this.recordObj.videoCurrentTime) {
|
|
|
this.postStudyRecord(0);
|
|
@@ -1497,17 +1507,19 @@ export default {
|
|
|
}, 15000);
|
|
|
},
|
|
|
openCamera() {
|
|
|
+ this.showCamera = true;
|
|
|
this.$refs["camera"].openCamera();
|
|
|
this.refPlv.playPause();
|
|
|
this.refPlv.exitFullScreen();
|
|
|
},
|
|
|
pause() {
|
|
|
+ this.isPlaying = false;
|
|
|
this.erJianErZaoPauseTip();
|
|
|
clearInterval(this.studyTimer);
|
|
|
},
|
|
|
async ended() {
|
|
|
console.log("🚀 ~ file: detail.vue:1519 ~ ended ~ ended:", "结束");
|
|
|
- this.hasStart = false;
|
|
|
+ this.isPlaying = false;
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "播放完毕",
|
|
@@ -1585,7 +1597,6 @@ export default {
|
|
|
this.$store.commit("setPlaySectionId", {
|
|
|
playSectionId: data.sectionId,
|
|
|
});
|
|
|
- this.hasStart = false;
|
|
|
this.photoConfig = false;
|
|
|
this.sectionItem = data;
|
|
|
this.playVideo(data);
|