|
@@ -18,7 +18,11 @@
|
|
|
ref="takePicture"
|
|
ref="takePicture"
|
|
|
@returnParameter="returnParameter"
|
|
@returnParameter="returnParameter"
|
|
|
></takePicture>
|
|
></takePicture>
|
|
|
- <count-down ref="countDown" @againSubmit="postStudyRecord(1)" @resetSection="resetSection"></count-down>
|
|
|
|
|
|
|
+ <count-down
|
|
|
|
|
+ ref="countDown"
|
|
|
|
|
+ @againSubmit="postStudyRecord(1)"
|
|
|
|
|
+ @resetSection="resetSection"
|
|
|
|
|
+ ></count-down>
|
|
|
<media ref="media" @returnParameterVideo="returnParameterVideo"></media>
|
|
<media ref="media" @returnParameterVideo="returnParameterVideo"></media>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -61,8 +65,10 @@ export default {
|
|
|
viewSign: null, //2腾讯视频播放器,其他保利威视播放器
|
|
viewSign: null, //2腾讯视频播放器,其他保利威视播放器
|
|
|
needtoTakeVideo: false, //是否需要随机录制2秒视频
|
|
needtoTakeVideo: false, //是否需要随机录制2秒视频
|
|
|
timeNeedtoTakeVideo: null, //需要随机录制2秒视频定时器
|
|
timeNeedtoTakeVideo: null, //需要随机录制2秒视频定时器
|
|
|
- curPlayOver:false,//当前视频已播放完毕
|
|
|
|
|
- picDeviceName:'',//PHOTE
|
|
|
|
|
|
|
+ curPlayOver: false, //当前视频已播放完毕
|
|
|
|
|
+ picDeviceName: "", //PHOTE
|
|
|
|
|
+ leaveTips: false,
|
|
|
|
|
+ showtipsing: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -151,10 +157,51 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
); //播放器初始化完毕时触发。播放器提供的方法需要在此事件发生后才可以调用。
|
|
); //播放器初始化完毕时触发。播放器提供的方法需要在此事件发生后才可以调用。
|
|
|
|
|
+ await this.screencheck(); //获取离开是否暂停视频
|
|
|
});
|
|
});
|
|
|
// document.addEventListener("visibilitychange", this.pauseVideo);
|
|
// document.addEventListener("visibilitychange", this.pauseVideo);
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleMouseOut() {
|
|
|
|
|
+ // console.log(111, this.leaveTips, this.showtipsing);
|
|
|
|
|
+ if (this.leaveTips && !this.showtipsing) {
|
|
|
|
|
+ this.showtipsing = true;
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (this.viewSign == 2) {
|
|
|
|
|
+ this.player_tencent.pause(); //暂停
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.player.j2s_pauseVideo(); //暂停
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ this.$confirm(`学习过程中请不要切换页面或其他操作,否则暂停学习!`, "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
|
+ closeOnPressEscape: false,
|
|
|
|
|
+ showCancelButton: false,
|
|
|
|
|
+ distinguishCancelAndClose: false,
|
|
|
|
|
+ showClose: false,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((_) => {
|
|
|
|
|
+ this.showtipsing = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((_) => {});
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ screencheck() {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ // console.log(222,this.goodsData)
|
|
|
|
|
+ this.$request.screencheck(this.goodsData.orderGoodsId).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ if (res.data) {
|
|
|
|
|
+ this.leaveTips = true;
|
|
|
|
|
+ window.addEventListener("blur", this.handleMouseOut);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getBeforeWork() {},
|
|
getBeforeWork() {},
|
|
|
//初始化参数
|
|
//初始化参数
|
|
|
initData() {
|
|
initData() {
|
|
@@ -164,8 +211,8 @@ export default {
|
|
|
this.openPhotoStatus = 0;
|
|
this.openPhotoStatus = 0;
|
|
|
this.videoPauseSetTimeStatus = false;
|
|
this.videoPauseSetTimeStatus = false;
|
|
|
this.firstPlay = true;
|
|
this.firstPlay = true;
|
|
|
- this.curPlayOver=false;
|
|
|
|
|
- this.needtoTakeVideo=false;
|
|
|
|
|
|
|
+ this.curPlayOver = false;
|
|
|
|
|
+ this.needtoTakeVideo = false;
|
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
|
clearTimeout(this.timeEventStatusTimeout); //删除双重保障定时器
|
|
clearTimeout(this.timeEventStatusTimeout); //删除双重保障定时器
|
|
|
},
|
|
},
|
|
@@ -484,7 +531,7 @@ export default {
|
|
|
preload: "auto",
|
|
preload: "auto",
|
|
|
autoplay: autoPlay,
|
|
autoplay: autoPlay,
|
|
|
controlBar: {
|
|
controlBar: {
|
|
|
- progressControl:isAllowSeek,
|
|
|
|
|
|
|
+ progressControl: isAllowSeek,
|
|
|
playbackRateMenuButton: playbackRate,
|
|
playbackRateMenuButton: playbackRate,
|
|
|
},
|
|
},
|
|
|
// player-tencent 为播放器容器 ID,必须与 html 中一致
|
|
// player-tencent 为播放器容器 ID,必须与 html 中一致
|
|
@@ -610,10 +657,9 @@ export default {
|
|
|
if (this.viewSign == 2) {
|
|
if (this.viewSign == 2) {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.player_tencent.currentTime(
|
|
this.player_tencent.currentTime(
|
|
|
- Number(this.activeSection.videoCurrentTime) || 0
|
|
|
|
|
- );
|
|
|
|
|
- }, 2000);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Number(this.activeSection.videoCurrentTime) || 0
|
|
|
|
|
+ );
|
|
|
|
|
+ }, 2000);
|
|
|
}
|
|
}
|
|
|
this.showRecordSetTimeOut = setTimeout(() => {
|
|
this.showRecordSetTimeOut = setTimeout(() => {
|
|
|
this.showRecordStatus = false;
|
|
this.showRecordStatus = false;
|
|
@@ -659,7 +705,7 @@ export default {
|
|
|
type: "success",
|
|
type: "success",
|
|
|
message: "播放完毕",
|
|
message: "播放完毕",
|
|
|
});
|
|
});
|
|
|
- this.curPlayOver=true;//当前视频已播放完毕
|
|
|
|
|
|
|
+ this.curPlayOver = true; //当前视频已播放完毕
|
|
|
this.isFullScreen();
|
|
this.isFullScreen();
|
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
|
//如果未录制视频的,需要录制
|
|
//如果未录制视频的,需要录制
|
|
@@ -669,7 +715,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.postStudyRecord(1);
|
|
this.postStudyRecord(1);
|
|
|
console.log("当前视频播放完毕时触发");
|
|
console.log("当前视频播放完毕时触发");
|
|
|
- this.curPlayOver=false;
|
|
|
|
|
|
|
+ this.curPlayOver = false;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//判断是全屏则退出全屏
|
|
//判断是全屏则退出全屏
|
|
@@ -726,8 +772,8 @@ export default {
|
|
|
this.HideVideo = true;
|
|
this.HideVideo = true;
|
|
|
},
|
|
},
|
|
|
//拍照成功回显 url
|
|
//拍照成功回显 url
|
|
|
- async returnParameter(url,deviceName) {
|
|
|
|
|
- this.picDeviceName=deviceName;
|
|
|
|
|
|
|
+ async returnParameter(url, deviceName) {
|
|
|
|
|
+ this.picDeviceName = deviceName;
|
|
|
let file = this.$tools.convertBase64UrlToBlob(url);
|
|
let file = this.$tools.convertBase64UrlToBlob(url);
|
|
|
try {
|
|
try {
|
|
|
var photoUrl = await this.$upload.upload(file, 0, {
|
|
var photoUrl = await this.$upload.upload(file, 0, {
|
|
@@ -892,7 +938,7 @@ export default {
|
|
|
this.postCourseVideoRecord(videoUrl)
|
|
this.postCourseVideoRecord(videoUrl)
|
|
|
.then(async (res) => {
|
|
.then(async (res) => {
|
|
|
this.needtoTakeVideo = false;
|
|
this.needtoTakeVideo = false;
|
|
|
- if(this.curPlayOver){
|
|
|
|
|
|
|
+ if (this.curPlayOver) {
|
|
|
this.onPlayOver();
|
|
this.onPlayOver();
|
|
|
}
|
|
}
|
|
|
//恢复播放
|
|
//恢复播放
|
|
@@ -928,7 +974,7 @@ export default {
|
|
|
// imageA: url,
|
|
// imageA: url,
|
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
|
gradeId: this.goodsData.gradeId,
|
|
gradeId: this.goodsData.gradeId,
|
|
|
- deviceName:this.picDeviceName,
|
|
|
|
|
|
|
+ deviceName: this.picDeviceName,
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
resolve(Number(res.data));
|
|
resolve(Number(res.data));
|
|
@@ -962,8 +1008,8 @@ export default {
|
|
|
gradeId: this.goodsData.gradeId,
|
|
gradeId: this.goodsData.gradeId,
|
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
|
courseId: this.activeSection.courseId,
|
|
courseId: this.activeSection.courseId,
|
|
|
- moduleId: this.activeSection.moduleId||0,
|
|
|
|
|
- chapterId: this.activeSection.chapterId||0,
|
|
|
|
|
|
|
+ moduleId: this.activeSection.moduleId || 0,
|
|
|
|
|
+ chapterId: this.activeSection.chapterId || 0,
|
|
|
sectionId: this.activeSection.sectionId,
|
|
sectionId: this.activeSection.sectionId,
|
|
|
videoUrl: videoUrl,
|
|
videoUrl: videoUrl,
|
|
|
videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
@@ -1031,7 +1077,7 @@ export default {
|
|
|
studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
|
|
studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
|
|
|
videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
|
erJianErZao: this.goodsData.erJianErZao,
|
|
erJianErZao: this.goodsData.erJianErZao,
|
|
|
- deviceName:this.picDeviceName,
|
|
|
|
|
|
|
+ deviceName: this.picDeviceName,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
if (imgUrl) {
|
|
if (imgUrl) {
|
|
@@ -1081,8 +1127,11 @@ export default {
|
|
|
//停止执行-退出页面
|
|
//停止执行-退出页面
|
|
|
this.$router.back(-1);
|
|
this.$router.back(-1);
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
- else if (err.code === 557||err.code === 5581||err.code === 5591) {
|
|
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ err.code === 557 ||
|
|
|
|
|
+ err.code === 5581 ||
|
|
|
|
|
+ err.code === 5591
|
|
|
|
|
+ ) {
|
|
|
if (this.viewSign == 2) {
|
|
if (this.viewSign == 2) {
|
|
|
polyvPlayerContext.pause();
|
|
polyvPlayerContext.pause();
|
|
|
} else {
|
|
} else {
|
|
@@ -1090,8 +1139,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.abnormal(data);
|
|
this.abnormal(data);
|
|
|
this.$refs.countDown.openBoxsRestart(err.code);
|
|
this.$refs.countDown.openBoxsRestart(err.code);
|
|
|
- }
|
|
|
|
|
- else if (err.code === 559) {
|
|
|
|
|
|
|
+ } else if (err.code === 559) {
|
|
|
console.log("拍照不够触发");
|
|
console.log("拍照不够触发");
|
|
|
this.abnormal(data);
|
|
this.abnormal(data);
|
|
|
this.$message.error(err.msg);
|
|
this.$message.error(err.msg);
|
|
@@ -1102,8 +1150,7 @@ export default {
|
|
|
} else if (err.code === 558) {
|
|
} else if (err.code === 558) {
|
|
|
this.abnormal(data);
|
|
this.abnormal(data);
|
|
|
this.$refs.countDown.openBoxs(parseInt(err.msg.split(",")[1]));
|
|
this.$refs.countDown.openBoxs(parseInt(err.msg.split(",")[1]));
|
|
|
- }
|
|
|
|
|
- else if (err.code === 601) {
|
|
|
|
|
|
|
+ } else if (err.code === 601) {
|
|
|
this.onPlayerError("提交异常", err.msg);
|
|
this.onPlayerError("提交异常", err.msg);
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(err.msg || "未知错误");
|
|
this.$message.error(err.msg || "未知错误");
|
|
@@ -1112,26 +1159,24 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//异常记录
|
|
//异常记录
|
|
|
- abnormal(data){
|
|
|
|
|
|
|
+ abnormal(data) {
|
|
|
this.$request
|
|
this.$request
|
|
|
- .abnormal(data)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .abnormal(data)
|
|
|
|
|
+ .then((res) => {})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
console.log(err, "err");
|
|
console.log(err, "err");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//重置视频学习
|
|
//重置视频学习
|
|
|
- resetSection(errcode){
|
|
|
|
|
|
|
+ resetSection(errcode) {
|
|
|
let data = {
|
|
let data = {
|
|
|
- orderGoodsId: parseInt(this.goodsData.orderGoodsId),
|
|
|
|
|
- courseId: this.activeSection.courseId,
|
|
|
|
|
- sectionId: this.activeSection.sectionId,
|
|
|
|
|
- errorCode:errcode
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ orderGoodsId: parseInt(this.goodsData.orderGoodsId),
|
|
|
|
|
+ courseId: this.activeSection.courseId,
|
|
|
|
|
+ sectionId: this.activeSection.sectionId,
|
|
|
|
|
+ errorCode: errcode,
|
|
|
|
|
+ };
|
|
|
this.$request
|
|
this.$request
|
|
|
- .resetSection(data)
|
|
|
|
|
|
|
+ .resetSection(data)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
location.reload();
|
|
location.reload();
|
|
|
})
|
|
})
|
|
@@ -1153,7 +1198,7 @@ export default {
|
|
|
// imageA: url,
|
|
// imageA: url,
|
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
orderGoodsId: this.goodsData.orderGoodsId,
|
|
|
gradeId: this.goodsData.gradeId,
|
|
gradeId: this.goodsData.gradeId,
|
|
|
- deviceName:this.picDeviceName,
|
|
|
|
|
|
|
+ deviceName: this.picDeviceName,
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
resolve(Number(res.data));
|
|
resolve(Number(res.data));
|
|
@@ -1196,6 +1241,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
|
|
+ if(this.leaveTips){
|
|
|
|
|
+ window.removeEventListener('blur', this.handleMouseOut);
|
|
|
|
|
+ }
|
|
|
this.$bus.$off("toPlay");
|
|
this.$bus.$off("toPlay");
|
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
|
|
|
// document.removeEventListener("visibilitychange", this.pauseVideo);
|
|
// document.removeEventListener("visibilitychange", this.pauseVideo);
|