<template>
  <div class="refund-state common">
    <div :class="isFail ? ['tip'] : ['tip', 'tip-single']">
      <div class="title">{{ statusTxt }}</div>
      <div class="text" v-if="isFail">{{ reason }}</div>
    </div>
  </div>
</template>

<script>
import { RefundStatus } from "@/enums";
export default {
  props: ["status", "reason"],
  data() {
    return {
      statusTxtMap: {
        [RefundStatus.APPLY]: "您的服务单已申请成功，请等待后台审核。",
        [RefundStatus.REVIEW_SUCCESS]: "商家已同意退款申请。",
        [RefundStatus.REVIEW_FAIL]: "商家已驳回退款申请。",
        [RefundStatus.SUCCESS]: "服务已完成，感谢您的支持",
        [RefundStatus.CANCEL]: "您已撤销退款",
      },
    };
  },
  computed: {
    statusTxt() {
      return this.statusTxtMap[this.status];
    },
    isFail() {
      return this.status == RefundStatus.REVIEW_FAIL;
    },
  },
};
</script>

<style lang="less">
.refund-state {
  margin-top: -16px;
  > .tip {
    .title {
      color: #010101;
      font-size: 14px;
      line-height: 16px;
      font-weight: bold;
    }
    .text {
      margin-top: 5px;
      font-size: 12px;
      line-height: 14px;
      color: #aeaeae;
    }
  }
  > .tip-single {
    padding: 13px 0;
  }
  > .line {
    margin: 15px 0;
    height: 1px;
    box-shadow: 0px 1px 0px 0px rgba(241, 241, 241, 1);
  }
  > .addr {
    .title {
      align-items: center;
      margin-bottom: 6px;
    }
    .title .name {
      font-weight: bold;
      color: #010101;
      margin-right: 7px;
    }
    .title .phone {
      color: #aeaeae;
      font-size: 12px;
    }
    .content {
      color: #666666;
      font-size: 12px;
      line-height: 16px;
    }
    .content .copy {
      color: #007aff;
      margin-left: 6px;
    }
  }
}
</style>


