<template>
  <div>
    <banner :show-page="showPage" />
    <h-nav />
    <div class="inner">
      <bread-crumb :arr="arr" />
    </div>
    <div class="flow-path">
      <div class="flow-title">服务流程</div>
      <div class="flow-content">
        您
        <span class="login-color">注册、登录</span> 后通过直接申请或加入购物车进行申请服务， 直接申请后在个人中心查看， 加入
        <span class="login-color">购物车</span> 后可通过顶部菜单栏的购物车查看。
      </div>
    </div>
    <div class="inner d-flex flex-wrap">
      <div :class="(index + 1) % 4 === 0 ? 'margin-0' : ''" :key="index" class="item-box" v-for="(item, index) in list">
        <img :src="item.imgUrl" style="height: 220px; width: 100%; border: 1px solid #ccc" />
        <p class="font-24 my-4">{{ item.name }}</p>
        <p @click="jump(item.id)" class="font-16 baseColor" style="text-align: right; cursor: pointer">了解更多→</p>
      </div>
    </div>
    <div class="inner">
      <a-pagination
        :current="current"
        :page-size="pageSize"
        :total="total"
        @change="onShowSizeChange"
        class="pagination"
        show-less-items
        show-quick-jumper
      />
    </div>
  </div>
</template>

<script>
import Banner from 'components/Banner/Banner.vue';
import HNav from './../components/HNav.vue';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';

export default {
  name: 'Services',
  components: { Banner, HNav, BreadCrumb },
  data() {
    return {
      title: '创业服务',
      showPage: 46,
      arr: [
        { name: '孵化平台', url: '/IncubationPlatform/MakerSpace' },
        { name: '创业服务', url: '' },
      ],
      list: [],
      current: 1,
      pageSize: 8,
      total: 0,
    };
  },

  methods: {
    // 改变单当前页数
    onShowSizeChange(current, size) {
      this.current = current;
    },
    // 查看 服务 详情
    jump(id) {
      console.log(id);
      this.$router.push({
        path: '/NewPlatform/ServiceDet',
        name: 'ServiceDet',
        params: { id },
      });
    },
  },
};
</script>

<style lang="stylus" scoped>
.inner {
  margin: 40px auto;
}

.pagination {
  text-align: right;
}

.item-box {
  width: 20.5%;
  margin-right: 6%;
  border-radius: 4px;
}

.margin-0 {
  margin-right: 0 !important;
}
</style>
