<template>
  <div class="item-box">
    <img :src="data.imgUri" />
    <div class="right-content">
      <div class="title">{{ data.title }}</div>
      <div class="des-box">
        <p>计划时间：{{ data.time }}</p>
        <p>计划人数：{{ data.count }}</p>
      </div>
      <router-link :to="`/train/detail?id=${data.id}`" v-if="data.activeIndex === 1">
        <div class="detail-btn">在线报名</div>
      </router-link>
      <div class="detail-btn" v-if="data.activeIndex === 2">敬请期待</div>
      <div class="detail-btn finished" v-if="data.activeIndex === 3">圆满结束</div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    data: { type: Object, default: () => ({}) },
  },
}
</script>
<style lang="scss" scoped>
.item-box {
  padding: 24px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  img {
    width: 180px;
    height: 100px;
    display: block;
  }
  .right-content {
    margin-left: 24px;
    .title {
      font-size: 18px;
      font-weight: bold;
      color: #c01540;
      line-height: 25px;
      width: 400px;
    }
    .des-box {
      width: 400px;
      margin-top: 24px;
      p {
        font-size: 14px;
        color: #717171;
        line-height: 20px;
        margin-bottom: 8px;
        &.ind {
          text-indent: 2em;
        }
      }
    }
    .detail-btn {
      color: #fff;
      text-align: center;
      line-height: 36px;
      width: 96px;
      height: 36px;
      background: linear-gradient(315deg, rgba(225, 47, 116, 0.83) 0%, #c01540 100%);
      border-radius: 4px;
      margin-top: 16px;
    }
    .finished {
      background: #a9a3a9;
    }
  }
}
</style>
