StatisticsBox.vue 2.12 KB
<template>
  <div class="statistics">
      <div class="statistics-item" v-for="(item, index) in list" :key="index" :style="{'width': 100 / list.length + '%'}">
        <div class="statistics-top">
          <div class="statistics-name">{{item.name}}</div>
          <div class="statistics-price">¥<span class="statistics-price-number">{{item.value}}</span></div>
        </div>
        <div class="statistics-bottom">
          <template v-if="bottomType == 'money'">
            <span> {{item.moneyName}}</span>
            <span>¥{{item.moneyValue}}</span>
          </template>
          <template v-else-if="bottomType == 'default'">
            <span>{{item.moneyName}}</span>
            <span>{{item.moneyValue}}</span>
          </template>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: 'StatisticsBox',
  props: {
    list: {
      type: Array
    },
    bottomType: {
      type: String,
      default: 'default'
    }
  },
  data() {
    return {
    }
  },

  mounted() {},

  methods: {}
}
</script>

<style lang="scss" scoped>
.statistics {
  display: flex;
  color: #fff;
  height: 11.78vh;
  &-item {
    padding: 0.89vh 0.53vw;
    margin-right: 1.11vw;
    background: #061422;
    box-shadow: inset 0 0 20px 0 #3d57ff69;
    &:last-child {
      margin-right: 0;
    }
  }
  &-top {
    padding-left: 0.3vw;
  }
  &-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0.89vh;
    height: 2.22vh;
  }
  &-price {
    display: flex;
    align-items: center;
    color: #25D6FF;
    font-weight: 600;
    font-size: 14px;
    height: 3.11vh;
    &-number {
      padding-left: 0.56vw;
      font-size: 20px;
      color: #5894FF;
      background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
      -webkit-background-clip:text;
      -webkit-text-fill-color:transparent;
    }
  }
  &-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #95ACD9;
    border-top: 1px solid #2A3D72;
    padding: 0.89vh 0.3vw 0;
    margin-top: 0.89vh;
  }
}
</style>