教培功能bug修复
parent
c229f3d91e
commit
168ff70e22
|
@ -114,7 +114,6 @@ import {basePath, loginUser, baseImgPath} from "@/common/tool";
|
||||||
let faceAuthTimer; // 人脸认证计时器
|
let faceAuthTimer; // 人脸认证计时器
|
||||||
let throttleTimer;
|
let throttleTimer;
|
||||||
let throttleFlag;
|
let throttleFlag;
|
||||||
let videoContext;
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -142,7 +141,7 @@ export default {
|
||||||
videoSrc: "", // 视频地址
|
videoSrc: "", // 视频地址
|
||||||
videoPoster: "", // 视频封面图
|
videoPoster: "", // 视频封面图
|
||||||
scrollHeight: '0px', // scroll-view减去的高度
|
scrollHeight: '0px', // scroll-view减去的高度
|
||||||
// videoContext: null, // 视频上下文
|
videoContext: null, // 视频上下文
|
||||||
submitTimeWaitForCount: 0, // 提交时间等待次数
|
submitTimeWaitForCount: 0, // 提交时间等待次数
|
||||||
verification:false,// 是否人脸认证
|
verification:false,// 是否人脸认证
|
||||||
}
|
}
|
||||||
|
@ -327,7 +326,7 @@ export default {
|
||||||
this.videoList = resData.pd.VIDEOLIST;
|
this.videoList = resData.pd.VIDEOLIST;
|
||||||
},
|
},
|
||||||
async fnVideoSwitching(videoData, hasNodes, index, index1) {
|
async fnVideoSwitching(videoData, hasNodes, index, index1) {
|
||||||
videoContext && videoContext.pause();
|
this.videoContext && this.videoContext.pause();
|
||||||
this.submitTimeWaitForCount = 0;
|
this.submitTimeWaitForCount = 0;
|
||||||
if (this.changeVideoPlayTime !== 0) {
|
if (this.changeVideoPlayTime !== 0) {
|
||||||
await this.fnSubmitPlayTime("0", this.changeVideoPlayTime);
|
await this.fnSubmitPlayTime("0", this.changeVideoPlayTime);
|
||||||
|
@ -364,9 +363,7 @@ export default {
|
||||||
if (!resData.pd.RESOURCETIME) {
|
if (!resData.pd.RESOURCETIME) {
|
||||||
await this.fnSubmitPlayTime("0", 0);
|
await this.fnSubmitPlayTime("0", 0);
|
||||||
}
|
}
|
||||||
console.log('resData.pd.RESOURCETIME:'+resData.pd.RESOURCETIME)
|
|
||||||
this.serverVideoPlayTime = Math.floor(resData.pd.RESOURCETIME) || 0
|
this.serverVideoPlayTime = Math.floor(resData.pd.RESOURCETIME) || 0
|
||||||
console.log('this.serverVideoPlayTime:'+this.serverVideoPlayTime)
|
|
||||||
if (this.ISFACE === "1") {
|
if (this.ISFACE === "1") {
|
||||||
if (this.verification) {
|
if (this.verification) {
|
||||||
this.fnCreateVideo();
|
this.fnCreateVideo();
|
||||||
|
@ -378,13 +375,14 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fnCreateVideo() {
|
fnCreateVideo() {
|
||||||
videoContext = null;
|
if (!this.videoContext) {
|
||||||
videoContext = uni.createVideoContext("video");
|
this.videoContext = uni.createVideoContext("video");
|
||||||
videoContext.play();
|
}
|
||||||
console.log('fnCreateVideo:'+this.serverVideoPlayTime)
|
this.videoContext.play();
|
||||||
this.serverVideoPlayTime !== 0 && videoContext.seek(this.serverVideoPlayTime);
|
this.serverVideoPlayTime !== 0 && videoContext.seek(this.serverVideoPlayTime);
|
||||||
},
|
},
|
||||||
async fnTimeUpdate(event) {
|
fnTimeUpdate(event) {
|
||||||
|
this.throttle(async () => {
|
||||||
const currentTime = event.detail.currentTime;
|
const currentTime = event.detail.currentTime;
|
||||||
if (currentTime - this.serverVideoPlayTime >= 10) {
|
if (currentTime - this.serverVideoPlayTime >= 10) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
@ -392,7 +390,7 @@ export default {
|
||||||
}
|
}
|
||||||
//app视频自带bug,判断当前视频进度与服务器进度差,如果小于10秒,则退出重新进
|
//app视频自带bug,判断当前视频进度与服务器进度差,如果小于10秒,则退出重新进
|
||||||
if(currentTime !== 0 && Math.abs(currentTime - this.serverVideoPlayTime) > 10) {
|
if(currentTime !== 0 && Math.abs(currentTime - this.serverVideoPlayTime) > 10) {
|
||||||
videoContext.pause();
|
this.videoContext.pause();
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "app开发环境问题,偶现当前视频进度获取不准确,为了防止进度被覆盖,请退出重新进入!",
|
content: "app开发环境问题,偶现当前视频进度获取不准确,为了防止进度被覆盖,请退出重新进入!",
|
||||||
|
@ -412,6 +410,7 @@ export default {
|
||||||
this.submitTimeWaitForCount = 0;
|
this.submitTimeWaitForCount = 0;
|
||||||
await this.fnSubmitPlayTime("0", currentTime);
|
await this.fnSubmitPlayTime("0", currentTime);
|
||||||
}
|
}
|
||||||
|
}, 1000);
|
||||||
},
|
},
|
||||||
async fnSubmitPlayTime(IS_END, RESOURCETIME) {
|
async fnSubmitPlayTime(IS_END, RESOURCETIME) {
|
||||||
if(!this.videoData.VIDEOCOURSEWARE_ID) {
|
if(!this.videoData.VIDEOCOURSEWARE_ID) {
|
||||||
|
@ -463,7 +462,7 @@ export default {
|
||||||
this.videoList[this.firstIndex].percent = percent;
|
this.videoList[this.firstIndex].percent = percent;
|
||||||
}
|
}
|
||||||
if (resData.pd.CANEXAM === "1") {
|
if (resData.pd.CANEXAM === "1") {
|
||||||
videoContext.pause();
|
this.videoContext.pause();
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "当前班级内所有课程均已学完,是否直接参加考试?",
|
content: "当前班级内所有课程均已学完,是否直接参加考试?",
|
||||||
|
@ -471,12 +470,12 @@ export default {
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
videoContext && videoContext.exitFullScreen()
|
this.videoContext && this.videoContext.exitFullScreen()
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/application/onlinexxks/course_exam?STAGEEXAMPAPERINPUT_ID=' + resData.paper.STAGEEXAMPAPERINPUT_ID + '&STAGEEXAMPAPER_ID=' + resData.paper.STAGEEXAMPAPERINPUT_ID + '&CLASS_ID=' + this.CLASS_ID + '&POST_ID=' + resData.pd.POST_ID + '&STUDENT_ID=' + this.STUDENT_ID + '&NUMBEROFEXAMS=' + resData.pd.NUMBEROFEXAMS + '&entrySite=video_study'
|
url: '/pages/application/onlinexxks/course_exam?STAGEEXAMPAPERINPUT_ID=' + resData.paper.STAGEEXAMPAPERINPUT_ID + '&STAGEEXAMPAPER_ID=' + resData.paper.STAGEEXAMPAPERINPUT_ID + '&CLASS_ID=' + this.CLASS_ID + '&POST_ID=' + resData.pd.POST_ID + '&STUDENT_ID=' + this.STUDENT_ID + '&NUMBEROFEXAMS=' + resData.pd.NUMBEROFEXAMS + '&entrySite=video_study'
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
videoContext.play();
|
this.videoContext.play();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -489,7 +488,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.changeVideoPlayTime = 0;
|
this.changeVideoPlayTime = 0;
|
||||||
this.fnSubmitPlayTime("1", 0);
|
this.fnSubmitPlayTime("1", 0);
|
||||||
videoContext.pause();
|
this.videoContext.pause();
|
||||||
this.fnClearInterval();
|
this.fnClearInterval();
|
||||||
},
|
},
|
||||||
fnPlay() {
|
fnPlay() {
|
||||||
|
@ -523,7 +522,7 @@ export default {
|
||||||
CHAPTER_ID: this.videoData.CHAPTER_ID,
|
CHAPTER_ID: this.videoData.CHAPTER_ID,
|
||||||
VIDEOCOURSEWARE_ID: this.videoData.VIDEOCOURSEWARE_ID,
|
VIDEOCOURSEWARE_ID: this.videoData.VIDEOCOURSEWARE_ID,
|
||||||
})
|
})
|
||||||
videoContext && videoContext.exitFullScreen()
|
this.videoContext && this.videoContext.exitFullScreen()
|
||||||
const resData = await this.post('/app/user/getUserFace', {
|
const resData = await this.post('/app/user/getUserFace', {
|
||||||
USERNAME: loginUser.NAME,
|
USERNAME: loginUser.NAME,
|
||||||
USER_ID: loginUser.USER_ID,
|
USER_ID: loginUser.USER_ID,
|
||||||
|
|
Loading…
Reference in New Issue