<template>
  <div class="service-content max-width-center">
    <div class="title">{{ $t('home.college.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://webapp-pub.ezijing.com/www/pc/home/01.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/01_on.png',
          text: this.$t('home.college.corePower'),
          path: '/services/college',
          pathType: 1
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/02.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/02_on.png',
          text: this.$t('home.college.program'),
          path: '/services/major',
          pathType: 1
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/03.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/03_on.png',
          text: this.$t('home.college.saas'),
          path: 'https://x-learning.ezijing.com',
          pathType: 0
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/04.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/04_on.png',
          text: this.$t('home.college.internship'),
          path: '/services/employment',
          pathType: 1
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/05.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/05_on.png',
          text: this.$t('home.college.x'),
          path: 'https://x.ezijing.com',
          pathType: 0
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/06.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/06_on.png',
          text: this.$t('home.college.cert'),
          path: '/services/job',
          pathType: 1
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/07.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/07_on.png',
          text: this.$t('home.college.data'),
          path: '/services/dataAnalysis',
          pathType: 1
        }
      ]
    }
  },
  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 0.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>
