InfoCard.vue 4.3 KB
<template>
  <v-card id="InfoCard" flat >
    <div class="refreshBtnLine">
      
      <v-btn class="refresh-btn" small flat :loading="loading" round @click.native="$emit('refresh')">
        <i class="material-icons icon iconfont icon-shuaxin"></i>
      </v-btn>
    </div>
    <v-card-title id="waitingBalanceBlock">
      <div class="halfBlock" @click="$router.push('/lendHistory')">
        <div class="titleBlock">当前借出</div>
        <div class="numberBlock">{{info.startedCreditListCountResult || '0'}}<span>笔</span></div>
      </div>
      <div class="halfBlock" @click="$router.push('/borrowHistory')">
        <div class="titleBlock">当前借入</div>
        <div class="numberBlock">{{info.startedBorrowListCountResult || '0'}}<span>笔</span></div>
      </div>
    </v-card-title>
    <v-divider class="infoCardDivider"></v-divider>
    <v-card-text class="amountBlock" @click="$router.push('/lendHistory')">
        <div class="amountTitle" >待收款</div>
        <div class="amountCredit">{{info.toBeReceived || '0.00'}}<span class="amountUnit">元</span></div>
    </v-card-text>
    <v-card-text class="amountBlock" @click="$router.push('/borrowHistory')">
        <div class="amountTitle">待还款</div>
        <div class="amountBorrow">{{info.toBePaid || '0.00'}}<span class="amountUnit">元</span></div>
    </v-card-text>
  </v-card>
</template>

<script>
export default {
  data: () => ({
  }),
  props:{
    info: {
      type: Object,
      default: () => ({})
    },
    loading: {
      type: Boolean,
      default:() => (true)
    }
  }
}
</script>

<style lang="scss" scoped>
  #InfoCard {
    width: 84vw;
    margin: 1rem auto 0 auto;
    background-image: linear-gradient(160deg, #3A424A 0%, #282A2D 100%);
    border-radius: 1rem;
    position: relative;
    padding-bottom: 2.5rem;

    .infoCardDivider {
      width: 85%;
      margin: 1rem auto;
      box-sizing: border-box;
      background-color: $gold;

    }
    .refreshBtnLine {
      text-align: right;
      padding-top: 1rem;
      position: relative;

      .refresh-btn {
        color: $gold;
        min-width: 1.7rem;
        height: 1.3rem;
        width: 2.5rem;
        font-size: 1.4rem;
        position: absolute;
        right: 0.4rem;
        top: 0.6rem;
      }
    }

    .card__actions {
      position: relative;
      padding: 0;

      .refresh-btn {
        color: $gold;
        min-width: 1.7rem;
        height: 1.7rem;
        width: 2.5rem;
        font-size: 1.6rem;
        position: absolute;
        right: 0.4rem;
        top: 0.6rem;
      }
    }
    .titleBlock {
      width: 100%;
      font-size: 1rem;
      height: 1.2rem;
      line-height: 1.2rem;
      text-align: center;
      color: rgba(255, 255, 255, 0.7);
      // padding-left: 1rem;
    }
    .numberBlock {
      font-size: 3.5rem;
      height: 3.5rem;
      text-align: center;
      // font-weight: bold;
      font-weight: lighter;
      margin: 1rem 0;            
      color: $gold;
      text-align: center;
      span {
        font-size: 1rem;
        height: 1.2rem;
        line-height: 1.2rem;
        padding-left: 0.2rem;
        font-weight: normal;
      }
    }
    #walletBalanceBlock {
      text-align: center;
      padding: 0;
      padding-top: 2.2rem;
      
      div {
        width: 100%;
       
      }
    }
    .amountBlock {
      width: 85%;
      margin: auto;
      font-size: 1.2rem;
      box-sizing: border-box;
      padding: 1rem 0 0 0 ;
      
      div {
        display: inline-block;
      }
      .amountTitle {
        padding-right: 2rem;
        color: rgba(255, 255, 255, 0.7);
      }
      .amountCredit {
        width: 65%;
        text-align: right;
        color: #62a0d3;
        font-size: 1.7rem
      }
      .amountBorrow {
        width: 65%;
        text-align: right;
        color: #F57C00;
        font-size: 1.7rem;
      }
      .amountUnit {
        color: rgba(255, 255, 255, 0.7);
        padding-left: 0.5rem;
        font-size: 1.2rem;
      }
      .goPaidBtn {
        color: $gold;
        margin-left: 1rem ;
        border: 1px solid $gold;
        border-radius: 1rem;
        padding: 0 1rem;
        height: 2rem;
        line-height: 2rem;

      }
    }
    #waitingBalanceBlock {
      padding-top: 3rem;
      padding-bottom: 0.7rem;
      .halfBlock {
        width: 50%;
      }
    }
  }

</style>