index-card-gktf.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <index-card title="学习技巧" more-text="更多" @more="handleMore">
  3. <index-card-content :list="list" :line-size="lineSize">
  4. <template #default="{item}">
  5. <index-image-item v-bind="item"></index-image-item>
  6. </template>
  7. </index-card-content>
  8. </index-card>
  9. </template>
  10. <script>
  11. import IndexCard from '@/views/index/components/index-card'
  12. import { gkVideo } from '@/api/webApi/career-news'
  13. import IndexCardContent from '@/views/index/components/index-card-content'
  14. import IndexImageItem from '@/views/index/components/index-image-item'
  15. import transferMixin from '@/components/mx-transfer-mixin'
  16. import loginCheckMixin from '@/views/index/blocks/index-login-interceptor-mixin'
  17. export default {
  18. mixins: [transferMixin, loginCheckMixin],
  19. name: 'index-card-gktf',
  20. components: { IndexImageItem, IndexCardContent, IndexCard },
  21. data() {
  22. return {
  23. morePath: '/fuzhu/index_gktf',
  24. list: [],
  25. lineSize: 4,
  26. queryParams: {
  27. pageNum: 1,
  28. pageSize: 8,
  29. type: '高考提分',
  30. tag:''
  31. }
  32. }
  33. },
  34. mounted() {
  35. this.getList()
  36. },
  37. methods: {
  38. getList() {
  39. gkVideo(this.queryParams).then(res => {
  40. this.list = res['rows']?.map((item, idx) => {
  41. const path = '/career/plan/detail'
  42. const nextParams = {
  43. id: item.id,
  44. aliid: item.aliId,
  45. aliIdType: item.aliIdType,
  46. name: item.title,
  47. count: item.clicked,
  48. img: item.coverUrl
  49. }
  50. return {
  51. title: item.title,
  52. src: item.coverUrl,
  53. path: path,
  54. nextData: nextParams,
  55. class: idx >= this.lineSize ? ['mt15'] : [],
  56. titleClasses: ['width100', 'f-666', 'pf', 'f14', 'text-ellipsis']
  57. }
  58. })
  59. })
  60. },
  61. async handleMore() {
  62. await this.loginCheck()
  63. this.transferTo(this.morePath)
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped>
  69. </style>