StatisticsBox.vue
2.07 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<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;
&-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-bottom: 0.89vh;
padding-left: 0.3vw;
}
&-name {
font-weight: 500;
font-size: 14px;
margin-bottom: 0.89vh;
}
&-price {
display: flex;
align-items: center;
color: #25D6FF;
font-weight: 600;
font-size: 14px;
&-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;
}
}
</style>