1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<div class="rank-item">
<span :class="['item-flex-1', 'index', `color-rank-${RankIndex}`]">
{{ RankIndex > 9 ? RankIndex : "0" + RankIndex }}
</span>
<div style="flex:1">
<img
class="avatar"
:src="imgBaseUrl + prizeVos.headImage"
alt="用户头像"
/>
</div>
<span class="userName" style="flex:2;text-align:center">{{
prizeVos.userId
}}</span>
<span style="flex:2;text-align:center">{{ prizeVos.growthRate }}%</span>
<span class="item-flex-1" style="color:#fc5202"
>¥{{ prizeVos.awardMoney }}</span
>
</div>
</template>
<script>
export default {
name: "RankItem",
props: {
RankIndex: {
type: Number
},
prizeVos: {
type: Object
}
},
data() {
return {
imgBaseUrl: ""
};
},
created() {
this.imgBaseUrl = process.env.VUE_APP_BASE_URL;
}
};
</script>
<style lang="scss" scoped>
.rank-item {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
font-family: PingFang-SC-Medium;
font-size: 14px;
.index {
font-family: PingFang-SC-Bold;
color: #999999;
}
.color-rank-1 {
color: #fe0000;
}
.color-rank-2 {
color: #fcb202;
}
.color-rank-3 {
color: #00a0e9;
}
}
.item-flex-1 {
flex: 1;
text-align: center;
}
.avatar {
width: 35px;
height: 35px;
border-radius: 50%;
}
</style>