index-card-high-school.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <index-card simple title="高中信息库" more-text="查看全部" @more="handleMore">
  3. <el-row gutter="20">
  4. <el-col v-for="item in list" :key="item.id" :span="6">
  5. <el-image :src="item.pict" fit="fill" style="height: 200px; width: 100%; cursor: pointer" @click="handleMore" />
  6. </el-col>
  7. </el-row>
  8. </index-card>
  9. </template>
  10. <script>
  11. import {getHighSchoolList} from "@/api/webApi/baiyou";
  12. import MxTransferMixin from "@/components/mx-transfer-mixin";
  13. import IndexLoginInterceptorMixin from "@/views/index/blocks/index-login-interceptor-mixin";
  14. import IndexCard from "@/views/index/components/index-card.vue";
  15. export default {
  16. name: "index-card-high-school",
  17. components: {IndexCard},
  18. mixins: [MxTransferMixin, IndexLoginInterceptorMixin],
  19. data() {
  20. return {
  21. morePath: {name: 'LibraryHighSchool'},
  22. list: []
  23. }
  24. },
  25. mounted() {
  26. this.getList()
  27. },
  28. methods: {
  29. async getList() {
  30. const {rows} = await getHighSchoolList({pageNum:1, pageSize:4})
  31. this.list = rows
  32. },
  33. async handleMore() {
  34. await this.loginCheck()
  35. this.transferTo(this.morePath)
  36. }
  37. }
  38. }
  39. </script>
  40. <style scoped>
  41. </style>