<!--
  @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 :active="30" align-center class="detail_step">
        <el-step
          v-for="(el,i) in orderDetailObj.traceVos"
          :key="i"
          :description="el.createTime"
          :title="el.orderStatus"
        >
          <template slot="icon">
            <img :src="format(el.orderStatus)" 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 {
      imgList: [
        { status: '已下单', src: require('@/assets/img/shopmall/yxd.png') },
        { status: '待发货', src: require('@/assets/img/shopmall/dfh.png') },
        { status: '待收货', src: require('@/assets/img/shopmall/dsh.png') },
        { status: '交易成功', src: require('@/assets/img/shopmall/ywc.png') },
        { status: '有退货', src: require('@/assets/img/shopmall/thsq.png') },
        { status: '商家拒绝退货申请', src: require('@/assets/img/shopmall/thbh.png') },
        { status: '商家受理退货申请', src: require('@/assets/img/shopmall/thsl.png') },
        { status: '取消退货', src: require('@/assets/img/shopmall/yqx.png') },
        { status: '审核不通过，已取消', src: require('@/assets/img/shopmall/shqx.png') },
        { status: '商家收到退货', src: require('@/assets/img/shopmall/sjsd.png') }
      ]
    }
  },
  methods: {
    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;
  }
  .order_title{
    padding-top: 15px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 16px;
  }
  .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;
  }
/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>
