<!--
  @description: 订单详情-流程
  @Modifier：杨胜国
  @routerPath:stateRcol-detail
  @date：  2021/06/01-10:00
-->
<template>
  <div class="m order-state order-state01 order-state02">
    <div class="mc state-cont steps-con">
      <el-steps v-if="orderDetailObj.orderBackTraces" :active="30" align-center class="detail_step">
        <el-step
          v-for="(el,i) in orderDetailObj.orderBackTraces"
          :key="i"
          :description="el.createTime"
          :title="formatStatus(el.status)"
        >
          <template slot="icon">
            <img :src="format(el.status)" style="height:30px;width:30px;">
          </template>
        </el-step>
      </el-steps>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TrackDetail',
  components: {
  },
  props: {
    orderDetailObj: {
      type: Object,
      default: function() {
        return
      }
    }
  },
  data() {
    return {
      statusList: [
        { code: '00', value: '待处理' },
        { code: '01', value: '售后处理中' },
        { code: '02', value: '已取消' },
        { code: '03', value: '拒绝售后' },
        { code: '04', value: '未收到退货' },
        { code: '05', value: '买家退货' },
        { code: '06', value: '买家申请换货' },
        { code: '06', value: '卖家新货发出' },
        { code: '09', value: '卖家确认收到退货' },
        { code: '10', value: '买家确认收到换货' }
      ],
      imgList: [
        { status: '00', src: require('@/assets/img/shopmall/dcl.png') }, // 待处理
        { status: '01', src: require('@/assets/img/shopmall/thz.png') }, // 售后处理中
        { status: '02', src: require('@/assets/img/shopmall/yqx.png') }, // 已取消
        { status: '03', src: require('@/assets/img/shopmall/shqx.png') }, // 拒绝售后
        { status: '04', src: require('@/assets/img/shopmall/wsd.png') }, // 未收到退货
        { status: '06', src: require('@/assets/img/shopmall/dcl.png') }, // 待处理
        { status: '09', src: require('@/assets/img/shopmall/ywc.png') } // 卖家确认收到退货
      ]
    }
  },
  methods: {
    formatStatus(val) {
      if (!val) return 'null'
      for (const { code, value } of this.statusList) {
        if (code === val) {
          return value
        }
      }
    },
    format(val) {
      if (!val) return require('@/assets/img/shopmall/bz.png')
      for (const item of this.imgList) {
        if (item.status === val) {
          return item.src
        }
      }
      return require('@/assets/img/shopmall/bz.png')
    }
  }
}
</script>

<style scoped lang="less">
.order-state02 {
    border-color: #4a88fd;
    margin-bottom: 20px;
    box-shadow: 2px 2px 5px #dcd8d8;
    margin: 30px 40px 20px 40px;
  }
  .order-state {
    border-top: 3px solid #fff;
  }
  .mc {
    background: #fff;
    border: 1px solid #eee;
  }
  .order-state .state-cont {
    position: relative;
    display: inline-block;
    display: block;
  }
  .steps-con{
    padding: 35px 30px;
    border-left: 1px solid #f1f1f1;
    box-shadow: 2px 2px 5px #dcd8d8;
  }
  .state-rcol {
    // width: 100%;
    border-left: 1px solid #f1f1f1;
    padding: 15px 0px 60px 185px;
    box-shadow: 2px 2px 5px #dcd8d8;
  }
/deep/ .detail_step{
    width: 100%;
    .el-step{
      flex-basis: 20% !important;
      .el-step__head{
        .el-step__line{
          margin-left: 20px;
          width: 50%;
          border: none;
          position: relative;
          left: 60%;
        }
      }
    }
    .el-step__title{
      font-size: 12px;
    }
    .el-step__icon.is-text {
      border-radius: unset;
      border: none;
    }
  }
/deep/ .stes .el-step .el-step__head .el-step__line {
  border: none;
}
/deep/.el-step__line-inner {
  border: none;
  border-bottom: 1px dashed #555;
}
/deep/.el-step.is-horizontal .el-step__line {
  height: 1px;
}
</style>
