diff --git a/src/components/Course/myNote.vue b/src/components/Course/myNote.vue index 81174dce..d5db7ade 100644 --- a/src/components/Course/myNote.vue +++ b/src/components/Course/myNote.vue @@ -45,7 +45,7 @@
+ @click="onPlayVideo(note.contentId,note.playTime)"> {{formatSeconds(note.playTime)}}
@@ -82,7 +82,7 @@
- 视频位置 公开 私密 @@ -120,13 +120,14 @@ export default { isEdit:false, courseId:'', inAnimation: false, + btnPlayTime:false,//是否显示添加视频时间 radio: '1', notetab: 1, autoSave: null, mynoteData: { type: 1, //我发布的是1 我导入的是2 content: '', - playTime: '', + playTime: 0, courseId: '',// 课程id contentId: '',//课程内容id courseName: '',// 课程名称 @@ -155,13 +156,14 @@ export default { // this.mynoteData.contentId = this.data.id; } }, - intTimeNote(val) { - this.mynoteData.playTime = val; - } + // intTimeNote(val) { + // this.mynoteData.playTime = val; + // } }, methods: { - onPlayVideo(time) { - this.$emit('onPlayVideo', time); + onPlayVideo(conId,time) { + //这里应该加上内容的id + this.$emit('onPlayVideo',conId,time); }, formatSeconds(value) { let result = parseInt(value) @@ -177,6 +179,14 @@ export default { } return res; }, + showVideoTimeBtn(showOrHidden){ + this.btnPlayTime=showOrHidden; + }, + //设置音视频的时间,引用页面调用 + setVideoTime(contentId,time){ + this.mynoteData.contentId=contentId;//内容id + this.mynoteData.playTime=time;//秒 + }, timeDel() { this.mynoteData.playTime = 0; }, diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 88be09f9..a1afd20a 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -65,7 +65,7 @@
{{ contentData.contentName }}
-
@@ -140,7 +140,7 @@
-
@@ -378,7 +378,8 @@ } }) }, - onPlayVideo(time){ + onPlayVideo(contentId,time){ + //这里需要根据contentId,是否切换到对应的内容的视频的时间 this.playerBoxShow = false; this.notePlay = null; setTimeout(() => { @@ -387,7 +388,9 @@ }, // 笔记功能 videoLocation() { // 记录笔记视频位置 - this.$store.dispatch("SetIntTimeNote", this.intTimeNote); + //this.$store.dispatch("SetIntTimeNote", this.intTimeNote); + console.log(this.contentData.id+'='+this.intTimeNote,'设置视频播放时间') + this.$refs.mynote.setVideoTime(this.contentData.id,this.intTimeNote); }, coutab(n) { this.courestab =n; @@ -406,7 +409,7 @@ } else { this.blobUrl = process.env.VUE_APP_BASE_API + '/xboe/m/course/cware/resource?sign=' + urlSign; } - //console.log(this.blobUrl,'this.blobUrl'); + console.log(this.blobUrl,'this.blobUrl'); }, widthOpen(url) { window.open(url, '_blank'); @@ -458,6 +461,7 @@ this.playerBoxShow = false; //显示内容部分 + this.$refs.mynote.showVideoTimeBtn(false); let $this = this; this.resType = r.contentType; this.contentData = r; @@ -470,6 +474,7 @@ } else { this.curriculumData.url = r.content; } + this.$refs.mynote.showVideoTimeBtn(true); //let url=process.env.VUE_APP_BASE_API+'/xboe/m/course/file/show?cf='+this.curriculumData.url; //let url=this.fileBaseUrl+this.curriculumData.url; this.createPlayUrl(r.contentRefId, this.curriculumData.url);