diff --git a/components/video-player/video-player.vue b/components/video-player/video-player.vue index 95cfc81..a587a8c 100644 --- a/components/video-player/video-player.vue +++ b/components/video-player/video-player.vue @@ -166,6 +166,7 @@ let second=sliderValue / 100 * duration; if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效 this.sliderValue=sliderValue; + this.$emit('progress',this.sliderValue); }else{ } diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 513502a..6113e79 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -19,7 +19,8 @@ @ended="onPlayerEnded" @timeupdate="onPlayerPlaying" @fullscreenchange="onFullScreen" - :drag="curriculumData.isDrag" + :drag="curriculumData.isDrag" + @progress="progress" style="width: 100%; object-fit: fill"> > @@ -427,6 +428,8 @@ export default { data(){ return{ + progressData: 0, + contentTypeV: '', trueFalse: true, loading:false,//加载中 courseId:'',//当前课程的id @@ -627,6 +630,7 @@ let $this=this; uni.showLoading({title:'加载中...'}) apiCourseStudy.studyIndex(this.courseId).then(rs=>{ + // this.courseType = rs.result.course.type if(rs.status != 200) { uni.hideLoading(); uni.showToast({title:rs.message,type:'fail'}); @@ -880,6 +884,7 @@ //this.curContent=0; // console.log(con,'con'); this.playerBoxShow=false; + this.contentTypeV = con.contentType if(con.contentType==40){ //如果是文档,需要再次加载pdf if(con.content!='' && con.content.indexOf('.pdf')==-1){ @@ -1295,6 +1300,9 @@ //console.log(e); this.scrollInfo = e.detail; }, + progress(val) { + this.progressData = (val).toFixed(2); + }, //以下是播放相关的处理 saveStudyDuration(duration) { //保存本地存储的学习时长 if (duration > 0) { @@ -1311,8 +1319,12 @@ "objInfo": ""+this.courseInfo.name, "aid":this.userInfo.aid, //当前登录人的id "aname":this.userInfo.name,//当前人的姓名 - "status": 1 //状态 + "status": 1, //状态 + "contentId": this.curContent.id, } + if(this.contentTypeV == 10) { + postData.progress = this.progressData + } //静默处理 apiStat.sendEvent(postData).then(rs=>{ if(rs.status == 200) {