index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div id="index">
  3. <el-col :span="24" class="main">
  4. <el-col :span="24" class="info" style="padding:30px">
  5. <el-tabs>
  6. <el-tab-pane label="正在直播" name="0">
  7. <list :list="listNow" :total="nowTotal" status="1" @query="searchList"></list>
  8. </el-tab-pane>
  9. <el-tab-pane label="下期直播" name="1">
  10. <list :list="listPre" :total="preTotal" status="0" @query="searchList"></list>
  11. </el-tab-pane>
  12. <el-tab-pane label="已往直播" name="2">
  13. <list :list="listPast" :total="pastTotal" status="2" @query="searchList"></list>
  14. </el-tab-pane>
  15. </el-tabs>
  16. </el-col>
  17. </el-col>
  18. </div>
  19. </template>
  20. <script>
  21. import _ from 'lodash';
  22. import list from './parts/list.vue';
  23. import { mapState, createNamespacedHelpers } from 'vuex';
  24. const { mapActions: dock } = createNamespacedHelpers('dock');
  25. export default {
  26. name: 'index',
  27. props: {},
  28. components: { list },
  29. data: () => ({
  30. squareImage: require('@/assets/live/square_big.png'),
  31. menuIndex: '0',
  32. menuName: '直播列表',
  33. menuColor: 'rgb(254, 149, 14)',
  34. pageSize: 10,
  35. limit: 10,
  36. hangyeList: [],
  37. listPre: [],
  38. preTotal: 0,
  39. listNow: [],
  40. nowTotal: 0,
  41. listPast: [],
  42. pastTotal: 0,
  43. liveIndex: '',
  44. }),
  45. created() {
  46. this.searchList({ status: '0' });
  47. this.searchList({ status: '1' });
  48. this.searchList({ status: '2' });
  49. },
  50. computed: {
  51. pageTitle() {
  52. return `${this.$route.meta.title}`;
  53. },
  54. },
  55. metaInfo() {
  56. return { title: this.$route.meta.title };
  57. },
  58. methods: {
  59. ...dock({ dockQuery: 'query' }),
  60. async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
  61. let res = await this.dockQuery({ is_allowed: 1, skip, limit, status, ...info });
  62. if (res.errcode === 0) {
  63. if (status == '0') {
  64. console.log(res.total);
  65. this.$set(this, `preTotal`, res.total);
  66. this.$set(this, `listPre`, res.data);
  67. } else if (status == '1') {
  68. this.$set(this, `nowTotal`, res.total);
  69. this.$set(this, `listNow`, res.data);
  70. } else {
  71. console.log(res.data);
  72. this.$set(this, `pastTotal`, res.total);
  73. this.$set(this, `listPast`, res.data);
  74. }
  75. }
  76. },
  77. async initList({ name, skip = 0, limit = 10, ...info } = {}) {
  78. this.$set(this, `pageTotal`, res.total);
  79. },
  80. handleCurrentChange(val) {
  81. this.limit = 5;
  82. this.initList({ skip: (val - 1) * this.limit, limit: this.limit });
  83. },
  84. turnTo(item) {
  85. this.$router.push({ path: '/live/hallDetail', query: { id: item.id } });
  86. },
  87. },
  88. };
  89. </script>
  90. <style lang="less" scoped>
  91. .main {
  92. // width: 80%;
  93. width: 1200px;
  94. margin: 0 auto;
  95. float: none;
  96. }
  97. .menu {
  98. float: left;
  99. height: 450px;
  100. width: 20%;
  101. background: no-repeat bottom right;
  102. background-image: url(../../assets/live/menu_back.jpg);
  103. margin: 30px 0;
  104. padding: 10px 0 0 10px;
  105. box-sizing: border-box;
  106. box-shadow: 0 0 10px #bbbaba;
  107. }
  108. .menu .el-image {
  109. width: 30px;
  110. display: inline-table;
  111. margin: 10px 5px;
  112. }
  113. .menu span {
  114. font-size: 24px;
  115. color: #92959a;
  116. font-weight: 600;
  117. margin-left: 3px;
  118. position: relative;
  119. top: 10px;
  120. }
  121. .menuList p {
  122. line-height: 60px;
  123. font-size: 18px;
  124. cursor: pointer;
  125. border-bottom: 1px solid #2d64b3;
  126. color: #044b79;
  127. font-weight: 600;
  128. }
  129. .info {
  130. width: 100%;
  131. float: right;
  132. margin: 30px 0 30px 2px;
  133. height: 585px;
  134. box-shadow: 0 0 10px #2d64b3;
  135. overflow: hidden;
  136. right: 0px;
  137. background: #ffffff;
  138. }
  139. .leftInfo {
  140. height: 500px;
  141. overflow: hidden;
  142. }
  143. .leftTop {
  144. font-size: 18px;
  145. width: 96%;
  146. height: 41px;
  147. line-height: 35px;
  148. border-bottom: 1px solid #e5e5e5;
  149. position: relative;
  150. bottom: 1px;
  151. margin: 10px;
  152. font-weight: 600;
  153. color: #22529a;
  154. }
  155. .page {
  156. text-align: center;
  157. margin: 10px 0;
  158. }
  159. </style>