index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="cs-item-detail-container">
  3. <div>
  4. <span>讲次详情</span>
  5. <div class="cs-item-info">
  6. <el-row>
  7. <el-col :span="21">
  8. {{ CSItemInfoBox.date_stamp }} {{ CSItemInfoBox.minute_space }}
  9. </el-col>
  10. <el-col :span="3" class="col_right">
  11. 任务{{
  12. CSItemInfoBox.finish_status === 0
  13. ? '未开始'
  14. : CSItemInfoBox.finish_status === 1
  15. ? '已开始'
  16. : '已结束'
  17. }}
  18. </el-col>
  19. </el-row>
  20. <el-row class="cs-item-name">
  21. <el-col>{{ CSItemInfoBox.name }}</el-col>
  22. </el-row>
  23. <el-row class="cs-item-class-name">
  24. <el-col :span="20">{{ CSItemInfoBox.class_name }}</el-col>
  25. <el-col :span="4">
  26. <el-button plain @click.prevent="jumpLiveRoom">进入直播教室</el-button></el-col
  27. >
  28. </el-row>
  29. </div>
  30. </div>
  31. <classroom-task
  32. :pre-task-list="CSItemInfoBox.pre_task_list"
  33. :mid-task-list="CSItemInfoBox.mid_task_list"
  34. :after-task-list="CSItemInfoBox.after_task_list"
  35. />
  36. <!--学习资料-->
  37. <div class="learning-material">
  38. <div class="learning-material-title">学习资料</div>
  39. <div>
  40. <el-row>
  41. <el-col class="learning-material-upload" :span="24">
  42. <el-upload action="/"><el-button>上传文件</el-button></el-upload>
  43. </el-col>
  44. </el-row>
  45. <el-tag
  46. class="learning-material-tag"
  47. v-for="(list, i) in CSItemInfoBox.learning_material_list"
  48. :key="i"
  49. type="info"
  50. ><a href="list.file_url" target="_blank">{{ list.file_url }}</a></el-tag
  51. >
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import { getCSItemInfoBox } from '@/api/table';
  58. import { createEnterLiveRoomLink } from '@/api/live';
  59. import ClassroomTask from './ClassroomTask';
  60. export default {
  61. data() {
  62. return {
  63. id: this.$route.params.id,
  64. CSItemInfoBox: {
  65. class_name: '',
  66. date_stamp: '',
  67. finish_status: 0,
  68. minute_space: '',
  69. name: '',
  70. pre_task_list: [],
  71. mid_task_list: [],
  72. after_task_list: [],
  73. learning_material_list: []
  74. }
  75. };
  76. },
  77. components: {
  78. ClassroomTask
  79. },
  80. mounted() {
  81. getCSItemInfoBox({ id: this.id }).then(response => {
  82. this.CSItemInfoBox = Object.assign(this.CSItemInfoBox, response);
  83. });
  84. },
  85. methods: {
  86. jumpLiveRoom() {
  87. createEnterLiveRoomLink({ cs_item_id: this.id }).then(response => {
  88. window.open(response.live_room_url, '_blank');
  89. });
  90. }
  91. }
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. @import '~@/styles/mixin.scss';
  96. .cs-item-detail-container {
  97. @include contanier;
  98. .cs-item-info {
  99. width: 100%;
  100. height: 122px;
  101. padding: 15px 28px 20px 45px;
  102. margin-top: 11px;
  103. background-color: #eee;
  104. .col_right {
  105. text-align: right;
  106. }
  107. .cs-item-name {
  108. padding: 16px 0;
  109. }
  110. .cs-item-class-name {
  111. color: #a4a4a4;
  112. .el-button {
  113. position: relative;
  114. top: -24px;
  115. right: -32px;
  116. }
  117. }
  118. }
  119. }
  120. .learning-material {
  121. &-title {
  122. padding-top: 12px;
  123. }
  124. &-tag {
  125. @include el-tag;
  126. margin-top: 16px;
  127. height: 40px;
  128. line-height: 40px;
  129. }
  130. &-upload {
  131. padding-top: 27px;
  132. }
  133. }
  134. </style>