<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>
    <!-- <img
      style="padding:56px 0 30px;position: relative;width: 1200px;margin: 0 auto;"
      src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/school.png"
      alt=""
    /> -->
  </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/marywood/img12.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/img11.png',
          text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT1') : this.$t('home.project.pc.itemT5')
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/img22.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/img21.png',
          text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT1') : this.$t('home.project.pc.itemT6')
        },
        {
          icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/img32.png',
          iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/img31.png',
          text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT1') : this.$t('home.project.pc.itemT7')
        }
        // {
        //   icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon2.png',
        //   iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon2_a.png',
        //   text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT2') : this.$t('home.project.pc.itemT2')
        // },
        // {
        //   icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon3.png',
        //   iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon3_a.png',
        //   text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT3') : this.$t('home.project.pc.itemT3')
        // },
        // {
        //   icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon4.png',
        //   iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon4_a.png',
        //   text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT4') : this.$t('home.project.pc.itemT4')
        // },
        // {
        //   icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon5.png',
        //   iconActive: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/marywood/mary_features_icon5_a.png',
        //   text: this.$store.state.isMobile ? this.$t('home.project.h5.itemT5') : this.$t('home.project.pc.itemT5')
        // }
      ]
    }
  },
  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: flex-start;
      padding-top: 15px;
      li {
        width: 224px;
        height: 230px;
        padding-top: 53px;
        margin-right: 20px;

        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>
