<template>
  <div class="main_content">
    <!--  -->
    <div class="main_content_plan">
      <!-- 标题 -->
      <div class="main_content_plan_title">计划类型</div>
      <!-- tab切换 -->
      <div class="main_content_plan_tab">
        <div v-for="(item, index) in tabList" :key="index" @click="handleTab(index)">
          <div class="tabItem" :class="activeTab === index ? 'tabItem_active' : 'tabItem_inactive'">
            <img :src="item.icon" v-if="activeTab !== index" />
            <img :src="item.iconActive" v-else />
            <div class="tabItem_name">{{ item.tabName }}</div>
          </div>
        </div>
      </div>
    </div>
    <!-- 触发条件 -->
    <div class="main_content_trigger">
      <div class="main_content_trigger_title">触发条件</div>
      <div class="main_content_trigger_con">
        在 &nbsp;&nbsp;<el-date-picker
          v-model="time"
          type="datetime"
          placeholder="选择日期时间"
          default-time="12:00:00"
        >
        </el-date-picker
        >&nbsp;&nbsp;对目标用户进行触达
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      activeTab: 0,
      time: '',
      tabList: [
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon11.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon12.png',
          tabName: '单次触发'
        },
        {
          icon: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon21.png',
          iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon22.png',
          tabName: '条件触发'
        }
      ]
    }
  },
  methods: {
    handleTab(index) {
      this.activeTab = index
    }
  }
}
</script>
<style lang="scss" scoped>
.main_content {
  width: 883px;
  background: rgba(255, 255, 255, 0.39);
  border: 1px solid #e8e8e8;
  opacity: 1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  .main_content_plan {
    .main_content_plan_title {
      font-size: 18px;
      font-weight: 500;
      color: #333333;
    }
    .main_content_plan_tab {
      display: flex;
      margin-top: 20px;
      .tabItem_active {
        background: #49bba2;
        color: #ffffff;
        .tabItem_name {
          margin-left: 5px;
          font-size: 16px;
          color: #ffffff;
        }
      }
      .tabItem_inactive {
        background: #ffffff;
        border: 1px solid #cdcdcd;
        .tabItem_name {
          margin-left: 5px;
          font-size: 16px;
          color: #6d6d71;
        }
      }
      .tabItem {
        width: 119px;
        height: 36px;
        border-radius: 18px;
        margin-right: 19px;
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 16px;
          height: 16px;
          display: block;
        }
        .tabItem_name {
          margin-left: 5px;
          font-size: 16px;
        }
      }
    }
  }
  .main_content_trigger {
    margin-top: 40px;
    .main_content_trigger_title {
      font-size: 18px;
      font-weight: 500;
      color: #333333;
    }
    .main_content_trigger_con {
      font-size: 16px;
      font-weight: 400;
      color: #333333;
      margin-top: 20px;
    }
  }
}
</style>
