<template>
  <index-card title="学习技巧" more-text="更多" @more="handleMore">
    <index-card-content :list="list" :line-size="lineSize">
      <template #default="{item}">
        <index-image-item v-bind="item"></index-image-item>
      </template>
    </index-card-content>
  </index-card>
</template>

<script>
import IndexCard from '@/views/index/components/index-card'
import { gkVideo } from '@/api/webApi/career-news'
import IndexCardContent from '@/views/index/components/index-card-content'
import IndexImageItem from '@/views/index/components/index-image-item'
import transferMixin from '@/components/mx-transfer-mixin'
import loginCheckMixin from '@/views/index/blocks/index-login-interceptor-mixin'

export default {
  mixins: [transferMixin, loginCheckMixin],
  name: 'index-card-gktf',
  components: { IndexImageItem, IndexCardContent, IndexCard },
  data() {
    return {
      morePath: '/fuzhu/index_gktf',
      list: [],
      lineSize: 4,
      queryParams: {
        pageNum: 1,
        pageSize: 8,
        type: '高考提分',
        tag:''
      }
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    getList() {
      gkVideo(this.queryParams).then(res => {
        this.list = res['rows']?.map((item, idx) => {
          const path = '/career/plan/detail'
          const nextParams = {
            id: item.id,
            aliid: item.aliId,
            aliIdType: item.aliIdType,
            name: item.title,
            count: item.clicked,
            img: item.coverUrl
          }
          return {
            title: item.title,
            src: item.coverUrl,
            path: path,
            nextData: nextParams,
            class: idx >= this.lineSize ? ['mt15'] : [],
            titleClasses: ['width100',  'f-666', 'pf', 'f14', 'text-ellipsis']
          }
        })
      })
    },
    async handleMore() {
      await this.loginCheck()
      this.transferTo(this.morePath)
    }
  }
}
</script>

<style scoped>

</style>
