Blame view

src/components/memberNum/index.vue 6.28 KB
22fb20b3   songchongxian   城市停车运营监控
1
  <template>
e52cf1d6   liuqimichale   添加丹阳
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
      <div class="app-memberNumBox">
          <div class="theme-card">
              <div class="title"><span>用户数</span></div>
              <div class="content">
                  <div class="topBox eleVerHorCenter-flex">
                      <span class="eleText">总计</span>
                      <div class="eleMarginLeft" v-html="memberNumTotal"></div>
                  </div>
                  <div class="bottomBox">
                      <table class="memberNumTb">
                          <tr>
                              <td>
                                  <div class="activeUserBox"><span class="activeUserNum">{{activeUserNum}}</span>
                                      <div class="activeUserText">日活跃</div>
                                  </div>
                              </td>
                              <td>
                                  <div class="memberRadarBox">
                                      <div class="memberRadar eleRotation"></div>
                                  </div>
                              </td>
                              <td>
                                  <div class="newUerBox"><span class="newUerNum">{{newUerNum}}</span>
                                      <div class="newUerNumText">新增用户</div>
                                  </div>
                              </td>
                          </tr>
                      </table>
                  </div>
              </div>
22fb20b3   songchongxian   城市停车运营监控
32
          </div>
22fb20b3   songchongxian   城市停车运营监控
33
      </div>
22fb20b3   songchongxian   城市停车运营监控
34
35
36
  </template>
  
  <script>
e52cf1d6   liuqimichale   添加丹阳
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
  import {mapActions} from 'vuex'
  import common from '../../api/common';
  import {memberAddress, memberAddressDY} from '../../api/api'
  // import axios from 'axios'
  export default {
    name: "memberNum",
    data() {
      return {
        demo: '',//示例 总数
        memberNumTotal: "",//会员总数html
        activeUserNum: '',//日活跃
        newUerNum: '',//新增用户
        name: '会员数'
      }
    },
    mounted() {
      //会员总数
      this.onLoad()
    },
    methods: {
      ...mapActions([
        'transferParkingTotal'
      ]),
      onLoad() {
        // Promise.all([memberAddress(), memberAddressDY()]).then(function(values) {
        //   console.log(values);//values为一个数组
        //   ///进行你的下一步操作
        // });
        this.$axios.all([memberAddress(), memberAddressDY()])
        .then(this.$axios.spread((acctWX, acctDY) => {
          let WXdata = acctWX.data.data
          let DYdata = acctDY.data.data
          this.registerNum = WXdata.registerNum+DYdata.registerNum
          this.activeUserNum = WXdata.todayActiveNum+DYdata.todayActiveNum
          this.newUerNum = WXdata.todayRegisterNum+DYdata.todayRegisterNum
          this.memberNumTotal = common.formatNumToStr(this.registerNum)
          this.$store.dispatch('transferParkingTotal', this.registerNum)
        }))
22fb20b3   songchongxian   城市停车运营监控
75
  
22fb20b3   songchongxian   城市停车运营监控
76
      }
e52cf1d6   liuqimichale   添加丹阳
77
78
79
80
81
82
      /*
       * 格式化会员总数
      //  * */
      // formatNumToStr:function(){
      //   return common.formatNumToStr(this.$options.data().demo);
      // },
22fb20b3   songchongxian   城市停车运营监控
83
  
22fb20b3   songchongxian   城市停车运营监控
84
    }
e52cf1d6   liuqimichale   添加丹阳
85
86
  }
  </script>
22fb20b3   songchongxian   城市停车运营监控
87
  
e52cf1d6   liuqimichale   添加丹阳
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  <style scoped lang="scss">
      .app-memberNumBox {
          width: 100%;
          .theme-card {
              height: 100%;
          }
          .topBox, .bottomBox {
              border: 0px solid red;
          }
          .memberNumTb {
              margin: 0 auto;
              width: 100%;
              height: 100%;
          }
          .memberNumTb > tr {
              width: 100%;
              height: 100%;
          }
          .memberNumTb > tr > td {
              height: 100%;
              width: 33.333%;
          }
          /*.memberNumTb >tr>td:first-child{*/
          /*width:25%;*/
          /*}*/
          /*.memberNumTb >tr>td:last-child{*/
          /*width:25%;*/
          /*}*/
          .memberNumTb > tr > td:nth-child(2) {
              vertical-align: middle;
              text-align: center;
              position: relative;
22fb20b3   songchongxian   城市停车运营监控
120
  
e52cf1d6   liuqimichale   添加丹阳
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
          }
          .memberNumTb > tr > td:first-child {
              vertical-align: middle;
              text-align: right;
              padding-right: 5px;
          }
          .memberNumTb > tr > td:last-child {
              vertical-align: middle;
              text-align: left;
              padding-left: 5px;
          }
          .memberRadar {
              background: url(../../images/com/memberRadar.png) no-repeat;
              background-size: 100% 100%;
              width: 90%;
              height: 0;
              padding-bottom: 90%;
              margin: auto;
22fb20b3   songchongxian   城市停车运营监控
139
  
e52cf1d6   liuqimichale   添加丹阳
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
              background-position: center center;
              background-repeat: no-repeat;
              background-size: cover;
              -webkit-background-size: cover;
              -moz-background-size: cover;
          }
          .memberRadarBox:before {
              content: " ";
              display: block;
              height: 30px;
              width: 30px;
              background: url(../../images/com/memberactiveUser.svg) no-repeat;
              background-size: 100%;
              position: absolute;
              left: 0px;
              top: 15px;
              z-index: 8;
          }
          .memberRadarBox:after {
              content: " ";
              display: block;
              height: 30px;
              width: 30px;
              background: url(../../images/com/membernewUer.svg) no-repeat;
              background-size: 100%;
              position: absolute;
              right: 0px;
              bottom: 15px;
              z-index: 8;
          }
          .activeUserNum {
              background-image: -webkit-linear-gradient(bottom, #67F967, #05C405);
              -webkit-background-clip: text;
              -webkit-text-fill-color: transparent;
              font-size: 24px;
          }
          .newUerNum {
              background-image: -webkit-linear-gradient(bottom, #FFBA00, #FF8100);
              -webkit-background-clip: text;
              -webkit-text-fill-color: transparent;
              font-size: 24px;
          }
          .activeUserText, .newUerNumText {
              font-size: 12px;
          }
          .activeUserText:after {
              content: " ";
              display: inline-block;
              height: 12px;
              width: 13px;
              background: url(../../images/com/activeUser.png) no-repeat;
              background-size: 100%;
              margin-left: 5px;
          }
          .newUerNumText:before {
              content: " ";
              display: inline-block;
              height: 12px;
              width: 13px;
              background: url(../../images/com/newUser.png) no-repeat;
              background-size: 100%;
              margin-right: 5px;
          }
  
      }
22fb20b3   songchongxian   城市停车运营监控
205
  </style>