<template>
  <div class="tool-box">
    <ul class="left-nav">
      <li @click="selectList(index)" v-for="(item, index) in list" :key="index" :class="listIndex === index ? 'active' : ''">
        <div class="icon-box">
          <img :src="listIndex === index ? item.iconActive : item.icon">
        </div>
        <div class="text">{{ item.text }}</div>
      </li>
    </ul>
    <div class="right-content">
      <dou-yin></dou-yin>
    </div>
  </div>
</template>

<script>
import DouYin from '../components/DouYin.vue'
export default {
  components: { DouYin },
  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>
.tool-box{
  display: flex;
  padding: 25px 30px 30px;
  .left-nav{
    width: 264px;
    height: 684px;
    background: url(https://webapp-pub.ezijing.com/x-training-new/nav-bg.png);
    background-size: 100% 100%;
    padding-top: 18px;
    box-sizing: border-box;
    li{
      width: 220px;
      height: 58px;
      display: flex;
      align-items: center;
      margin: 0 auto;
      cursor: pointer;
      &.active{
        background: #68B8A4;
        .text{
          color: #fff;
        }
      }
      .icon-box{
        width: 50px;
        margin-left: 40px;
      }
      .text{
        font-size: 14px;
        color: #666666;
      }
    }
  }
  .right-content{
    flex: 1;
    background: #fff;
    margin-left: 30px;
    padding: 30px;
    box-sizing: border-box;
  }
}
</style>
