diff --git a/.gitignore b/.gitignore index 07e6e472..d808aa0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,32 @@ -/node_modules +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +fe-manage.iml +package-lock.json +src/api/config.js +src/api/config.js +src/api/config.js +src/api/config.js +fe-manage-develop.iml + +yarn.lock diff --git a/public/images/courseBanner.png b/public/images/courseBanner.png new file mode 100644 index 00000000..f4a383d4 Binary files /dev/null and b/public/images/courseBanner.png differ diff --git a/public/images/listblue011.png b/public/images/listblue011.png new file mode 100644 index 00000000..92525c4e Binary files /dev/null and b/public/images/listblue011.png differ diff --git a/public/images/listblue012.png b/public/images/listblue012.png new file mode 100644 index 00000000..3ef0bd51 Binary files /dev/null and b/public/images/listblue012.png differ diff --git a/public/images/listblue013.png b/public/images/listblue013.png new file mode 100644 index 00000000..f66f6597 Binary files /dev/null and b/public/images/listblue013.png differ diff --git a/public/images/listblue014.png b/public/images/listblue014.png new file mode 100644 index 00000000..bb1c209b Binary files /dev/null and b/public/images/listblue014.png differ diff --git a/public/images/listblue015.png b/public/images/listblue015.png new file mode 100644 index 00000000..e35f1c07 Binary files /dev/null and b/public/images/listblue015.png differ diff --git a/src/api/phase2/index.js b/src/api/phase2/index.js index d0103c62..4bc77a58 100644 --- a/src/api/phase2/index.js +++ b/src/api/phase2/index.js @@ -1,4 +1,6 @@ import ajax from '@/utils/xajax.js' +import http from '../unionAjax' +const baseURL = process.env.VUE_APP_MANAGER_API_PATH; /** @@ -45,6 +47,12 @@ const articlelist=function (type){ const courselist=function (data){ return ajax.post('/xboe/portal/index/courselist',data); } +/** + * 首页新课程推荐列表 + */ +const getRecommendList=function (pageNum,pageSize){ + return http.get(baseURL,`/recommend/studentPage?pageNum=${pageNum}&pageSize=${pageSize}`); +} export default { cases, @@ -52,5 +60,6 @@ export default { qaAnswers, articlelist, courselist, - newCases + newCases, + getRecommendList } diff --git a/src/assets/images/course/courserecommended.png b/src/assets/images/course/courserecommended.png new file mode 100644 index 00000000..92e139e6 Binary files /dev/null and b/src/assets/images/course/courserecommended.png differ diff --git a/src/assets/styles/portal-index.scss b/src/assets/styles/portal-index.scss index 9249734d..2a041f48 100644 --- a/src/assets/styles/portal-index.scss +++ b/src/assets/styles/portal-index.scss @@ -509,11 +509,17 @@ } } } + .reviewTop{ + margin-top: 20px; + } .xindex-ranking-li{ margin-top:15px; } + .xindex-ranking-review{ + height: 186px; + } .xindex-ranking-course{ - height: 465px; + height: 452px; } .xindex-ranking-case{ @@ -777,8 +783,14 @@ .xindex-ranking-li{ margin-top:20px; } + .reviewTop{ + margin-top: 20px; + } + .xindex-ranking-review{ + height: 204px; + } .xindex-ranking-course{ - height: 509px; + height: 508px; } .xindex-ranking-case{ @@ -1059,8 +1071,14 @@ .xindex-ranking-li{ margin-top:30px; } + .reviewTop{ + margin-top: 30px; + } + .xindex-ranking-review{ + height: 249px; + } .xindex-ranking-course{ - height: 592px; + height: 598px; } .xindex-ranking-case{ @@ -1324,8 +1342,14 @@ .xindex-ranking-li{ margin-top:30px; } + .reviewTop{ + margin-top: 36px; + } + .xindex-ranking-review{ + height: 272px; + } .xindex-ranking-course{ - height: 614px; + height: 650px; } .xindex-ranking-case{ diff --git a/src/router/index.js b/src/router/index.js index c380c7e7..93c303bb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -110,6 +110,20 @@ export const constantRoutes = [{ name: 'course', meta: { title: '课程', keepAlive: true, icon: 'dashboard', noCache: true, affix: false }, }, +{ + path: '/courseRecommended', + hidden: true, + component: (resolve) => require(['@/views/portal/course/CourseRecommended'], resolve), + name: 'courseRecommended', + meta: { title: '推荐课程', keepAlive: true, icon: 'dashboard', noCache: true, affix: false }, +}, +{ + path: '/courseSeries', + hidden: true, + component: (resolve) => require(['@/views/portal/course/CourseSeries'], resolve), + name: 'courseSeries', + meta: { title: '系列课程', keepAlive: true, icon: 'dashboard', noCache: true, affix: false }, +}, { path: '/course/micro', hidden: true, diff --git a/src/store/modules/sysType.js b/src/store/modules/sysType.js index 9c242a49..020bd984 100644 --- a/src/store/modules/sysType.js +++ b/src/store/modules/sysType.js @@ -17,15 +17,15 @@ const mutations={ const actions={ getSysTypeTree({commit}) { return new Promise((resolve,reject)=>{ - if(state.sysTypeTree.length>0){ - resolve(state.sysTypeTree); - }else{ - let hasData = sessionStorage.getItem('sysTypeTree'); - if(hasData){ - let treeData = JSON.parse(hasData); - commit('setSysTypeTree', treeData); - resolve(treeData); - }else{ + // if(state.sysTypeTree.length>0){ + // resolve(state.sysTypeTree); + // }else{ + // let hasData = sessionStorage.getItem('sysTypeTree'); + // if(hasData){ + // let treeData = JSON.parse(hasData); + // commit('setSysTypeTree', treeData); + // resolve(treeData); + // }else{ apiType.tree(1).then(res=>{ if(res.status === 200) { sessionStorage.setItem('sysTypeTree',JSON.stringify(res.result)); @@ -51,8 +51,8 @@ const mutations={ reject('资源归属获取失败!'); } }) - } - } + // } + // } }); }, loadSysTypes(context){ diff --git a/src/views/Index.vue b/src/views/Index.vue index 04fe9860..f994f04a 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -211,7 +211,7 @@ -->
+ +
+
+ + +
+ +
+ + 录播课 +
+
+ {{ course.name }} +
+
+
+ {{ course.authorInfo.name }} + {{ formatNum(course.studys) }}人学习 +
+
+
+ {{ toScore(course.score) }}分 +
+
未评分
+
+
+
+
+ +
+
+ + + +
+ +
+ + 录播课 +
+
+ {{ course.name }} +
+
+
+ {{ course.authorInfo.name }} + + {{ formatNum(course.studys) }}人学习 +
+
+
+ {{ toScore(course.score) }}分 +
+
未评分
+
+
+
+
-

课程排行榜

+

课程热度榜

+
+

课程好评榜

+ +
@@ -947,6 +1074,7 @@ export default { }, data() { return { + Positive:[], showUClass: false, showLoginMedal: false, //是否显示登录勋章 needLoginMedal: false, //是否需要显示纪念勋章 @@ -968,6 +1096,7 @@ export default { ankingList: [], answersList: [], Popularity: [], + reviewList:[],//好评 scorelist: [], resonimg: [], swiperOptiontwo: { @@ -1004,6 +1133,10 @@ export default { orderType: 2, list: [], }, + // 推荐课程 + recommendedList:{ + list: [], + }, caseList: { num: 3, orderType: 2, @@ -1027,6 +1160,8 @@ export default { }, mounted() { this.getCourseData(1); + this.getRecommendList(); + this.getPositive() this.getCaseData(); this.getArticleData(); this.getQaData(); @@ -1082,8 +1217,22 @@ export default { swiper() { return this.$refs.mySwiper.swiper; }, + courseComputedOneList(){ + return this.courseList.list.slice(0,3) + }, + courseComputedTwoList(){ + return this.courseList.list.slice(3) + }, }, methods: { + getPositive() { + apiCase.queryComments(10).then(res => { + if (res.status == 200) { + this.Positive = res.result; + console.log(res); + } + }); + }, tylClick() { window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130"); }, @@ -1280,6 +1429,29 @@ export default { if (this.isNext) { this.getCourseData(this.pageIndex); } + }, + // 获取推荐课程list + getRecommendList(){ + apiIndex.getRecommendList(1,3).then((res) => { + if(res.code === 200){ + console.log(res.data.records); + let courseIds = []; + res.data.records.forEach((item) => { + item.authorInfo = { + aid: "", + name: "", + orgInfo: "", + avatar: "", + code: "", + sex: null, + }; + courseIds.push(item.id); + }); + this.loadCouserTeacher(res.data.records, courseIds); + console.log(res.result,'lalalala'); + this.recommendedList.list = res.data.records + } + }) }, getCourseData(pageIndex) { this.isNext = false; diff --git a/src/views/course/ManageList.vue b/src/views/course/ManageList.vue index 5e758490..c25cd97c 100644 --- a/src/views/course/ManageList.vue +++ b/src/views/course/ManageList.vue @@ -404,6 +404,7 @@ export default { this.getResOwnerTree().then(rs=>{ this.resOwnerListMap=rs; }); + // 取消全局课程分类 this.getSysTypeTree().then(rs=>{ this.sysTypeListMap=rs; }) diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index 6d975239..5480b78c 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -4,6 +4,43 @@
+ +
@@ -211,6 +248,7 @@
+
@@ -265,10 +303,6 @@
- - - -
@@ -361,6 +395,8 @@ export default { }, data() { return { + twoId:'', + treeList:[], caseType:process.env.VUE_APP_CASE_TYPE,//类型 caseYears:[], refId: '',//消息跳转案例的id @@ -413,6 +449,9 @@ export default { notInIds: [],//重复的id orderField: "id", orderAsc: false,//排序 + sysType1:'', + sysType2:'', + sysType3:'' }, keyWord: "", anking: 2, @@ -478,6 +517,29 @@ export default { list.push(item); } }); + this.treeList.forEach(one => { + var twoChildChecked = false;//是否有下级 + one.children && one.children.forEach(two => { + if (two.checked) { + twoChildChecked = true; + } + var threeChildChecked = false; + two.children && two.children.forEach(three => { + if (three.checked) { + list.push(three); + threeChildChecked = true; + } + }); + if (two.checked && !threeChildChecked) { + list.push(two); + } + }); + if (one.checked && !twoChildChecked) { + list.push(one); + } + }) + console.log(list,'计算属性'); + return list; }, oneTagAll() { @@ -626,9 +688,11 @@ export default { if (this.refId) { this.queryCondition.type = 'recommend' } + this.loadTypeData();//加载分类 this.getAnkingData(); - this.getPopularity(); this.searchterm(); + //打开排行榜下边的两个 + this.getPopularity(); this.getPositive(); this.couresreso(); // window.addEventListener("scroll", this.handleScroll); @@ -642,6 +706,67 @@ export default { }, methods: { + handleOptionClick(treeItem){ + this.treeList.forEach(one => { + one.checked = false; + if (one.id == treeItem.id) { + one.checked = true; + this.queryCondition.sysType2 = '' + this.queryCondition.sysType3 = '' + this.queryCondition.sysType1 = one.id + } + one.children.forEach(two => { + two.checked = false; + if (two.id == treeItem.id) { + two.checked = true + this.queryCondition.sysType1 = '' + this.queryCondition.sysType3 = '' + this.queryCondition.sysType2 = two.id + } + two.children.forEach(three => { + three.checked = false; + if (three.id == treeItem.id) { + three.checked = true + this.queryCondition.sysType1 = '' + this.queryCondition.sysType2 = '' + this.queryCondition.sysType3 = three.id + } + }) + }) + }) + this.getCaseData() + }, + // 移入 + changeIndex(twoId) { + this.twoId = twoId + }, + // 移除 + leaveIndex() { + this.twoId = '' + }, + // 加载分类 + async loadTypeData() { + try { + const { result, status } = await apiType.tree(1); + if (status === 200) { + result.forEach(one => { + one.checked = false; + if(!one.children) one.children = [] + one.children && one.children.forEach(two => { + two.checked = false; + if(!two.children) two.children = [] + two.children && two.children.forEach(three => { + three.checked = false; + if(!three.children) three.children = [] + }) + }) + }) + this.treeList = result + } + } catch (error) { + console.log(error); + } + }, getYears() { apiCase.caseYears().then(res => { if (res.status == 200) { @@ -1232,7 +1357,16 @@ export default { // } // }, tagsClose(tag, index) { - tag.fielclass = false; + // 课程分类 + if(tag.hasOwnProperty('checked')){ + tag.checked = false; + this.queryCondition.sysType1 ='' + this.queryCondition.sysType2 ='' + this.queryCondition.sysType3 ='' + }else{ + // 案例分类 + tag.fielclass = false; + } if (tag.type == 0) { this.keyWord = ''; } @@ -1334,6 +1468,77 @@ export default { diff --git a/src/views/portal/course/CourseSeries.vue b/src/views/portal/course/CourseSeries.vue new file mode 100644 index 00000000..49d8e33d --- /dev/null +++ b/src/views/portal/course/CourseSeries.vue @@ -0,0 +1,297 @@ + + + diff --git a/src/views/portal/course/Index.vue b/src/views/portal/course/Index.vue index a512a0e9..39b0f4c0 100644 --- a/src/views/portal/course/Index.vue +++ b/src/views/portal/course/Index.vue @@ -21,6 +21,10 @@
+
课程分类
@@ -663,18 +667,18 @@ export default { localSessionKey: this.$xpage.constants.localCourseFiltersKey }; }, - - created() { - let localKey = "user_" + this.userInfo.sysId + "_gids"; - apiUserbasic.getInAudienceIds().then(rs => { - if (rs.status == 200) { - this.audiences = rs.result; - sessionStorage.setItem(localKey, this.audiences); - } else { - console.log(rs.message); - } - }) - }, + // 受众需要每次刷新 + // created() { + // let localKey = "user_" + this.userInfo.sysId + "_gids"; + // apiUserbasic.getInAudienceIds().then(rs => { + // if (rs.status == 200) { + // this.audiences = rs.result; + // sessionStorage.setItem(localKey, this.audiences); + // } else { + // console.log(rs.message); + // } + // }) + // }, mounted() { let screenWidth = window.screen.availWidth; // if (screenWidth < 1280) { @@ -715,38 +719,38 @@ export default { // this.toCourseDetail(item); // this.orderChange(id); //查询排行榜,页面打开只查询一次 - // let localKey = "user_" + this.userInfo.sysId + "_gids"; - // if (this.audiences.length == 0) { - // //let hasIds; - // let hasIds = sessionStorage.getItem(localKey); - // if (hasIds && hasIds.length > 0) { - // this.audiences = hasIds.split(","); - // this.search(); - // } else { - // apiUserbasic.getInAudienceIds().then(rs => { - // if (rs.status == 200) { - // this.audiences = rs.result; - // sessionStorage.setItem(localKey, this.audiences); - // } else { - // console.log(rs.message); - // } - // // this.search(); - // }) - // // Promise.all([apiOldCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{ - // // //console.log(rs,'rs'); - // // let aids=[]; - // // if(rs[0].status==200){ - // // aids.push(rs[0].result); - // // } - // // if(rs[1].status==200){ - // // aids.push(rs[1].result); - // // } - // // this.audiences=aids; - // // sessionStorage.setItem(localKey,this.audiences); - // // this.search(); - // // }) - // } - // } + let localKey = "user_" + this.userInfo.sysId + "_gids"; + if (this.audiences.length == 0) { + //let hasIds; + let hasIds = sessionStorage.getItem(localKey); + if (hasIds && hasIds.length > 0) { + this.audiences = hasIds.split(","); + this.search(); + } else { + apiUserbasic.getInAudienceIds().then(rs => { + if (rs.status == 200) { + this.audiences = rs.result; + sessionStorage.setItem(localKey, this.audiences); + } else { + console.log(rs.message); + } + this.search(); + }) + // Promise.all([apiOldCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{ + // //console.log(rs,'rs'); + // let aids=[]; + // if(rs[0].status==200){ + // aids.push(rs[0].result); + // } + // if(rs[1].status==200){ + // aids.push(rs[1].result); + // } + // this.audiences=aids; + // sessionStorage.setItem(localKey,this.audiences); + // this.search(); + // }) + } + } //this.searchterm();//搜索词已经没有了 this.couresreso();//广告位 @@ -1080,7 +1084,7 @@ export default { }); this.loadLocalFilters(); - this.search() + // this.search() } } catch (error) { console.log(error); @@ -1577,6 +1581,15 @@ export default { } // 三级背景高度 +.course-recommended-style{ + position: relative; + height: 142px; + background-image: url('../../../assets/images/course/courserecommended.png'); + background-repeat: no-repeat; + background-size: 100% 100%; + display: flex; + align-items: center; +} .course-title-style { position: relative; height: 100px; diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index a2a48b0c..3440d781 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -491,10 +491,11 @@ } }); //每一分钟保存一次 - let $this=this; - this.appendStudyOtherHandle = setTimeout(function() { - $this.appendStudyOtherTime(); - }, 1000*60); + // 取消阅读的每分钟六十秒的计时 + // let $this=this; + // this.appendStudyOtherHandle = setTimeout(function() { + // $this.appendStudyOtherTime(); + // }, 1000*60); }, //笔记组件触发,播放指定时间