<template>
  <!-- 文章模块 -->
  <section class="article-page-list">
    <nuxt-link 
      class="article-page-item box_shadow row mt-4" 
      :to="`/article-page/${item.id}`"
      v-for="item in pordObj.records"
      :key="item.id"
    >
      <b-img 
        class="col-md-4"
        :src="item.mainPic"
        :alt="item.title"
      >
      </b-img>
      <article class="col-md-8">
        <h3 class="title text-ellipsis">
          {{ item.title }}
        </h3>
        <p class="article-page-content text-ellipsis" v-html="item.description"></p>
        <div>
          <span>{{ item.createTime }}</span>
          <img src="~assets/image/icon/goto1.png" :alt="$t('common.viewDetails')">
        </div>
      </article>
    </nuxt-link>

    <SeoPagination class="mt-4" :total="pordObj.total" />
  </section>
</template>

<script>
export default {
  name: 'article-page-list',
  watchQuery: ['pageNum', 'catgId', 'maxCatgId'],
  data() {
    return {
      bannerTopOptions: {
        
      },
    }
  },
  async asyncData({$axios,query}) {
    let params = {
      pageNum: query.pageNum || 1,
      pageSize: 6,
      catgId: query.catgId || query.maxCatgId ||'',
    }
    let {data: pordObj} = await $axios('/web/newsPageList', {params})

    return {
      pordObj
    }
    
  },
  methods: {
    
  }
}
</script>

<style lang="scss" scoped>
.article-page-list {
  box-sizing: border-box;
  .article-page-item {
    margin: 0;
    height: min-content;
    min-height: 12.875rem;
    border: 1px solid #e6e8ec;
    article {
      padding: 1.125rem;
      font-size: .875rem;
      .title {
        margin-top: .9375rem;
        color: #212222;
        font-size: .875rem;
      }
      .article-page-content {
        margin: 1.25rem 0;
        height: 5rem;
        color: #878b90;
      	-webkit-line-clamp: 4;
      }
      >div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #878b90;
        img {
          width: 1.6875rem;
          height: 1rem;
        }
      }
    }
  }
}

</style>