<template>
  <div class="service-content max-width-center">
    <div class="title">{{ $t('home.onlineEdu.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/onlineEdu_01.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/onlineEdu_01_on.png',
          text: this.$t('home.onlineEdu.service'),
          path: '/services/solution',
          pathType: 1
        },
        {
          icon: 'https://webapp-pub.ezijing.com/www/pc/home/onlineEdu_02.png',
          iconActive: 'https://webapp-pub.ezijing.com/www/pc/home/onlineEdu_02_on.png',
          text: this.$t('home.onlineEdu.prp'),
          path: 'https://prp.ezijing.com/',
          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 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>
