manage.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div class="manage-page">
  3. <Header
  4. title="Some very nice course name"
  5. exitLink="/instructor/courses">
  6. <template #actionMenu>
  7. <div class="full-page-takeover-header-button">
  8. <button
  9. @click="() => {}"
  10. class="button is-primary is-inverted is-medium is-outlined">
  11. Save
  12. </button>
  13. </div>
  14. </template>
  15. </Header>
  16. <div class="course-manage">
  17. <div class="container">
  18. <div class="columns">
  19. <div class="column is-3 p-lg">
  20. <!-- <aside class="menu is-hidden-mobile"> -->
  21. <aside class="menu">
  22. <p class="menu-label">
  23. Course Editing
  24. </p>
  25. <ul class="menu-list">
  26. <li>
  27. <!-- display TargetStudents -->
  28. <a @click.prevent="navigateTo(1)"
  29. :class="activeComponentClass(1)">Target Your Students
  30. </a>
  31. </li>
  32. <li>
  33. <!-- display LandingPage -->
  34. <a
  35. :class="activeComponentClass(2)"
  36. @click.prevent="navigateTo(2)">
  37. Course Landing Page
  38. </a>
  39. </li>
  40. </ul>
  41. <p class="menu-label">
  42. Course Managment
  43. </p>
  44. <ul class="menu-list">
  45. <li>
  46. <!-- display Price -->
  47. <a
  48. :class="activeComponentClass(3)"
  49. @click.prevent="navigateTo(3)">
  50. Price
  51. </a>
  52. </li>
  53. <li>
  54. <!-- display Status -->
  55. <a
  56. :class="activeComponentClass(4)"
  57. @click.prevent="navigateTo(4)">
  58. Status
  59. </a>
  60. </li>
  61. </ul>
  62. </aside>
  63. </div>
  64. <div class="column">
  65. <!--
  66. <TargetStudents/>
  67. <LandingPage/>
  68. <Price/>
  69. <Status/> -->
  70. <keep-alive>
  71. <component
  72. @courseValueUpdated="handleCourseUpdate"
  73. :is="activeComponent"
  74. :course="course"/>
  75. </keep-alive>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import Header from '~/components/shared/Header'
  84. import TargetStudents from '~/components/instructor/TargetStudents'
  85. import LandingPage from '~/components/instructor/LandingPage'
  86. import Price from '~/components/instructor/Price'
  87. import Status from '~/components/instructor/Status'
  88. import MultiComponentMixin from '~/mixins/MultiComponentMixin'
  89. import { mapState } from 'vuex'
  90. export default {
  91. layout: 'instructor',
  92. components: {
  93. Header,
  94. TargetStudents,
  95. LandingPage,
  96. Price,
  97. Status
  98. },
  99. mixins: [MultiComponentMixin],
  100. data() {
  101. return {
  102. steps : ['TargetStudents', 'LandingPage', 'Price', 'Status'],
  103. }
  104. },
  105. async fetch({store, params}) {
  106. console.log('course/_id/manage.vue fetch call')
  107. const result = await store.dispatch('instructor/course/fetchCourseById', params.id)
  108. console.log('course/_id/manage.vue fetch done', result)
  109. },
  110. computed: {
  111. ...mapState({
  112. course: ({instructor}) => instructor.course.item
  113. })
  114. },
  115. methods: {
  116. handleCourseUpdate({value, field}){
  117. this.$store.dispatch('instructor/course/updateCourseValue', {field, value})
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss">
  123. .manage-page {
  124. .label-info {
  125. font-size: 13px;
  126. color: gray;
  127. font-style: italic;
  128. }
  129. .course-manage {
  130. padding-top: 40px;
  131. .menu {
  132. padding-top: 30px;
  133. &-label {
  134. font-size: 20px;
  135. color: black;
  136. }
  137. &-list {
  138. >li {
  139. font-size: 18px;
  140. margin-top: 10px;
  141. > a {
  142. &.is-active {
  143. border-left: 3px solid #58529f;
  144. background-color: transparent;
  145. color: inherit;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. .card {
  152. &-section {
  153. padding: 40px;
  154. }
  155. &-header {
  156. &-title {
  157. padding: 0;
  158. color: #8F99A3;
  159. font-weight: 400;
  160. font-size: 25px;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>