EquityOrder.vue 2.48 KB
<template>
  <div class='business-desc-wrap' v-if='orderList'>
    <div class='business-top flex'>
      <div class='business-border'>
        <div class='business-title'>订单总量</div>
        <div class='business-number'>{{ toThousands(orderList.totalNum) }}</div>
      </div>
      <div class='business-border'>
        <div class='business-title'>订单总金额</div>
        <div class='business-number'>{{ toThousands(orderList.totalMoney) }}</div>
      </div>
      <div class='business-border'>
        <div class='business-title'>今年订单量</div>
        <div class='business-number'>{{ toThousands(orderList.thisyear) }}</div>
      </div>
      <div class='business-border'>
        <div class='business-title'>今年订单金额</div>
        <div class='business-number'>{{ toThousands(orderList.thisyearMoney) }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'EquityOrder',
  props: {
    orderList: {
      type: Object,
      default: () => {
      }
    }
  },
  data() {
    return {}
  },
  methods: {
    toThousands(n) {
      // return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
      return n.toString().replace(/\d+/, function(m) {
        return m.replace(/(\d)(?=(\d{3})+$)/g, function(y) {
          return y + ','
        })
      })
    }
  }
}
</script>

<style scoped lang='scss'>
.business-desc-wrap {
  .business-top {
    //justify-content: space-between;
    justify-content: space-around;
    //text-align: center;
    .business-border {
      height: 6.71vh;
      width: 10vw;
      padding: 0.4vh 1.11vw;
      box-sizing: border-box;
      background: #0b0e31;

      .business-title {
        font-weight: 400;
        font-size: 12px;
        color: #e8e8e8;
      }

      .business-number {
        font-weight: 700;
        font-size: 20px;
        line-height: 30px;
        color: #6578ff;
      }

      .business-time {
        font-weight: 700;
        font-size: 20px;
        line-height: 30px;
        color: #6578ff;
      }
    }
  }

  .business-bottom {
    margin-top: 0.5vh;
    height: 6.71vh;
    width: 100%;
    padding: 0.4vh 1.11vw;
    box-sizing: border-box;
    background: #0b0e31;

    .business-border {
      &:first-child {
        width: 12vw;
      }
    }

    .business-title {
      font-weight: 400;
      font-size: 12px;
      color: #e8e8e8;
    }

    .business-number {
      font-weight: 700;
      font-size: 24px;
      line-height: 30px;
      color: #6578ff;
    }

  }
}
</style>