index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <top topType="1" @search="search"></top>
  7. </el-col>
  8. <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
  9. <van-tabs v-model="active">
  10. <van-tab title="文字">
  11. <list type="1" :list="oneList"></list>
  12. </van-tab>
  13. <van-tab title="图片">
  14. <list type="2" :list="twoList"></list>
  15. </van-tab>
  16. <van-tab title="科普视频">
  17. <list type="3" :list="thrList"></list>
  18. </van-tab>
  19. <van-tab title="培训视频">
  20. <list type="4" :list="fourList"></list>
  21. </van-tab>
  22. </van-tabs>
  23. </el-col>
  24. <el-col :span="24" class="foot">
  25. <page limit="5" :total="total" @search="search"></page>
  26. </el-col>
  27. </el-col>
  28. </el-row>
  29. </div>
  30. </template>
  31. <script>
  32. import list from './parts/list.vue';
  33. import top from '@/layout/common/top.vue';
  34. import page from '@/layout/common/page.vue';
  35. import { mapState, createNamespacedHelpers } from 'vuex';
  36. export default {
  37. name: 'index',
  38. props: {},
  39. components: {
  40. top,
  41. page,
  42. list,
  43. },
  44. data: function() {
  45. return {
  46. clientHeight: '',
  47. // 文章菜单
  48. active: 0,
  49. // 文字
  50. oneList: [
  51. {
  52. title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
  53. origin: '信息来源',
  54. renew_time: '2021-03-30 10:00:00',
  55. read: 10000,
  56. },
  57. {
  58. title: '信息标题',
  59. origin: '信息来源',
  60. renew_time: '2021-03-30 10:00:00',
  61. read: 10,
  62. },
  63. ],
  64. // 图片
  65. twoList: [
  66. {
  67. title: '信息标题',
  68. origin: '信息来源',
  69. read: 10,
  70. imgUrl: require('@a/news1.jpg'),
  71. },
  72. {
  73. title: '信息标题',
  74. origin: '信息来源',
  75. read: 10,
  76. },
  77. ],
  78. // 科普
  79. thrList: [
  80. {
  81. title: '全球粮价波动将影响国内?商务部食用农产品间隔难以大幅度',
  82. fileUrl: require('@a/video1.mp4'),
  83. origin: '不知道',
  84. renew_time: '2021-03-25 21:12:44',
  85. read: 10000,
  86. },
  87. ],
  88. // 培训
  89. fourList: [
  90. {
  91. title: '全球粮价波动将影响国内?商务部食用农产品间隔难以大幅度',
  92. fileUrl: require('@a/video1.mp4'),
  93. origin: '不知道',
  94. renew_time: '2021-03-25 21:12:44',
  95. read: 10000,
  96. },
  97. ],
  98. // 总数
  99. total: 0,
  100. };
  101. },
  102. async created() {
  103. await this.search();
  104. },
  105. mounted() {
  106. let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 80;
  107. this.$set(this, `clientHeight`, clientHeight);
  108. },
  109. methods: {
  110. search({ skip = 0, limit = 10, searchName, ...info } = {}) {
  111. console.log();
  112. },
  113. },
  114. computed: {
  115. ...mapState(['user']),
  116. },
  117. metaInfo() {
  118. return { title: this.$route.meta.title };
  119. },
  120. watch: {
  121. test: {
  122. deep: true,
  123. immediate: true,
  124. handler(val) {},
  125. },
  126. },
  127. };
  128. </script>
  129. <style lang="less" scoped>
  130. .main {
  131. .top {
  132. height: 40px;
  133. overflow: hidden;
  134. border-bottom: 1px solid #f1f1f1;
  135. }
  136. .info {
  137. overflow-x: hidden;
  138. overflow-y: auto;
  139. background-color: #f9f9f9;
  140. }
  141. .foot {
  142. height: 40px;
  143. overflow: hidden;
  144. border-top: 1px solid #f1f1f1;
  145. }
  146. }
  147. </style>