|
|
@@ -1,17 +1,79 @@
|
|
|
<template>
|
|
|
<GlobalHeader/>
|
|
|
- <p style="text-align: center; font-weight: bolder; font-size: xxx-large">全部课程页(预计有大改动)</p>
|
|
|
- <img alt="err" src="@/assets/coursePage.png" style="width: 100%">
|
|
|
+ <div id="course-page-body">
|
|
|
+ <el-tabs v-model="activeTab">
|
|
|
+ <el-tab-pane class="course-page-main" label="全部课程" name="first">
|
|
|
+ <CourseCard v-for="course in courses_show" :key="course.id" :courseVO="course"/>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane v-if="courses_my.length!==0" class="course-page-main" label="我的课程" name="second">
|
|
|
+ <CourseCard v-for="course in courses_my" :key="course.id" :courseVO="course"/>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane v-else class="course-page-main" label="我的课程" name="second" style="display: flex; flex-direction: column; justify-content: center;align-items: center;margin-top: 16vh">
|
|
|
+ <svg class="icon" height="128" viewBox="0 0 1024 1024" width="128" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path
|
|
|
+ d="M909.016 820.828H841a30 30 0 0 1 0-60h38.016a20 20 0 0 0 20-20V145.185a20 20 0 0 0-20-20H352a20 20 0 0 0-20 20v28h370.016a50 50 0 0 1 50 50v223.36a29.989 29.989 0 1 1-59.507 5.283h-0.493V253.185a20
|
|
|
+ 20 0 0 0-20-20H145a20 20 0 0 0-20 20v625.643a20 20 0 0 0 20 20h337a30 30 0 0 1 0 60H115a50 50 0 0 1-50-50V223.185a50 50 0 0 1 50-50h157v-58a50 50 0 0 1 50-50h587.016a50 50 0 0 1 50 50v655.643a50 50 0 0 1-50 50z m-663.037-484H572.74a29.979 29.979 0 1 1 0
|
|
|
+ 59.957H245.979a29.979 29.979 0 1 1 0-59.957z m0 290.043h74.912a29.979 29.979 0 0 1 29.979 29.978 29.979 29.979 0 0 1-29.979
|
|
|
+ 29.979h-74.912A29.979 29.979 0 0 1 216 656.849a29.979 29.979 0 0 1 29.979-29.978zM216 511.807a29.979 29.979 0 0 1 29.979-29.979h140.935a29.979 29.979 0 0 1 29.979 29.979v0.042a29.979 29.979 0 0 1-29.979 29.979H245.979A29.979 29.979 0 0 1 216 511.849v-0.042z m163 177.521c0-107.419
|
|
|
+ 87.081-194.5 194.5-194.5S768 581.909 768 689.328a193.618 193.618 0 0 1-37.9 115.356l84.115 84.115a30 30 0 1 1-42.425 42.429l-84.3-84.3a193.6 193.6 0 0 1-113.99 36.9c-107.419 0-194.5-87.081-194.5-194.5z m194.5 134.5a134.5 134.5 0 1 0-134.5-134.5 134.5 134.5 0 0 0 134.5 134.5z"
|
|
|
+ fill="#bfbfbf"></path>
|
|
|
+ </svg>
|
|
|
+ <div>
|
|
|
+ 暂无数据
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ <GlobalFooter/>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import GlobalHeader from "@/components/GlobalHeader";
|
|
|
+import GlobalFooter from "@/components/GlobalFooter";
|
|
|
+import CourseCard from "@/components/CourseCard";
|
|
|
+
|
|
|
export default {
|
|
|
name: "CoursePage",
|
|
|
- components: { GlobalHeader }
|
|
|
+ components: { CourseCard, GlobalFooter, GlobalHeader },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeTab: "first",
|
|
|
+ courses_all: [],
|
|
|
+ courses_my: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ courses_show() {
|
|
|
+ return this.courses_all;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ // await this.$apis.getAllCourses().then(res => {
|
|
|
+ // this.courseList = res.data.data;
|
|
|
+ // });
|
|
|
+ this.courses_all = this.$apis.getAllCourses().data.data;
|
|
|
+ for (let i = 3 - this.courses_all.length % 3; i !== 0; i--) {
|
|
|
+ this.courses_all.push(this.courses_all[0]);
|
|
|
+ }
|
|
|
+ if (this.$store.state.user.token) {
|
|
|
+ this.courses_my = this.$apis.getStudentCourses({ "studentId": this.$store.state.user.id }).then(res => {
|
|
|
+ this.courses_my = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+#course-page-body {
|
|
|
+ padding: 20px 180px 80px 180px;
|
|
|
+ min-height: calc(100vh - 340px);
|
|
|
+}
|
|
|
|
|
|
+.course-page-main {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
|
+ grid-gap: 20px 20px;
|
|
|
+}
|
|
|
</style>
|