index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div id="index">
  3. <admin-frame :useTop="false" :usePage="false" :useNav="false">
  4. <template v-slot:info>
  5. <van-col span="24" class="one">
  6. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  7. <van-swipe-item v-for="(item, index) in imageList" :key="index">
  8. <van-image :src="item.url"></van-image>
  9. </van-swipe-item>
  10. </van-swipe>
  11. </van-col>
  12. <van-col span="24" class="two">
  13. <van-grid :gutter="5" :column-num="2">
  14. <van-grid-item class="list" v-for="(item, index) in menu" :key="index" :to="item.router">
  15. <p>{{ item.label }}</p>
  16. </van-grid-item>
  17. </van-grid>
  18. </van-col>
  19. </template>
  20. </admin-frame>
  21. </div>
  22. </template>
  23. <script>
  24. import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
  25. import { mapState, createNamespacedHelpers } from 'vuex';
  26. export default {
  27. name: 'index',
  28. props: {},
  29. components: {
  30. adminFrame,
  31. },
  32. data: function () {
  33. return {
  34. // 轮播图
  35. imageList: [{ url: require('@a/lab-2.png') }],
  36. menu: [
  37. {
  38. label: '社会服务活动',
  39. router: '/learning/sociology/index',
  40. },
  41. {
  42. label: '技术服务活动',
  43. router: '/learning/technology/index',
  44. },
  45. {
  46. label: '科普活动',
  47. router: '/learning/science/index',
  48. },
  49. {
  50. label: '分析/建议/决策/咨询报告',
  51. router: '/learning/report/index',
  52. },
  53. ],
  54. };
  55. },
  56. async created() {},
  57. methods: {},
  58. computed: {
  59. ...mapState(['user']),
  60. },
  61. metaInfo() {
  62. return { title: this.$route.meta.title };
  63. },
  64. watch: {
  65. test: {
  66. deep: true,
  67. immediate: true,
  68. handler(val) {},
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="less" scoped>
  74. .one {
  75. height: 200px;
  76. background-color: #fff;
  77. margin: 0 0 5px 0;
  78. .van-swipe {
  79. height: 200px;
  80. overflow: hidden;
  81. }
  82. }
  83. .two {
  84. .list {
  85. height: 80px;
  86. p {
  87. color: #fff;
  88. font-size: 14px;
  89. padding: 0px 5px;
  90. text-align: center;
  91. overflow: hidden;
  92. text-overflow: ellipsis;
  93. -webkit-line-clamp: 2;
  94. word-break: break-all;
  95. display: -webkit-box;
  96. -webkit-box-orient: vertical;
  97. }
  98. /deep/.van-grid-item__content {
  99. border-radius: 10px;
  100. }
  101. }
  102. .list:nth-child(1) {
  103. /deep/.van-grid-item__content {
  104. background-color: #ffc0cb;
  105. }
  106. }
  107. .list:nth-child(2) {
  108. /deep/.van-grid-item__content {
  109. background-color: #ee82ee;
  110. }
  111. }
  112. .list:nth-child(3) {
  113. /deep/.van-grid-item__content {
  114. background-color: #7b68ee;
  115. }
  116. }
  117. .list:nth-child(4) {
  118. /deep/.van-grid-item__content {
  119. background-color: #4169e1;
  120. }
  121. }
  122. .list:nth-child(5) {
  123. /deep/.van-grid-item__content {
  124. background-color: #00bfff;
  125. }
  126. }
  127. .list:nth-child(6) {
  128. /deep/.van-grid-item__content {
  129. background-color: #48d1cc;
  130. }
  131. }
  132. .list:nth-child(7) {
  133. /deep/.van-grid-item__content {
  134. background-color: #98fb98;
  135. }
  136. }
  137. }
  138. </style>