<template>
  <div class="service-content max-width-center">
    <div class="title">教育服务</div>
    <ul class="nav-content">
      <li v-for="(item, index) in data" :key="index" @click="goPage(item.path, item.pathType)">
        <img :src="item.icon" alt="" class="icon">
        <img :src="item.iconActive" alt="" class="icon-active">
        <div class="text" v-html="item.text"></div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      data: [
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/3118a654ec7f92a52b7d04f2f1f5989a.png', 
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/37488a824991634e9283c870d976eb79.png',
          text: this.$t('home.service.x'), path: 'https://x.ezijing.com', pathType: 0
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/7bea5e01e4e4c92e104bb1d73d313500.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/8b624145e8cd4a8c38f108dbd0efc3eb.png',
          text: this.$t('home.service.program'), path: '/services/major', pathType: 1
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/0e5522064d9070290b3d541a485d469f.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/01d9b50bd0e2e2355a18f486181d710a.png',
          text: this.$t('home.service.college'), path: '/services/college', pathType: 1
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/0912f621abe188ccc84df6520a8fecf9.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/759a550044932bcf0f1159d103361ed2.png',
          text: this.$t('home.service.high'), path: '/services/employment', pathType: 1
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/6cf5b6010dd7d35a80d4acc270db8a86.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/4e86da38599e6fcfdd53f459df2f0a16.png',
          text: this.$t('home.service.online'), path: '', pathType: 0
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/6db512b8b2b4501651e6f9bc520d7379.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/bcbc44b065ea26146a68750e82aa058c.png',
          text: this.$t('home.service.career'), path: '/services/job', pathType: 1
        },
        {
          icon: 'https://zws-imgs-pub.ezijing.com/static/public/9603456c7edb101ec5469f92e9e21553.png',
          iconActive: 'https://zws-imgs-pub.ezijing.com/static/public/ae17f20f43525893b263fef139ea7006.png',
          text: this.$t('home.service.more'), path: '', pathType: 0
        }
      ]
    }
  },
  methods: {
    goPage(path, type) {
      if (path === '') {
        this.$message('暂未开通，尽请期待。')
        return
      } else {
        !type ? window.open(path) : this.$router.push({ path: path })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.service-content{
  padding-top: 44px;
  .title{
    font-size: 24px;
    font-weight: bold;
    line-height: 34px;
    color: #424242;
    margin-bottom: 20px;
  }
  .nav-content{
    display: flex;
    li{
      width: 156px;
      height: 186px;
      background: #FFFFFF;
      padding-top: 36px;
      margin-right: 20px;
      cursor: pointer;
      transition: all .5s;
      img{
        width: 64px;
        height: 64px;
        display: block;
        margin: 0 auto;
      }
      .icon-active{
        display: none;
      }
      &:hover{
        background: rgba(170, 25, 65, 1);
        .text{
          color: #fff;
        }
        .icon{
          display: none;
        }
        .icon-active{
          display: block;
        }
      }
      .text{
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        line-height: 18px;
        color: #666666;
        margin-top: 20px;
      }
    }
  }
}
.max-width-center{
  width: 1212px;
  margin: 0 auto;
}
</style>
