diff --git a/src/api/phase2/stat.js b/src/api/phase2/stat.js index 8a52f762..11fb7a21 100644 --- a/src/api/phase2/stat.js +++ b/src/api/phase2/stat.js @@ -126,7 +126,7 @@ const getRanking = function(queryData) { * @param {String} aid 用户的id */ const getUserStatTotalInfo = function(aid) { - return ajax.get(baseURL,'/xboe/m/stat/user/getUserStatTotalInfo?aid='+aid); + return ajax.get(baseURL,'/xboe/m/stat/user/statinfo?aid='+aid); } diff --git a/src/components/UcHeader/Index.vue b/src/components/UcHeader/Index.vue index 22baf9f6..9fd40317 100644 --- a/src/components/UcHeader/Index.vue +++ b/src/components/UcHeader/Index.vue @@ -20,16 +20,16 @@
{{userInfo.name}}
{{orgInfo}}
-
{{userData.level}}
- 经验值:{{userData.evalue}} +
{{statData.level}}
+ 经验值:{{statData.evalue}}
编辑资料
-
- - - +
+
+ +
更多
@@ -43,25 +43,25 @@
当月学习时长
-
{{uinfo.monthStudy}}h
+
{{statData.monthStudyHour}}h
累计学习时长
-
{{uinfo.monthTotal}}h
+
{{statData.totalStudyHour}}h
当月学习天数
-
{{uinfo.monthDay}}
+
{{statData.monthStudyDays}}
累计学习天数
-
{{uinfo.monthTotalDay}}
+
{{statData.totalStudyDays}}
我的U币(累计)
-
{{uinfo.uCurrency}}
+
{{statData.uvalue}}
@@ -86,19 +86,18 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js"; data(){ return { fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL, - uinfo:{ - monthStudy:0,//当月学习时长 - monthTotal: 0, - monthDay:0, - monthTotalDay:0, - uCurrency:0 + statData:{ + evalue: 0,//经验值 + level: "LV1",//级别 + monthStudyHour:0,//当月学习时长 + totalStudyHour: 0, //累计学习时长 + monthStudyDays:0, //当月学习天数 + totalStudyDays:0, //累计学习天数 + uvalue:0 //U币数量 }, + medalList:[],//勋章信息 orgInfo:'', - sex:'', - userData:{ - evalue: 0, - level: "", - } + sex:'' } }, mounted() { @@ -110,37 +109,25 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js"; //let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心'; //this.orgInfo=cutFullName(testName,1); this.orgInfo=cutFullName(this.userInfo.departFullName,1); - this.getInfo(); - this.getLevel(); + this.loadUserStat(); + }, methods:{ - getLevel(){//获取经验值和等级 + loadUserStat(){//获取经验值和等级 apiStart.getUserStatTotalInfo(this.userInfo.aid).then(res=>{ if(res.status == 200) { - this.userData.evalue = res.result.experienceValue; - this.userData.level = res.result.level; + this.statData.evalue = res.result.evalue; + this.statData.level = res.result.level; + this.statData.monthStudyHour = res.result.monthStudyHour; + this.statData.totalStudyHour = res.result.totalStudyHour; + this.statData.monthStudyDays = res.result.monthStudyDays; + this.statData.totalStudyDays = res.result.totalStudyDays; + this.statData.uvalue = res.result.uvalue; + this.medalList=res.result.medalList; } }); }, - getInfo(){ - apiStart.userTotal(this.userInfo.aid,[10,11,30]).then(res=>{ - if(res.status == 200 && res.result.length > 0) { - res.result.forEach(item => { - if(item.statType == 10) { - this.uinfo.monthStudy = item.months; - this.uinfo.monthTotal = item.total; - } - if(item.statType == 11) { - this.uinfo.monthDay = item.months; - this.uinfo.monthTotalDay = item.total; - } - if(item.statType == 30) { - this.uinfo.uCurrency = item.total; - } - }); - } - }) - }, + setCurIdentity(iden){ this.$store.dispatch('SetCurIdentity',iden); }, @@ -199,14 +186,18 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js"; .content-bottom{ margin-top: 30px; display: flex; - .medal{ - // float: left; - img{ - width: 36px; - height: 40px; - margin-right: 10px; - vertical-align: top; - } + .medal-list{ + //float: left; + display: flex; + .medal-info{ + img{ + width: 36px; + height: 40px; + margin-right: 10px; + vertical-align: top; + } + } + } .medalbutt{ @@ -427,7 +418,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js"; margin-right: 12px; } } - + .personalData{ .uesr-avaer{ margin-right: 10px; diff --git a/src/views/medal/Index.vue b/src/views/medal/Index.vue index 5ceb4819..b4913d66 100644 --- a/src/views/medal/Index.vue +++ b/src/views/medal/Index.vue @@ -10,16 +10,16 @@
-

{{item.medalName}}

+

{{item.medalName}}

您已超过{{item.exceed}}人

查看详情
- +

你目前还没有勋章哦~

-
+
@@ -40,28 +40,18 @@ - + - + - + - + @@ -69,7 +59,7 @@
- + - + - \ No newline at end of file diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index a1afd20a..afca6a4b 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -117,7 +117,7 @@
-
+
{{item.section.name}}
@@ -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 += + '
' + + this.userInfo.name + this.userInfo.loginName + '
'; + } + 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 += - '
' + - this.userInfo.name + this.userInfo.loginName + '
'; - } - 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 - }, + } }, } @@ -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;