mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-10 03:16:45 +08:00
视频进度
This commit is contained in:
@@ -166,6 +166,7 @@
|
|||||||
let second=sliderValue / 100 * duration;
|
let second=sliderValue / 100 * duration;
|
||||||
if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效
|
if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效
|
||||||
this.sliderValue=sliderValue;
|
this.sliderValue=sliderValue;
|
||||||
|
this.$emit('progress',this.sliderValue);
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
@ended="onPlayerEnded"
|
@ended="onPlayerEnded"
|
||||||
@timeupdate="onPlayerPlaying"
|
@timeupdate="onPlayerPlaying"
|
||||||
@fullscreenchange="onFullScreen"
|
@fullscreenchange="onFullScreen"
|
||||||
:drag="curriculumData.isDrag"
|
:drag="curriculumData.isDrag"
|
||||||
|
@progress="progress"
|
||||||
style="width: 100%; object-fit: fill">
|
style="width: 100%; object-fit: fill">
|
||||||
></video-player>
|
></video-player>
|
||||||
<view class="player-box" v-if="playerBoxShow">
|
<view class="player-box" v-if="playerBoxShow">
|
||||||
@@ -427,6 +428,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
progressData: 0,
|
||||||
|
contentTypeV: '',
|
||||||
trueFalse: true,
|
trueFalse: true,
|
||||||
loading:false,//加载中
|
loading:false,//加载中
|
||||||
courseId:'',//当前课程的id
|
courseId:'',//当前课程的id
|
||||||
@@ -627,6 +630,7 @@
|
|||||||
let $this=this;
|
let $this=this;
|
||||||
uni.showLoading({title:'加载中...'})
|
uni.showLoading({title:'加载中...'})
|
||||||
apiCourseStudy.studyIndex(this.courseId).then(rs=>{
|
apiCourseStudy.studyIndex(this.courseId).then(rs=>{
|
||||||
|
// this.courseType = rs.result.course.type
|
||||||
if(rs.status != 200) {
|
if(rs.status != 200) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({title:rs.message,type:'fail'});
|
uni.showToast({title:rs.message,type:'fail'});
|
||||||
@@ -880,6 +884,7 @@
|
|||||||
//this.curContent=0;
|
//this.curContent=0;
|
||||||
// console.log(con,'con');
|
// console.log(con,'con');
|
||||||
this.playerBoxShow=false;
|
this.playerBoxShow=false;
|
||||||
|
this.contentTypeV = con.contentType
|
||||||
if(con.contentType==40){
|
if(con.contentType==40){
|
||||||
//如果是文档,需要再次加载pdf
|
//如果是文档,需要再次加载pdf
|
||||||
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
||||||
@@ -1295,6 +1300,9 @@
|
|||||||
//console.log(e);
|
//console.log(e);
|
||||||
this.scrollInfo = e.detail;
|
this.scrollInfo = e.detail;
|
||||||
},
|
},
|
||||||
|
progress(val) {
|
||||||
|
this.progressData = (val).toFixed(2);
|
||||||
|
},
|
||||||
//以下是播放相关的处理
|
//以下是播放相关的处理
|
||||||
saveStudyDuration(duration) { //保存本地存储的学习时长
|
saveStudyDuration(duration) { //保存本地存储的学习时长
|
||||||
if (duration > 0) {
|
if (duration > 0) {
|
||||||
@@ -1311,8 +1319,12 @@
|
|||||||
"objInfo": ""+this.courseInfo.name,
|
"objInfo": ""+this.courseInfo.name,
|
||||||
"aid":this.userInfo.aid, //当前登录人的id
|
"aid":this.userInfo.aid, //当前登录人的id
|
||||||
"aname":this.userInfo.name,//当前人的姓名
|
"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=>{
|
apiStat.sendEvent(postData).then(rs=>{
|
||||||
if(rs.status == 200) {
|
if(rs.status == 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user