From 2dceb63d96e05876da7af207ff6752a97e8bcdbf Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 21 Apr 2023 14:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 3 + src/pages/course/list/index.vue | 20 +++- src/pages/station/list/index.vue | 146 ++++++++++++++++++---------- src/pages/station/preview/index.vue | 5 + src/setting.js | 2 +- 5 files changed, 124 insertions(+), 52 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 634a2a6..2425ef5 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -67,12 +67,15 @@ export default { // 课程学习 pageConditionalQueryCourseByStudent: `occupationlab/occupationlab/theoreticalCourse/pageConditionalQueryCourseByStudent`, + collectCourse: `occupationlab/occupationlab/theoreticalCourse/collectCourse`, listClassification: `occupationlab/occupationlab/theoreticalCourseClassification/pagingQuery`, findByIdCourse: `occupationlab/occupationlab/theoreticalCourse/findById`, playRecordSave: `occupationlab/occupationlab/playRecord/save`, studentLoginPreCourse: `occupationlab/occupationlab/theoreticalCourse/studentLoginPreCourse`, getRedisCache: `occupationlab/occupationlab/theoreticalCourse/getRedisCache`, getSubsection: `occupationlab/occupationlab/theoreticalCourseSubsection/getSubsection`, + recentUse: `nakadai/nakadai/curriculum/recentUse`, + recordRecentUsage: `nakadai/nakadai/curriculum/recordRecentUsage`, // 资讯 queryAllColumns: `occupationlab/occupationlab/information/column/queryAllColumns`, // 栏目树 diff --git a/src/pages/course/list/index.vue b/src/pages/course/list/index.vue index 3fef552..ca29762 100644 --- a/src/pages/course/list/index.vue +++ b/src/pages/course/list/index.vue @@ -13,7 +13,7 @@
-
+
课程分类:
不限
{{ item.classificationName }}
@@ -38,6 +38,9 @@ {{ item.pageviews }}
+
+ +
{{ item.schoolName }} @@ -77,6 +80,10 @@ export default { { id: 0, name: '共享课程' + }, + { + id: 2, + name: '我的收藏' } ], form: { @@ -109,7 +116,7 @@ export default { }, mounted() { // 登录后的课程才需要展示本校课程 - this.isTourist || this.tabs.push({ + this.isTourist || this.tabs.splice(1, 0, { id: 1, name: '本校课程' }) @@ -199,6 +206,12 @@ export default { this.page = val; this.getData(); }, + // 收藏 + collect(item) { + this.$post(`${this.api.collectCourse}?courseId=${item.id}&state=${item.collectionStatus ? 0 : 1}`).then(res => { + this.getData() + }).catch(res => {}) + }, toDetail(id) { this.$router.push(`/${this.isTourist ? 'preCourse' : 'course'}/details?id=${id}&source=${this.active}`); } @@ -369,6 +382,9 @@ export default { color: #a9a9a9; font-size: 12px; } + .collect { + font-size: 20px; + } &:hover { box-shadow: 0px 5px 12px 4px rgba(142, 123, 253, 0.09), 0px 3px 6px 0px rgba(142, 123, 253, 0.12), 0px 1px 2px -2px rgba(142, 123, 253, 0.16); img { diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index b3943f1..e995ffa 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -9,7 +9,11 @@
-
+
+ +