<template>
  <div class="ct-container">
    <div class="ct-title">
      <div class="ct-chap">第{{ courseType + 1 }}阶段</div>
      <div class="ct-chap-title">{{ chapInfo.dyName }}</div>
      <div class="ct-task">任务{{ taskCount + 1 }}</div>
    </div>
    <div class="ct-detail" v-if="chapInfo.chapterInfo && chapInfo.chapterInfo[0].taskJson[taskCount].taskDetail">
      <div class="detail" v-html="chapInfo.chapterInfo[0].taskJson[taskCount].taskDetail"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    chapInfo: {
      type: Object,
      default: () => {}
    },
    courseType: {
      type: Number,
      default: 0
    },
    taskCount: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.ct-container {
  background: #fff;
  width: 100%;
  padding: 15px;
  box-sizing: border-box;
  .ct-title {
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    .ct-chap {
      border-left: 3px solid rgb(43, 93, 183);
      font-size: 18px;
      font-weight: bold;
      padding: 0 0 0 0.2rem;
      min-width: fit-content;
    }
    .ct-chap-title {
      font-size: 18px;
      margin: 0 0.3rem 0 0.5rem;
      @include textoverflow(1);
    }
    .ct-task {
      padding: 0.1rem;
      color: #fff;
      font-size: 12px;
      background: rgb(73, 161, 241);
      border-radius: 0.1rem;
      min-width: fit-content;
    }
  }
  /deep/ .ct-detail {
    width: 100%;
    padding: 10px;
    line-height: 25px;
    box-sizing: border-box;
    background: rgb(241, 241, 241);
    word-break: break-all;
    margin: 0.3rem 0 0;
    font-size: 14px;
    p {
      margin: 0;
    }
  }
}
</style>
