mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-18 15:26:45 +08:00
调整用户统计数据,用户勋章
This commit is contained in:
@@ -10,16 +10,16 @@
|
||||
<div class="medal-list" v-if="medalData.length > 0">
|
||||
<div class="medal-index" v-for="item in medalData" :key="item.id">
|
||||
<medal-img :item="item"></medal-img>
|
||||
<p class="index-title">{{item.medalName}}</p>
|
||||
<p class="index-title">{{item.medalName}}</p>
|
||||
<p class="index-text">您已超过{{item.exceed}}人</p>
|
||||
<el-button class="btn" type="primary" @click="goView(item)">查看详情</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div v-else class="home-no-list">
|
||||
<img class="img" style="width:360px;height:226px" src="/images/homeWu/no-madel.png" alt="" srcset="">
|
||||
<p class="text" style="color: #333333;margin-top:50px;font-size: 14px">你目前还没有勋章哦~</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog class="medal-dialog" title="提示" :visible.sync="dialogVisible" width="657px" top="200px">
|
||||
<div class="medal-box">
|
||||
<div class="medal-top">
|
||||
@@ -40,28 +40,18 @@
|
||||
<el-table
|
||||
:data="rules"
|
||||
style="width: 100%;height:200px;overflow-y: auto;">
|
||||
<el-table-column
|
||||
prop="name" angin="center"
|
||||
label="勋章"
|
||||
width="80">
|
||||
<el-table-column prop="name" angin="center" label="勋章" width="80">
|
||||
<template slot-scope="scope">
|
||||
<img style="width:40px;height:40px" src="/images/medal.png" alt="" srcset="">
|
||||
<!-- <medal-img class="table-medal" style="width:46px;height:52px" :item="medal"></medal-img> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="level" angin="center"
|
||||
label="等级"
|
||||
width="80">
|
||||
<el-table-column prop="level" angin="center" label="等级" width="80">
|
||||
<template slot-scope="scope">LV{{scope.row.level}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark" angin="center"
|
||||
label="获得条件">
|
||||
<el-table-column prop="remark" angin="center" label="获得条件">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="num" angin="center" width="120"
|
||||
label="获得人数">
|
||||
<el-table-column prop="num" angin="center" width="120" label="获得人数">
|
||||
<template slot-scope="scope">{{scope.row.num?scope.row.num:0}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -69,7 +59,7 @@
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import apiStat from '@/api/phase2/stat.js';
|
||||
import MedalImg from '@/components/Portal/medalImg.vue';
|
||||
@@ -127,7 +117,7 @@
|
||||
goView(item) {
|
||||
this.dialogVisible = true;
|
||||
this.medal = item;
|
||||
|
||||
|
||||
let data = this.medalConfig.find(it=>it.id ==item.medalId);
|
||||
this.rules = JSON.parse(data.rules);
|
||||
apiStat.userMedalLevelInfo(item.medalId).then(res=>{
|
||||
@@ -160,7 +150,7 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .table-medal{
|
||||
.medal-text{
|
||||
@@ -174,7 +164,7 @@
|
||||
.medal-dialog{
|
||||
::v-deep .el-dialog__header{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
::v-deep .el-dialog__body{
|
||||
background: rgba(216, 216, 216, 0.1);
|
||||
padding: 0;
|
||||
@@ -216,7 +206,7 @@
|
||||
.el-step__line{
|
||||
background-color: #387DF7;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
::v-deep .el-step__title.is-finish{
|
||||
font-size: 16px;
|
||||
@@ -275,7 +265,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.medal-box{
|
||||
padding: 30px 70px;
|
||||
.medal-list{
|
||||
@@ -286,8 +276,8 @@
|
||||
width: 144px;
|
||||
margin: 40px 60px 0 60px;
|
||||
text-align: center;
|
||||
|
||||
|
||||
|
||||
|
||||
.index-title{
|
||||
margin-top: 26px;
|
||||
font-size: 18px;
|
||||
@@ -339,4 +329,3 @@
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user