<template>
  <div class="market-tools">
    <div class="tool-main">
      <div class="tool-bg">
        <div class="tool-content">
          <ul>
            <li
              @click="selectList(index)"
              v-for="(item, index) in list"
              :key="index"
              :class="listIndex === index ? 'active' : ''"
            >
              <img :src="listIndex === index ? item.iconActive : item.icon" />
              <div class="text">{{ item.text }}</div>
            </li>
          </ul>
          <div class="confirm-btn" @click="$router.push({ path: '/market-tools/tool' })">选好了</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      listIndex: 2,
      list: [
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon3.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon-a3.png',
          text: '视频营销'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon7.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon7.png',
          text: '邮件营销'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon10.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon10.png',
          text: 'APP营销'
        },

        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon9.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon9.png',
          text: '移动短信营销'
        },

        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon11.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon11.png',
          text: '微信提醒营销'
        }
      ]
    }
  },
  methods: {
    selectList(n) {
      console.log(n, 'nnnn')
      if (n === 9) {
        // this.$router.push('/')
      }
      // if (n === 2) return
      // this.$message('暂未开通')
    }
  }
}
</script>

<style lang="scss" scoped>
.market-tools {
  .tool-main {
    background: #fff;
    padding-bottom: 11px;
    .tool-bg {
      position: relative;
      width: 1112px;
      height: 489px;
      margin: 0 auto;
      background: url(https://webapp-pub.ezijing.com/x-training-new/tool-index-bg.png);
      background-size: 100% 100%;
      .tool-content {
        width: 708px;
        position: absolute;
        top: 166px;
        left: 282px;
        ul {
          display: flex;
          flex-wrap: wrap;
        }
        li {
          width: 180px;
          height: 96px;
          background: #f5f5f5;
          border-radius: 6px;
          display: flex;
          align-items: center;
          // margin: 0 10px 10px 0;
          margin: 0 45px 10px 24px;
          cursor: pointer;
          &.active {
            background: #68b8a4;
            .text {
              color: #fff;
            }
          }
          img {
            margin-left: 16px;
          }
          .text {
            font-size: 14px;
            color: #797979;
            line-height: 24px;
            margin-left: 14px;
          }
        }
      }
      .confirm-btn {
        width: 119px;
        background: #68b8a4;
        border-radius: 16px;
        margin: 0 auto;
        text-align: center;
        font-size: 18px;
        color: #ffffff;
        line-height: 32px;
        cursor: pointer;
      }
    }
  }
  padding: 30px;
  /* height:calc(100vh - 86px); */
}
</style>
