调整用户统计数据,用户勋章

This commit is contained in:
daihh
2022-10-10 12:32:24 +08:00
parent 168d11bf49
commit d74e487e49
4 changed files with 134 additions and 137 deletions

View File

@@ -117,7 +117,7 @@
</div>
<!-- 课程单元 -->
<div class="course-units" v-if="tab == 1">
<div style="min-height: 200px;overflow-y: auto;">
<div style="max-height: 500px;overflow-y: auto;">
<div class="catalog" v-if="courseInfo.type == 20">
<div v-for="(item, index) in catalogTree" :key="index" :name="index">
<div style="margin: 10px 0px;font-weight: 700;">{{item.section.name}}</div>
@@ -326,6 +326,8 @@
completed: [],
tab: 1,
notetab: 1,
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
localTimeValue:0,//计算的时间
}
},
mounted() {
@@ -369,6 +371,21 @@
}
},
methods: {
/**
* 定时保存学习时长,每5秒保存在本地每1分钟保存到服务端清空本地数据
* 如果一进入,本地数据存在,就先保存到服务器,然后再重新计算时长
*/
autoLocalStudying(){
},
autoSaveStudying(){
let timeStr = localStorage.getItem(this.localTimeKey);
if(timeStr){
let timeJson=JSON.parse(timeStr);
}
},
//关注功能
toFollow(item) {
apiFollow.save(item.teacherId).then(res => {
if (res.status == 200) {
@@ -378,16 +395,19 @@
}
})
},
//笔记组件触发,播放指定时间
onPlayVideo(contentId,time){
//这里需要根据contentId,是否切换到对应的内容的视频的时间
//如果 contentId已经不存在需要提示
this.playerBoxShow = false;
this.notePlay = null;
let $this=this;
setTimeout(() => {
this.notePlay = time;
}, 1000)
$this.notePlay = time;
}, 500)
},
// 笔记功能
videoLocation() { // 记录笔记视频位置
//笔记组件触发,记录当前播放时间
videoLocation() {
//this.$store.dispatch("SetIntTimeNote", this.intTimeNote);
console.log(this.contentData.id+'='+this.intTimeNote,'设置视频播放时间')
this.$refs.mynote.setVideoTime(this.contentData.id,this.intTimeNote);
@@ -712,9 +732,48 @@
}
});
},
ctabChange(e) {
//当前已经不再使用
//console.log(e);
onPlayerPlay() {
//console.log("开始播放");
this.playerBoxShow = false;
let $this = this;
//console.log(this.contentData.status,'this.contentData.status');
// if(this.contentData.status<9){
// let completeType=this.curriculumData.completeSetup;
// //console.log(completeType,'completeType');
// if(completeType==0){
// //默认5秒后学习完成.
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
// }else{
// //先记录进行中的学习内容
// this.saveStudyItem();
// }
// }
},
onFullscreen(full) {
let divId = 'videowatermark';
var div = document.getElementById('myVideoPlayer')
if (full) {
var div3 = document.createElement("div");
div3.id = divId;
div3.setAttribute("class", "fullmark");
div3.innerHTML = '';
//从父组件传过来的水印内容
//div3.innerText =this.userInfo.name+this.userInfo.code;
for (var i = 0; i < 8; i++) {
div3.innerHTML +=
'<div style="color:#ffffff;width: 40%;height: 155px;padding-left:60px;padding-top:50px; display: flex;justify-content: center; transform: rotate(-36deg);font-size:20px;">' +
this.userInfo.name + this.userInfo.loginName + '</div>';
}
div3.style.cssText =
"position:absolute;pointer-events: none; width: 100%;height: 100%;top:0;left:0;bottom: 0;right: 0; display: flex;justify-content: center;flex-wrap: wrap;overflow: hidden; opacity:0.3;padding-top:10px";
div.appendChild(div3);
} else {
var markDiv = div.querySelector("#" + divId);
if (markDiv) {
div.removeChild(markDiv);
}
}
},
onPlayerPause() {
//console.log("暂停");
@@ -1016,6 +1075,7 @@
}
//首先从本地读取
let duration = studyUtil.getStudyDuration();
//追加学习时间
let $this = this;
if (this.appendStartTime == null) {
@@ -1063,48 +1123,7 @@
$this.appendStudyTime();
}, $this.appentInterval);
},
onPlayerPlay() {
//console.log("开始播放");
this.playerBoxShow = false;
let $this = this;
//console.log(this.contentData.status,'this.contentData.status');
// if(this.contentData.status<9){
// let completeType=this.curriculumData.completeSetup;
// //console.log(completeType,'completeType');
// if(completeType==0){
// //默认5秒后学习完成.
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
// }else{
// //先记录进行中的学习内容
// this.saveStudyItem();
// }
// }
},
onFullscreen(full) {
let divId = 'videowatermark';
var div = document.getElementById('myVideoPlayer')
if (full) {
var div3 = document.createElement("div");
div3.id = divId;
div3.setAttribute("class", "fullmark");
div3.innerHTML = '';
//从父组件传过来的水印内容
//div3.innerText =this.userInfo.name+this.userInfo.code;
for (var i = 0; i < 8; i++) {
div3.innerHTML +=
'<div style="color:#ffffff;width: 40%;height: 155px;padding-left:60px;padding-top:50px; display: flex;justify-content: center; transform: rotate(-36deg);font-size:20px;">' +
this.userInfo.name + this.userInfo.loginName + '</div>';
}
div3.style.cssText =
"position:absolute;pointer-events: none; width: 100%;height: 100%;top:0;left:0;bottom: 0;right: 0; display: flex;justify-content: center;flex-wrap: wrap;overflow: hidden; opacity:0.3;padding-top:10px";
div.appendChild(div3);
} else {
var markDiv = div.querySelector("#" + divId);
if (markDiv) {
div.removeChild(markDiv);
}
}
},
finishStudyItem() { //设置完成学习的内容,针对于音视频的内容
if (!this.contentData.studyItemId) {
//这种可能没有不过这里也是为了万中那个1
@@ -1164,10 +1183,7 @@
},
heartabtwo() {
this.tab = 2
},
notetab1(num) {
this.notetab = num
},
}
},
}
</script>
@@ -1740,13 +1756,14 @@
height: 60px;
line-height: 60px;
font-size: 16px;
cursor: pointer;
}
.units-active {
background: #F6F6F6;
color: #387DF7;
font-weight: 600;
cursor: text;
img {
width: 18px;
height: 20px;