<template functional>
  <card
    title="理赔流程"
    :option="props.more ? ['了解更多理赔信息'] : []"
    @option-click="props.more ? listeners.click : () => {}"
  >
    <div class="cps-process-list">
      <div class="cps-process-list-item" v-for="(item, index) in props.processData" :key="index">
        <div class="cps-process-list-item-title">{{ index + 1 }}</div>
        <div class="cps-process-list-item-content">
          <h6>{{ item.title }}</h6>
          <small v-html="item.desc"></small>
        </div>
      </div>
    </div>
  </card>
</template>

<script>
export default {
  name: "CpsProcess",
  props: {
    processData: {
      type: Array,
      default() {
        return [];
      }
    },
    more: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang="less" scoped>
@import "../../../../style/var.less";
.cps-process {
  &-list {
    position: relative;
    &::after {
      content: " ";
      display: block;
      position: absolute;
      top: 35px;
      left: 13px;
      width: 0;
      height: calc(100% - 98px);
      border-left: 1px solid #d8d8d8;
      z-index: 5;
    }
    &-item {
      display: flex;
      padding-bottom: 16px;
      &-title {
        font-size: @font-size-12;
        font-weight: @font-weight-bold;
        color: @black;
        width: 19px;
        height: 19px;
        margin: 30px 20px 0 4px;
        background-color: @orange-light;
        border-radius: @border-radius-max;
        line-height: @line-height-md;
        text-align: center;
        line-height: 19px;
        position: relative;
        z-index: 6;
      }
      &-content {
        flex: 1;
        background-color: #f6f6f6;
        border-radius: @border-radius-sm / 2 @border-radius-md;
        padding: @padding-sm;
        position: relative;
        h6 {
          color: @orange-dark;
          font-weight: @font-weight-bold;
          font-size: @font-size-14;
          line-height: @line-height-sm + 2;
        }
        small {
          color: @gray-5;
          font-size: @font-size-12;
          line-height: @line-height-sm + 2;
        }
      }
      &:last-child {
        color: #fff;
        padding-bottom: 0;
        &::after {
          display: none;
        }
      }
    }
  }
}
</style>
