<template>
  <div class="refund-goods common">
    <div class="title">退款信息</div>
    <div class="spu flex-default">
      <img class="thumb" :src="sku.thumb"/>
      <div class="info">
        <div class="name">{{ sku.name }}</div>
        <div class="sku">{{ sku.propLabel }}</div>
      </div>
    </div>
    <div class="info-list">
      <div class="item">
        <div class="label">退款原因</div>
        <div class="val">{{ RefundReasonTypeLabel[sku.returnType] }}</div>
      </div>
      <div class="item">
        <div class="label">商品币</div>
        <div class="val">{{ sku.coinName }}</div>
      </div>
      <div class="item">
        <div class="label">申请件数</div>
        <div class="val">{{ sku.number }}</div>
      </div>
      <div class="item">
        <div class="label">申请时间</div>
        <div class="val">{{ sku.createTime | timeFilter }}</div>
      </div>
      <!-- <div class="item">
        <div class="label">退款编号</div>
        <div class="val">1562896325986</div>
      </div> -->
      <div class="item">
        <div class="label">补充描述</div>
        <div class="val">{{ sku.returnReason }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { RefundReasonType, RefundReasonTypeLabel } from "@/enums";
export default {
  props: ["data"],
  data() {
    return {
      RefundReasonType,
      RefundReasonTypeLabel,
    };
  },
  computed: {
    sku() {
      if (this.data.skuVo && this.data.skuVo.skuProps) {
        let propLabel = this.data.skuVo.skuProps
          .map((s) => `${s.propKey}：${s.propVal}`)
          .join(" ");
        let { name, coinName, thumb } = this.data.skuVo;
        return { ...this.data, name, propLabel, coinName, thumb };
      }
      return {};
    },
  },
};
</script>

<style lang="less">
.refund-goods {
  > .title {
    font-size: 16px;
    color: #140603;
    font-weight: bold;
    line-height: 18px;
    margin-bottom: 15px;
  }
  > .spu {
    margin-bottom: 16px;
    .thumb {
      width: 100px;
      height: 100px;
      background: #d8d8d8;
      border-radius: 6px;
      margin-right: 10px;
    }
    .info {
      flex: 1;
      padding: 6px;
    }
    .info .name {
      color: #140603;
      font-size: 14px;
      line-height: 18px;
      margin-bottom: 9px;
    }
    .info .sku {
      font-size: 12px;
      line-height: 16px;
      color: #aeaeae;
    }
  }
  > .info-list {
    .item {
      display: flex;
      margin-bottom: 15px;
      &:last-of-type{
        margin-bottom: 0;
      }
    }
    .item .label {
      width: 75px;
      color: #aeaeae;
      font-size: 12px;
    }
    .item .val {
      color: #140603;
      font-size: 12px;
    }
  }
}
</style>


