Merge branch 'zcwy-master' into 'master'

Zcwy master

See merge request !111
This commit is contained in:
joshen
2024-05-27 21:16:15 +08:00
4 changed files with 80 additions and 4 deletions

View File

@@ -60,6 +60,10 @@
content:{ content:{
type: Object, type: Object,
default: ()=>{} default: ()=>{}
},
courseType:{
type: String,
default: 0
} }
}, },
data(){ data(){
@@ -159,6 +163,19 @@
this.$message.error(res.message); this.$message.error(res.message);
} }
}) })
if(this.courseType == 20){
let params = {
studyId: this.studyId, //学习id,
courseId: this.content.courseId, //课程id,
contentId: this.content.id, //内容id,
contentType: '',
contentName: '', //内容名称
progress: 100,
status: 9,
contentTotal: ''
};
apiCourseStudy.studyContent(params)
}
} }
} }
} }

View File

@@ -152,6 +152,10 @@ export default {
showTest:{ showTest:{
type:Boolean, type:Boolean,
default:false default:false
},
courseType:{
type: String,
default:0
} }
}, },
data() { data() {
@@ -512,6 +516,33 @@ export default {
}, },
submitTest(testScore){ //提交处理 submitTest(testScore){ //提交处理
//清空提示 //清空提示
if(this.courseType == 20){
if(testScore<80){
const params = {
studyId: this.studyId, //学习id,
courseId: this.content.courseId, //课程id,
contentId: this.content.id, //内容id,
contentType: '',
contentName: '', //内容名称
progress: 1,
status: 2,
contentTotal: ''
};
apiStudy.studyContent(params)
}else{
const params = {
studyId: this.studyId, //学习id,
courseId: this.content.courseId, //课程id,
contentId: this.content.id, //内容id,
contentType: '',
contentName: '', //内容名称
progress: 100,
status: 9,
contentTotal: ''
};
apiStudy.studyContent(params)
}
}
if(this.timer){ if(this.timer){
window.clearInterval(this.timer); window.clearInterval(this.timer);
} }

View File

@@ -24,6 +24,7 @@
height="100%" height="100%"
@waiting="onWaiting" @waiting="onWaiting"
@playing="onPlaying" @playing="onPlaying"
@timeupdate="onAudioTimeUpdate"
> >
<source :src="src" /> <source :src="src" />
</video> </video>
@@ -561,6 +562,10 @@ export default {
this.isPlaying = true; this.isPlaying = true;
this.videoDom.play(); this.videoDom.play();
}, },
onAudioTimeUpdate() {
const currentTime = this.$refs.video.currentTime;
this.$emit('onTimeUpdate', currentTime);
},
}, },
watch: { watch: {
currentVolume: function () { currentVolume: function () {

View File

@@ -30,7 +30,7 @@
<videoPlayer ref="myVideoPlayer" id="myVideoPlayer" :src="blobUrl" @onPlayerPlaying="onPlayerPlaying" <videoPlayer ref="myVideoPlayer" id="myVideoPlayer" :src="blobUrl" @onPlayerPlaying="onPlayerPlaying"
:initTime="contentData.lastStudyTime" :notePlay="notePlay" @onPlayerPlay="onPlayerPlay" :initTime="contentData.lastStudyTime" :notePlay="notePlay" @onPlayerPlay="onPlayerPlay"
:isDrag="curriculumData.isDrag" @onFullscreen="onFullscreen" @onPlayerPause="onPlayerPause" :isDrag="curriculumData.isDrag" @onFullscreen="onFullscreen" @onPlayerPause="onPlayerPause"
@onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd"></videoPlayer> @onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd" @onTimeUpdate="handleAudioTimeUpdate"></videoPlayer>
<div class="player-box" v-if="playerBoxShow"> <div class="player-box" v-if="playerBoxShow">
<div class="player-praise" style="cursor: pointer;"> <div class="player-praise" style="cursor: pointer;">
<div @click="praiseContent"> <div @click="praiseContent">
@@ -102,10 +102,10 @@
<homework v-if="resType == 60 && studyId != ''" :studyId="studyId" :content="contentData"></homework> <homework v-if="resType == 60 && studyId != ''" :studyId="studyId" :content="contentData"></homework>
</div> </div>
<div v-if="resType == 61"> <div v-if="resType == 61">
<exam v-if="resType == 61 && studyId != '' " :studyId="studyId" :content="contentData"></exam> <exam v-if="resType == 61 && studyId != '' " :studyId="studyId" :courseType="courseType" :content="contentData"></exam>
</div> </div>
<div v-if="resType == 62" style="padding:5px"> <div v-if="resType == 62" style="padding:5px">
<assess v-if="resType == 62 && studyId != '' && contentData.id" :studyId="studyId" :content="contentData"> <assess v-if="resType == 62 && studyId != '' && contentData.id" :courseType="courseType" :studyId="studyId" :content="contentData">
</assess> </assess>
</div> </div>
</div> </div>
@@ -320,6 +320,8 @@
}, },
data() { data() {
return { return {
courseType: 0,
trueFalse: true,
audiences:'', audiences:'',
isCrowd:false, isCrowd:false,
cutOrgNamePath, cutOrgNamePath,
@@ -444,6 +446,7 @@
} }
treeList.push(treeNode); treeList.push(treeNode);
}); });
console.log(treeList,'treeList')
return treeList; return treeList;
} }
}, },
@@ -1188,6 +1191,8 @@
audiences:this.audiences audiences:this.audiences
}).then(rs => { }).then(rs => {
if (rs.status == 200) { if (rs.status == 200) {
this.courseType = rs.result.course.type
this.contentStudysLength = rs.result.contentStudys
if(rs.result.contents.length==0){ if(rs.result.contents.length==0){
$this.$message.error('课程内容已删除或课程已不再使用'); $this.$message.error('课程内容已删除或课程已不再使用');
return; return;
@@ -1582,7 +1587,25 @@
}, },
heartabtwo() { heartabtwo() {
this.tab = 2 this.tab = 2
} },
handleAudioTimeUpdate(currentTime) {
// if(this.contentStudysLength.length == 0){
let params = {
studyId: this.studyId, //学习id,
courseId: this.courseId, //课程id,
contentId: this.contentData.id, //内容id,
contentType: this.contentData.contentType,
contentName: this.contentData.contentName, //内容名称
progress: 1,
status: 2,
contentTotal: this.totalContent
};
if(currentTime > 2 && this.trueFalse){
apiStudy.studyContent(params)
this.trueFalse = false
}
// }
},
}, },
} }
</script> </script>