|
|
@@ -0,0 +1,104 @@
|
|
|
+<template>
|
|
|
+ <div class="course-layout">
|
|
|
+ <div class="menu-section">
|
|
|
+ <div class="menu-sticky">
|
|
|
+ <div class="header-logo">MOOC</div>
|
|
|
+ <div class="course-detail">
|
|
|
+ {{ course.name }}
|
|
|
+ <b-loading :is-full-page="false" :active.sync="isLoading"></b-loading>
|
|
|
+ </div>
|
|
|
+ <slot />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="router-section"><router-view /></div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { FETCH_CURRENT_COURSE } from "@/store/type/actions.type";
|
|
|
+import { mapState } from "vuex";
|
|
|
+
|
|
|
+export default {
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ course: state => state.course.currentCourse
|
|
|
+ })
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLoading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ const { courseId } = this.$route.params;
|
|
|
+ this.isLoading = true;
|
|
|
+ await this.$store.dispatch(FETCH_CURRENT_COURSE, courseId);
|
|
|
+ this.isLoading = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../assets/scss/app.scss";
|
|
|
+
|
|
|
+$menu-width: 300px;
|
|
|
+$menu-padding: 24px;
|
|
|
+$screen-width: 1450px;
|
|
|
+$left-padding: "(100% -" #{$screen-width} "-" #{$menu-padding} "* 2) / 2";
|
|
|
+$left-width: #{$left-padding} + #{$menu-width};
|
|
|
+$left-padding-calc: calc(#{$left-padding});
|
|
|
+$left-width-calc: calc(#{$left-width});
|
|
|
+$top-section-height: 4.25rem;
|
|
|
+
|
|
|
+.course-layout {
|
|
|
+ display: flex;
|
|
|
+ min-height: 100vh;
|
|
|
+ justify-content: stretch;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.router-section {
|
|
|
+ padding: 24px;
|
|
|
+ flex-grow: 1;
|
|
|
+ max-width: 1000px;
|
|
|
+}
|
|
|
+.menu-section {
|
|
|
+ min-width: $menu-width;
|
|
|
+ width: $left-width-calc;
|
|
|
+ background: white;
|
|
|
+ border-right: 1px solid #c9d8ea;
|
|
|
+ padding-left: $left-padding-calc;
|
|
|
+ .menu-sticky {
|
|
|
+ width: $menu-width;
|
|
|
+ position: sticky;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0 $menu-padding;
|
|
|
+ top: 0;
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+ .header-logo {
|
|
|
+ font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
|
|
|
+ "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
|
|
|
+ Helvetica, Arial, sans-serif;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 1.7em;
|
|
|
+ color: #3d70b2;
|
|
|
+ padding-right: 20px;
|
|
|
+ line-height: $top-section-height;
|
|
|
+ a {
|
|
|
+ color: #3d70b2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .course-detail {
|
|
|
+ position: relative;
|
|
|
+ padding: 15px;
|
|
|
+ background: #f4f7fb;
|
|
|
+ border: 1px solid #c9d8ea;
|
|
|
+ border-radius: 3px;
|
|
|
+ box-shadow: 0 1px 2px rgba(201, 216, 234, 0.5);
|
|
|
+ margin-bottom: 1em;
|
|
|
+ min-height: 54px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|