video_course.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="video_contianer">
  3. <el-card>
  4. <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
  5. @invalid="handleInvalidQuery"
  6. ></mx-condition>
  7. </el-card>
  8. <!-- 视频主体 -->
  9. <el-card class="video_content" v-if="videoList.length > 0">
  10. <div slot="header">
  11. <mx-search-group justify="end" :span="6" v-model="sectionName" placeholder="请输入搜索内容" @search="searchVideo">
  12. </mx-search-group>
  13. </div>
  14. <el-row :gutter="20">
  15. <el-col
  16. :span="6"
  17. class="video_item"
  18. v-for="item in videoList"
  19. :key="item.id"
  20. >
  21. <img
  22. :src="item.img"
  23. alt=""
  24. @click="
  25. toVideoDetail(
  26. item.pack_id,
  27. item.chapter_id,
  28. item.id,
  29. item.section_aliId,
  30. item.aliIdType
  31. )
  32. "
  33. />
  34. <p class="fx-row jc-between ai-center">
  35. <span class="text-ellipsis"> {{ item.section_name }} </span>
  36. <span class="pointer iconfont icon-shoucang"></span>
  37. </p>
  38. </el-col>
  39. </el-row>
  40. <!-- 分页 -->
  41. <div class="split_page">
  42. <pagination
  43. v-show="total > 0"
  44. :total="total"
  45. :page.sync="pageForm.pageNum"
  46. :limit.sync="pageForm.pageSize"
  47. :pageSizes="[16,32]"
  48. @pagination="getVideoList"
  49. />
  50. </div>
  51. </el-card>
  52. <evaluation-empty v-if="videoList.length == 0"/>
  53. </div>
  54. </template>
  55. <script>
  56. import { videoList } from '@/api/webApi/webVideo'
  57. import MxSearchGroup from '@/components/MxSearch/mx-search-group'
  58. import MxCondition from '@/components/MxCondition/mx-condition'
  59. export default {
  60. components: { MxSearchGroup, MxCondition },
  61. data() {
  62. return {
  63. pageForm: {
  64. pageNum: 1,
  65. pageSize: 16
  66. },
  67. sectionName: '',
  68. queryParams: {
  69. videoType: '',
  70. videoCourse: '',
  71. videoGrade: '',
  72. videoVersion: '',
  73. videoPack: ''
  74. },
  75. requireFields: ['videoType', 'videoCourse',
  76. 'videoGrade',
  77. 'videoVersion',
  78. 'videoPack'
  79. ],
  80. total: 0,
  81. packNewList: [],
  82. videoList: [] // 视频列表
  83. }
  84. },
  85. methods: {
  86. handleInvalidQuery() {
  87. },
  88. toVideoDetail(id, chapter_id, childrenId, section_aliId, aliIdType) {
  89. this.$router.push({
  90. path: '/video_course/detail', query: {
  91. packId: id,
  92. chapter_id: chapter_id,
  93. childrenId: childrenId,
  94. section_aliId,
  95. aliIdType: aliIdType
  96. }
  97. })
  98. },
  99. handleQuery() {
  100. this.getVideoList()
  101. },
  102. searchVideo() {
  103. this.getVideoList()
  104. },
  105. // 获取视频列表
  106. getVideoList() {
  107. videoList({
  108. course: this.queryParams.videoCourse, // 科目
  109. subject: this.queryParams.videoType, // 大类
  110. grade: this.queryParams.videoGrade, // 年级
  111. version: this.queryParams.videoVersion, // 版本
  112. pack: this.queryParams.videoPack,
  113. ...this.pageForm,
  114. sectionName: this.sectionName
  115. }).then((res) => {
  116. this.total = res.total
  117. this.videoList = res.rows
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style scoped>
  124. .el-card {
  125. margin-bottom: 32px;
  126. }
  127. .video_contianer {
  128. padding: 20px;
  129. }
  130. .video_item > img {
  131. cursor: pointer;
  132. }
  133. .video_content .el-col {
  134. margin-bottom: 42px;
  135. }
  136. .video_item{
  137. border-radius: 4px;
  138. }
  139. .video_item > img {
  140. width: 100%;
  141. }
  142. .video_item >p{
  143. padding:5px 10px;
  144. box-shadow: 0px 1px 4px 0px rgba(47,78,154,0.14);
  145. }
  146. </style>