<template>
  <div class="service-content max-width-center">
    <div :class="isMobile ? 'is-h5' : 'is-pc'">
      <card :title="$t('home.project.title')">
        <ul class="nav-content">
          <li v-for="(item, index) in data" :key="index">
            <img :src="item.icon" class="icon" />
            <img v-if="!isMobile" :src="item.iconActive" class="icon-active" />
            <div class="text" v-html="item.text"></div>
          </li>
        </ul>
      </card>
    </div>
  </div>
</template>
<script>
import Card from '@/components/Card'
import AppLink from '@/components/Link'
export default {
  name: 'projectFeatures',
  components: {
    AppLink,
    Card
  },
  data() {
    return {
      titleParams: {
        name: this.$t('home.project.title')
      },
      data: [
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_first.png', 
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_first_on.png',
          text: '首款“E-Blended Learning”<br />款待业MBA', path: '', pathType: 0
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_Authoritative.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_Authoritative_on.png',
          text: '权威专业的泛<br />服务业知识体系', path: '', pathType: 0
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_development.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_development_on.png',
          text: '国际款待业<br />职业发展服务', path: '', pathType: 0
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_abroad.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_abroad_on.png',
          text: '不出国也能<br />“留学”', path: '', pathType: 0
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_Globally.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/seg-shms/home_icon_Globally_on.png',
          text: '学位全球认可<br />学籍官方可查', path: '', pathType: 0
        }
      ]
    }
  },
  methods: {
    goPage(path) {
      if (path === '') {
        // this.$message('暂未开通，尽请期待。')
        return
      }
      window.open(path)
    }
  },
  mounted() {
    console.log(this.isMobile)
  },
  computed: {
    isMobile() {
      return this.$store.state.isMobile
    }
  }
}
</script>

<style lang="scss" scoped>
.is-pc {
  .service-content {
    padding-top: 68px;
    .nav-content {
      display: flex;
      justify-content: space-between;
      padding-top: 15px;
      li {
        width: 224px;
        height: 230px;
        padding-top: 53px;
        box-sizing: border-box;
        background: #f9f8f8;
        // background: #fff;
        // box-shadow: 0px 4px 38px rgba(142, 30, 34, 0.41);
        cursor: pointer;
        transition: all 0.3s;
        img {
          width: 80px;
          height: 80px;
          display: block;
          margin: 0 auto;
        }
        .icon-active {
          display: none;
        }
        &:hover {
          background: #aa1941;
          box-shadow: 0px 4px 20px rgba(142, 30, 34, 0.41);
          .text {
            color: #fff;
          }
          .icon {
            display: none;
          }
          .icon-active {
            display: block;
          }
        }
        .text {
          font-size: 14px;
          line-height: 18px;
          color: #666666;
          margin-top: 20px;
          text-align: center;
        }
      }
    }
  }
  .max-width-center {
    width: 1212px;
    margin: 0 auto;
  }
}
.is-h5 {
  .service-content {
    ul {
      display: flex;
      overflow-x: scroll;
      -webkit-overflow-scrolling: touch;
    }
    li {
      min-width: 0.78rem;
      background: #ffffff;
      margin-right: 0.1rem;
      padding-top: 0.11rem;
      img {
        width: 0.4rem;
        height: 0.4rem;
        display: block;
        margin: 0 auto;
      }
      .text {
        font-size: 0.1rem;
        line-height: 0.16rem;
        color: #666666;
        padding-top: 0.05rem;
        text-align: center;
        padding-bottom: 0.1rem;
      }
    }
  }
}
</style>
