From 2dc9bcdbd391dbda465a5d5e7bd936d71ae33785 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 11 Jul 2024 19:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PortalHeader.vue | 60 ++++++- src/components/UserCenter/menu.vue | 38 ++++- src/views/exam/ExamList.vue | 7 +- src/views/study/Courses.vue | 241 +++++++++++++++-------------- src/views/user/ranking.vue | 22 +-- 5 files changed, 227 insertions(+), 141 deletions(-) diff --git a/src/components/PortalHeader.vue b/src/components/PortalHeader.vue index 001cd067..bfa452e3 100644 --- a/src/components/PortalHeader.vue +++ b/src/components/PortalHeader.vue @@ -147,6 +147,9 @@ import yearMedal from '@/components/Popup/China2023.vue'; import apiBoeCourse from '@/api/boe/course.js'; import {userAvatarText} from "@/utils/tools.js"; import apiCase from "@/api/modules/cases.js"; +import apiManage from '@/api/manage/manage.js' +import {getList} from '@/api/growth' +import apiCourseStudy from '@/api/modules/courseStudy.js'; export default { props: { current: { @@ -202,16 +205,64 @@ export default { keyword: '', isTiao: false, sex:'', + fistTotals: 0, + pathTotals: 0, + growTotal: 0, + nums: 0, + courseNum: 0, }; }, + created() { + this.learnTotal() + }, mounted() { this.sex = this.userInfo.sex; this.$store.dispatch('refrashMsg'); - this.loadBoeData(); + // this.loadBoeData(); //this.loadPopupConfig(); }, methods: { - + learnTotal(){ + let params = { + pageNo: 1, + pageSize: 10, + cmtask_user_status: "", + cmtask_name: "" + } + let reqData={ + courseName:'', + courseType:'', + status:'', + progress:'', + pageIndex:1, + pageSize:10 + } + const promises = [ + //领导力 + apiManage.leadership(params).then(res=>{ + this.fistTotals =parseInt(res.data.total); + }), + //学习路径 + apiManage.compulsoryList(params).then(res=>{ + this.pathTotals =parseInt(res.data.total); + }), + getList(this.userInfo.aid).then(res=>{ + if(res.code == 200 && Object.keys(res.data).length){ + this.growTotal = 1 + }else{ + this.growTotal = 0 + } + }), + apiCourseStudy.myStudysFromES(reqData).then(res=>{ + this.courseNum = res.result.count; + sessionStorage.setItem('courseNums',this.courseNum) + }) + ] + Promise.all(promises).then(() => { + this.nums = this.fistTotals + this.pathTotals + this.growTotal; + this.loadBoeData(); + }); + }, setCurIdentity(iden){ this.$store.dispatch('SetCurIdentity',iden); }, @@ -219,10 +270,11 @@ export default { console.log('lll') }, loadBoeData() { - if(this.studyTaskCount>0){ + if(this.nums>0){ this.isTiao = true; + }else if (this.nums == 0 && this.courseNum>0){ + this.isTiao = false; }else{ - // this.isTiao = false; this.isTiao = true; } // let params = { diff --git a/src/components/UserCenter/menu.vue b/src/components/UserCenter/menu.vue index 4ac046f8..c7986897 100644 --- a/src/components/UserCenter/menu.vue +++ b/src/components/UserCenter/menu.vue @@ -298,7 +298,7 @@ 我的必修 - +