<template>
   <router-link :to="targetUrl">
     <div class="status-wrapper" :class="'status-' + iconType">
         <div class="status__head">
            <svg class="icon" aria-hidden="true">
                <use :xlink:href="iconMap[iconType]"/>
            </svg>
            <span class="status-code">
              {{txtMap[iconType]}}编号：{{code}}
            </span>
            <span class="status-txt" :class="{
                  'status__disabled': statusMap[iconType][statusDesc] === 'disabled',
                  'status__success': statusMap[iconType][statusDesc] === 'success',
                  'status__failed': statusMap[iconType][statusDesc] === 'failed',
                  'status__evaluate': statusMap[iconType][statusDesc] === 'evaluate'
            }"
>
              {{statusDesc}}
            </span>
         </div>
         <div class="status__content-wrap">
            <div class="status__content">
               <slot name="content"></slot>
            </div>
            <div class="status__footer">
               <slot name="footer"></slot>
            </div>
         </div>
     </div>
   </router-link>
</template>

<script>
//import { mapState } from 'vuex'

export default {
  name: "statusCard",
  props: ["data", "iconType", "statusDesc", "code", "targetUrl"],
  components: {
    //addPane
  },
  computed: {
    // ...mapState({
          
    // })
  },
  mounted() {
      
  },
  data: function() {
    return {
      name: "template",
      iconMap: {
        apply: "#icon-shenqing1",
        maintenance: "#icon-weibao2",
        subscribe: "#icon-yuyue1",
        activity: "#icon-huodong"
      },
      txtMap: {
        apply: "申请",
        maintenance: "维保",
        subscribe: "预约",
        activity: "订单"
      },
      statusMap: {
        apply: {
          "待核验": "disabled",
          2: "success",
          "待选房": "failed",
          "申请不通过": "failed",
          "待办理": "failed",
          "待支付": "failed",
          "待备案": "failed",
          4: "over",
          5: "evaluate"
        },
        maintenance: {
          1: "disabled",
          "已受理": "success",
          "待处理": "failed",
          "待支付": "failed",
          "已完成": "over",
          "待评价": "evaluate"
        },
        subscribe: {
          1: "disabled",
          2: "success",
          3: "failed",
          4: "over",
          5: "evaluate"
        },
        activity: {
          "已支付": "disabled",
          2: "success",
          "待付款": "failed",
          4: "over",
          5: "evaluate"
        }
      }
    };
  },
  methods: {

  }
};
</script>
<style scoped lang='less'>
    @import "~@/common/less/variable.less";
    @nice-blue: #59AAFF;
    @nice-purple: #B97CE6;
    @nice-pink:#F88989;
    .status__disabled {
      color: @nice-gray;
    }
    .status__success {
      color: @nice-green;
    }
    .status__failed {
      color: @nice-red;
    }
    .status__evaluate {
      color: @nice-orange;
    }
    .status-apply {
      .icon {
        color: @nice-green;
      }
    }
    .status-maintenance {
      .icon {
        color: @nice-blue;
      }
    }
    .status-subscribe {
      .icon {
        color: @nice-purple;
      }
    }
    .status-activity {
      .icon {
        color: @nice-pink;
      }
    }
    .status-wrapper {
      width: 100%;
      margin-bottom: 12.28px;
      .status-code {
        font-size: 14px;
        font-weight: bold;
      }
      .status__head {
        position: relative;
        height: 33px;
        line-height: 33px;
        padding: 0 10px;
        text-align: left;
        background: white;
        margin-bottom: 1.8px;
      }
      .status-txt {
        position: absolute;
        font-weight: bold;
        right: 10px;
        font-size: 14px;
      }
      .status__content-wrap {
        background: white;
        padding: 10px;
        position: relative;
        padding-top: 13.2px;
      }
      .status__content {
        width: 100%;
        text-align: left;
        font-size: 13px;
        box-sizing: border-box;
        padding: 10px 0;
        padding-left: 14px;
        background: #F5F5F5;        
      }
      .status__footer {
        margin-top: 8.5px;
        font-size: 13px;
        text-align: left;
        margin-left: 14px;
      }
      .status-fee {
        color: @nice-red;
      }
    }
</style>