Blame view

src/components/base/AccountNum.vue 1.99 KB
f9b345a2   liuqimichale   全局filters
1
2
  <template>
      <div class="total-wrap">
d3312374   liuqimichale   收费员信息
3
          <slot></slot>
43352ba2   liuqimichale   数字处理
4
          <div class="total-main" >
70ecadad   liuqimichale   数字动画
5
6
7
8
              <!--<countTo :startVal='0' :endVal='total' :duration='1000'></countTo>-->
              <div  v-for="(item,index) in total" :key="index" :class="item !==',' ? 'eleNumBg':'noeleNumBg'" >
                 <!--{{item}}  -->
                  <countTo :startVal='0' :endVal='Number(item)' :duration='2000'></countTo>
f9b345a2   liuqimichale   全局filters
9
10
11
12
13
14
15
              </div>
          </div>
      </div>
  </template>
  
  <script>
  import { formaterTotal } from '../../utils/formate'
70ecadad   liuqimichale   数字动画
16
  import countTo from 'vue-count-to'
f9b345a2   liuqimichale   全局filters
17
18
  export default {
    name: 'AccountNum',
70ecadad   liuqimichale   数字动画
19
20
21
    components:{
      countTo
    },
633692cc   liuqimichale   axios
22
    props:['totalnum'],
f9b345a2   liuqimichale   全局filters
23
24
    data(){
      return {
350097e4   liuqimichale   调取接口
25
26
27
28
29
30
31
32
        //total: formaterTotal(this.totalnum)
      }
    },
    created(){
      //console.log(this.totalnum)
    },
    computed:{
      total(){
70ecadad   liuqimichale   数字动画
33
34
        console.log(typeof this.totalnum)
        return  formaterTotal(this.totalnum)
f9b345a2   liuqimichale   全局filters
35
36
37
38
39
40
41
42
43
44
      }
    }
  }
  </script>
  
  <style scoped lang="scss">
      .total-wrap{
          height: 30%;
          display: flex;
          align-items: center;
70ecadad   liuqimichale   数字动画
45
          >span{
d3312374   liuqimichale   收费员信息
46
47
48
49
              display: inline-block;
              width: 50px;
              text-align: left;
          }
f9b345a2   liuqimichale   全局filters
50
          .total-main{
d3312374   liuqimichale   收费员信息
51
              /*margin-left: 10px;*/
f9b345a2   liuqimichale   全局filters
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
              padding: 5px 5px 5px 0;
              background: url("../../images/content/numBorder.svg") no-repeat;
              background-size: 100% 100%;
          }
          .eleNumBg{
              width: 20px;
              height: 30px;
              display: inline-block;
              margin-left: 5px;
              line-height: 30px;
              font-size: 22px;
              font-weight: 600;
              text-align: center;
              background: url("../../images/content/numBg.svg") no-repeat;
              background-size: 100% 100%;
          }
43352ba2   liuqimichale   数字处理
68
69
70
71
72
73
74
75
76
77
          .noeleNumBg{
              width: 10px;
              height: 30px;
              display: inline-block;
              margin-left: 5px;
              line-height: 30px;
              font-size: 22px;
              font-weight: 600;
              text-align: center;
          }
f9b345a2   liuqimichale   全局filters
78
79
      }
  </style>