<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-icon1.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon1.png',
          text: '搜索引擎优化'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon2.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon1.png',
          text: '搜索引擎营销'
        },
        {
          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-icon4.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon4.png',
          text: '社交媒体营销'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon5.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon5.png',
          text: '智能推荐'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon6.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon6.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-icon8.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon8.png',
          text: 'SOLOMO'
        },
        {
          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-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-icon11.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tool-icon11.png',
          text: '全渠道营销'
        }
      ]
    }
  },
  methods: {
    selectList(n) {
      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: 1254px;
      height: 559px;
      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: 167px;
          height: 76px;
          background: #F5F5F5;
          border-radius: 6px;
          display: flex;
          align-items: center;
          margin: 0 10px 10px 0;
          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: 34px auto 0;
        text-align: center;
        font-size: 18px;
        color: #FFFFFF;
        line-height: 32px;
        cursor: pointer;
      }
    }
  }
  padding: 30px;
  /* height:calc(100vh - 86px); */
}
</style>
