rankItem.vue 1.11 KB
Newer Older
leiqingsong's avatar
leiqingsong committed
1 2 3
<template>
  <div class="rank-item">
    <span :class="['item-flex-1', 'index', `color-rank-${RankIndex}`]">
leiqingsong's avatar
leiqingsong committed
4 5
      {{ RankIndex > 9 ? RankIndex : "0" + RankIndex }}
    </span>
leiqingsong's avatar
leiqingsong committed
6 7 8 9 10 11 12 13 14 15 16
    <div style="flex:1">
      <img class="avatar" src="@/assets/images/avatar.png" alt="用户头像" />
    </div>
    <span class="userName" style="flex:2;text-align:center">135****4857</span>
    <span style="flex:2;text-align:center">25%</span>
    <span class="item-flex-1" style="color:#fc5202">¥125</span>
  </div>
</template>

<script>
export default {
leiqingsong's avatar
leiqingsong committed
17 18 19 20 21 22 23
  name: "RankItem",
  props: {
    RankIndex: {
      type: Number
    }
  }
};
leiqingsong's avatar
leiqingsong committed
24 25 26 27 28 29 30 31
</script>

<style lang="scss" scoped>
.rank-item {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
leiqingsong's avatar
leiqingsong committed
32
  font-family: PingFang-SC-Medium;
leiqingsong's avatar
leiqingsong committed
33
  font-size: 14px;
leiqingsong's avatar
leiqingsong committed
34
  .index {
leiqingsong's avatar
leiqingsong committed
35 36
    font-family: PingFang-SC-Bold;
    color: #999999;
leiqingsong's avatar
leiqingsong committed
37 38 39 40 41 42 43 44 45 46
  }
  .color-rank-1 {
    color: #fe0000;
  }
  .color-rank-2 {
    color: #fcb202;
  }
  .color-rank-3 {
    color: #00a0e9;
  }
leiqingsong's avatar
leiqingsong committed
47 48 49 50 51 52 53 54 55 56 57
}
.item-flex-1 {
  flex: 1;
  text-align: center;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}
</style>