<template functional>
  <card class="cps-demo-title_np" title="理赔案例">
    <div class="cps-demo">
      <div class="cps-demo-header">
        <h4>1对1专员协助理赔</h4>
        <small>因为专业 所以放心</small>
      </div>
      <div class="cps-demo-body">
        <div class="cps-demo-person">
          <span>{{ props.caseData.name }}</span>
          <span>{{ props.caseData.info }}</span>
        </div>
        <div class="cps-demo-list">
          <div class="cps-demo-list-item" v-for="(item, index) in props.caseData.list" :key="index">
            <div class="cps-demo-list-item-title">{{ item.title }}</div>
            <div class="cps-demo-list-item-content">{{ item.event }}</div>
          </div>
        </div>
      </div>
    </div>
  </card>
</template>

<script>
export default {
  name: "CpsCase",
  props: {
    caseData: {
      type: Object,
      default() {
        return {
          name: "",
          info: "",
          list: []
        };
      }
    }
  }
};
</script>

<style lang="less" scoped>
@import "../../../../style/var.less";
.cps-demo {
  &-title_np {
    .card-header {
      padding-bottom: 0;
    }
  }
  &-header {
    background: url(../../../../assets/images/goods/detail/assistant-card.png) top no-repeat;
    background-size: contain;
    padding: 24px 24px 21.5px;
    h4 {
      margin-top: 20px;
      font-size: @font-size-20;
      color: @black;
      line-height: @line-height-lg;
      font-weight: @font-weight-bold;
    }
    small {
      margin-top: 9.5px;
      padding-left: 8.8px;
      display: block;
      color: @white;
      font-size: @font-size-12 - 1;
    }
  }
  &-body {
    background-color: @gray-1;
    padding: @padding-sm + 1 @padding-md;
    border-radius: 0 0 @border-radius-md @border-radius-md;
  }
  &-person {
    background-color: @white;
    border-radius: @border-radius-md;
    font-size: @font-size-14 + 1;
    font-weight: @font-weight-bold;
    padding: @padding-xs @padding-sm;
    line-height: @line-height-lg;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 29px;
  }
  &-list {
    &-item {
      position: relative;
      display: flex;
      padding-bottom: 20px;
      &-title {
        font-size: @font-size-16;
        font-weight: @font-weight-bold;
        color: @black;
        width: 34px;
        line-height: @line-height-md;
      }
      &-content {
        flex: 1;
        font-size: @font-size-11;
        color: @gray-5;
        line-height: @line-height-sm + 1;
        padding-left: 50px;
        position: relative;
        &::after,
        &::before {
          content: " ";
          display: block;
          position: absolute;
          top: 4px;
          left: 0;
        }
        &::before {
          height: 12px;
          width: 12px;
          background-color: #d8d8d8;
          border-radius: @border-radius-max;
          left: 18px;
        }
        &::after {
          width: 0;
          height: calc(100% + 20px);
          border-left: 1px solid #d8d8d8;
          left: 24px;
        }
      }
      &:last-child {
        .cps-demo-list-item-content::after {
          display: none;
        }
      }
    }
  }
}
</style>
