This commit is contained in:
binbin_pan 2024-09-14 10:34:04 +08:00
parent f79caf661e
commit 755844790a
1 changed files with 7 additions and 4 deletions

View File

@ -59,7 +59,9 @@ export default {
isEnd: false, isEnd: false,
video: null, video: null,
isHide: false, isHide: false,
oldTime: 0 oldTime: 0,
random1: 0,
random2: 0
} }
}, },
onLoad(opt) { onLoad(opt) {
@ -75,6 +77,8 @@ export default {
console.log('🚀 ~ onLoad ~ this.path:', this.path) console.log('🚀 ~ onLoad ~ this.path:', this.path)
this.studyDuration = this.currentTime = Number(opt.studyDuration) this.studyDuration = this.currentTime = Number(opt.studyDuration)
this.allStudyDuration = Number(opt.allStudyDuration) this.allStudyDuration = Number(opt.allStudyDuration)
this.random1 = ((this.allStudyDuration / 3) * 2).toFixed(0)
this.random2 = (this.allStudyDuration / 3).toFixed(0)
this.isEnd = opt.isEnd this.isEnd = opt.isEnd
if (opt.isEnd) { if (opt.isEnd) {
this.studyDuration = 0 this.studyDuration = 0
@ -104,11 +108,10 @@ export default {
this.currentTime = Math.ceil(e.detail.currentTime) this.currentTime = Math.ceil(e.detail.currentTime)
console.log('🚀 ~ 视频播放时间: ~ this.currentTime:', this.currentTime) console.log('🚀 ~ 视频播放时间: ~ this.currentTime:', this.currentTime)
console.log('🚀 ~ 视频总时长: ~ this.allStudyDuration:', this.allStudyDuration) console.log('🚀 ~ 视频总时长: ~ this.allStudyDuration:', this.allStudyDuration)
const random1 = (this.allStudyDuration / 3) * 2 console.log('🚀 ~ videoTimeUpdate ~ random1-2:', this.random1, this.random2)
const random2 = this.allStudyDuration / 3
if (this.currentTime != this.oldTime) { if (this.currentTime != this.oldTime) {
if (this.currentTime == random1 || this.currentTime == random2) { if (this.currentTime == this.random2 || this.currentTime == this.random1) {
this.oldTime = this.currentTime // , , , this.oldTime = this.currentTime // , , ,
this.video.pause() this.video.pause()
this.openPhotograph() this.openPhotograph()