|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="count-item">
|
|
<div class="count-item">
|
|
|
<span class="title">{{ title }}</span>
|
|
<span class="title">{{ title }}</span>
|
|
|
- <span v-for="num in nums" :class="num == ',' ? 'separator' : 'num'">{{ num }}</span>
|
|
|
|
|
|
|
+ <div class="count-content">
|
|
|
|
|
+ <span v-for="num in nums" :class="num == ',' ? 'separator' : 'num'">{{ num }}</span>
|
|
|
|
|
+ <span v-if="nums.length < 7">个</span>
|
|
|
|
|
+ <span v-if="nums.length > 7">万</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -19,9 +23,16 @@
|
|
|
methods: {
|
|
methods: {
|
|
|
formatNumber (num) {
|
|
formatNumber (num) {
|
|
|
let re = /(\d+)(\d{3})/
|
|
let re = /(\d+)(\d{3})/
|
|
|
|
|
+// let numLength = num.toString().length
|
|
|
|
|
+// for (var i=0;i< numLength; i++){
|
|
|
|
|
+// }
|
|
|
|
|
+// if (numLength > 6) {
|
|
|
|
|
+// let maxNum = num.slice(-1, 6)
|
|
|
|
|
+// console.log(maxNum)
|
|
|
|
|
+// }
|
|
|
num = (Array(10 - String(num).length).join(0) + num)
|
|
num = (Array(10 - String(num).length).join(0) + num)
|
|
|
while (re.test(num)) {
|
|
while (re.test(num)) {
|
|
|
- num = num.replace(re, '$1,$2')
|
|
|
|
|
|
|
+ num = num.replace(re, '$1,$2')
|
|
|
}
|
|
}
|
|
|
return num.split('')
|
|
return num.split('')
|
|
|
}
|
|
}
|
|
@@ -45,23 +56,54 @@
|
|
|
width: 60px;
|
|
width: 60px;
|
|
|
float: left;
|
|
float: left;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
|
+ line-height: 40px;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
}
|
|
|
.separator, .num {
|
|
.separator, .num {
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
}
|
|
}
|
|
|
.separator {
|
|
.separator {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
- color: $primary;
|
|
|
|
|
- margin: 0 5px 0 -2px;
|
|
|
|
|
|
|
+ color: #6cb7f3;
|
|
|
|
|
+ line-height: 38px !important;
|
|
|
|
|
+ margin: 0 5px 0 -5px;
|
|
|
|
|
+ width: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .count-content{
|
|
|
|
|
+ width: 145px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ margin-top: 5px;
|
|
|
|
|
+ margin-right: 5px;
|
|
|
|
|
+ span{
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
|
|
+ span.zero{
|
|
|
|
|
+ color: #bbdffb;
|
|
|
|
|
+ }
|
|
|
|
|
+ span:first-child{
|
|
|
|
|
+ margin-left: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+ span:last-child{
|
|
|
|
|
+ line-height: 30px;
|
|
|
|
|
+ color: #6cb7f3;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.num {
|
|
.num {
|
|
|
- background: $primary;
|
|
|
|
|
- width: 15px;
|
|
|
|
|
- height: 20px;
|
|
|
|
|
- margin-right: 10px;
|
|
|
|
|
|
|
+ background: #9dd0f9;
|
|
|
|
|
+ width: 18px;
|
|
|
|
|
+ height: 24px;
|
|
|
|
|
+ margin-right: 2px;
|
|
|
|
|
+ line-height: 24px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
color: $white;
|
|
color: $white;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
|
|
+ margin-top: 3px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|