Browse Source

付费用户管理优化

yuhao 2 years ago
parent
commit
70d56eb6d6

+ 3 - 1
src/components/common/layout/layout.vue

@@ -313,7 +313,9 @@ export default {
313 313
     }, 20000)
314 314
   },
315 315
   mounted () {
316
-    
316
+    if(this.$route.path=='/customerMan/details'){
317
+      this.isback=true
318
+    }
317 319
   },
318 320
   beforeDestroy () {
319 321
     // 关闭WebSocket连接并清除定时器

+ 6 - 1
src/pages/customerMan/details/index.vue

@@ -384,7 +384,11 @@ export default {
384 384
     },
385 385
   },
386 386
   watch: {},
387
-
387
+  // 返回页面缓存客户管理页面
388
+    beforeRouteLeave(to,from,next){
389
+    to.meta.keepAlive=true
390
+    next()
391
+  },
388 392
   methods: {
389 393
     // 获取客户管理详情
390 394
     getUserDetail() {
@@ -420,6 +424,7 @@ export default {
420 424
         path: "/testSkin",
421 425
         query: {
422 426
           isback: true,
427
+          id:this.id
423 428
         },
424 429
       });
425 430
     },

+ 31 - 4
src/pages/customerMan/index.vue

@@ -35,6 +35,8 @@
35 35
       <select-pop
36 36
         :visible.sync="dialogVisible"
37 37
         @saveSelectList="saveSelectList"
38
+        :resetPop='resetPop'
39
+        :key='key'
38 40
       ></select-pop>
39 41
     </div>
40 42
 
@@ -65,6 +67,12 @@
65 67
           show-overflow-tooltip
66 68
         >
67 69
         </el-table-column>
70
+        <el-table-column
71
+          prop="last_login_time"
72
+          label="最后登录时间"
73
+          show-overflow-tooltip
74
+        >
75
+        </el-table-column>
68 76
       </el-table>
69 77
 
70 78
       <div class="pagin">
@@ -117,11 +125,13 @@ export default {
117 125
       superpositionNum: 0,
118 126
       StoredPrice: 0,
119 127
       transitionNum: 0,
128
+      consumeprice:0,
129
+      resetPop:false, //设置筛选弹窗开关
130
+      key:1 //筛选弹框组件刷新加载
120 131
     };
121 132
   },
122 133
   computed: {},
123 134
   watch: {},
124
-
125 135
   methods: {
126 136
     // 筛选其他条件
127 137
     saveSelectList(
@@ -131,15 +141,17 @@ export default {
131 141
       latelyKey,
132 142
       superpositionNum,
133 143
       StoredPrice,
134
-      transitionNum
144
+      transitionNum,
145
+      consumeprice,
135 146
     ) {
136 147
       (this.customerKey = customerKey),
137 148
         (this.couponKey = couponKey),
138 149
         (this.cardKey = cardKey),
139
-        (this.latelyKey = cardKey),
150
+        (this.latelyKey = latelyKey),
140 151
         (this.superpositionNum = superpositionNum),
141 152
         (this.StoredPrice = StoredPrice),
142 153
         (this.transitionNum = transitionNum),
154
+        this.consumeprice = consumeprice
143 155
         this.getUserList();
144 156
     },
145 157
     // 筛选沉默用户
@@ -169,8 +181,9 @@ export default {
169 181
         project_add: this.superpositionNum,
170 182
         balance_money: this.StoredPrice,
171 183
         change_add: this.transitionNum,
184
+        consume_money:this.consumeprice
172 185
       };
173
-      api.getUserList(params).then((res) => {
186
+      api.getUserPayList(params).then((res) => {
174 187
         if (res.code == 200) {
175 188
           // 将用户手机号中间四位变成****
176 189
           res.data.list.map((item) => {
@@ -207,6 +220,20 @@ export default {
207 220
   },
208 221
 
209 222
   mounted() {},
223
+  // 不是客户详情页面返回重置数据
224
+  beforeRouteEnter(to, from, next) {
225
+    if (from.path != "/customerMan/details") {
226
+      next((vm)=>{
227
+        let key = vm.key
228
+        Object.assign(vm.$data, vm.$options.data());
229
+        vm.key=key+1 
230
+        vm.resetPop = true
231
+        vm.getUserList()
232
+      })
233
+    }else{
234
+      next()
235
+    }
236
+  },
210 237
 };
211 238
 </script>
212 239
 

+ 2 - 2
src/pages/customerMan/myOrder/index.vue

@@ -313,13 +313,13 @@ type: "全额券" -->
313 313
                   <div>
314 314
                     {{
315 315
                       scope.row.type == 1
316
-                        ? "重置"
316
+                        ? "充值"
317 317
                         : scope.row.type == 2
318 318
                         ? "充值赠送"
319 319
                         : scope.row.type == 3
320 320
                         ? "订单退款"
321 321
                         : scope.row.type == 5
322
-                        ? "现驳回"
322
+                        ? "现驳回"
323 323
                         : scope.row.type == -1
324 324
                         ? "消费"
325 325
                         : scope.row.type == -2

+ 35 - 12
src/pages/customerMan/selectPop/index.vue

@@ -94,14 +94,20 @@
94 94
               @change="transitionChange"
95 95
             ></el-input-number>
96 96
           </div>
97
-          <!-- <div class="consumePrice">
97
+          <div class="consumePrice">
98 98
             <div class="consumePrice-title">总消费金额</div>
99 99
             <div class="consumePrice-content">
100
-              <el-input v-model="minConsumePrice"></el-input>
100
+              <el-input
101
+                v-model="minConsumePrice"
102
+                @change="minConsume"
103
+              ></el-input>
101 104
               <div>-</div>
102
-              <el-input v-model="maxConsumePrice"></el-input>
105
+              <el-input
106
+                v-model="maxConsumePrice"
107
+                @change="maxConsume"
108
+              ></el-input>
103 109
             </div>
104
-          </div> -->
110
+          </div>
105 111
           <div class="StoredPrice">
106 112
             <div class="StoredPrice-title">总储值金额</div>
107 113
             <div class="StoredPrice-content">
@@ -135,7 +141,7 @@
135 141
 <script>
136 142
 import api from "../../../server/home";
137 143
 export default {
138
-  props: ["visible"],
144
+  props: ["visible",'resetPop'],
139 145
   data() {
140 146
     return {
141 147
       total: 0,
@@ -191,6 +197,9 @@ export default {
191 197
       let StoredPrice = [];
192 198
       StoredPrice.push(this.minStoredPricePrice);
193 199
       StoredPrice.push(this.maxStoredPricePrice);
200
+      let consumeprice = [];
201
+      consumeprice.push(this.minConsumePrice);
202
+      consumeprice.push(this.maxConsumePrice);
194 203
       let params = {
195 204
         page: this.currentPage1,
196 205
         limit: this.limit,
@@ -202,15 +211,18 @@ export default {
202 211
         balance_money:
203 212
           this.maxStoredPricePrice.length == 0 ? 0 : StoredPrice.toString(),
204 213
         change_add: this.transitionNum,
214
+        consume_money:
215
+          this.maxConsumePrice.length == 0 ? 0 : consumeprice.toString(),
205 216
       };
206
-      api.getUserList(params).then((res) => {
217
+      api.getUserPayList(params).then((res) => {
207 218
         if (
208 219
           this.customerKey.length == 0 &&
209 220
           this.couponKey.length == 0 &&
210 221
           this.cardKey.length == 0 &&
211 222
           this.latelyKey.length == 0 &&
212 223
           this.superpositionNum == 0 &&
213
-          this.maxStoredPricePrice.length == 0
224
+          this.maxStoredPricePrice.length == 0 &&
225
+          this.maxConsumePrice.length == 0
214 226
         ) {
215 227
           this.total = 0;
216 228
           return;
@@ -228,6 +240,9 @@ export default {
228 240
       let StoredPrice = [];
229 241
       StoredPrice.push(this.minStoredPricePrice);
230 242
       StoredPrice.push(this.maxStoredPricePrice);
243
+      let consumeprice = [];
244
+      consumeprice.push(this.minConsumePrice);
245
+      consumeprice.push(this.maxConsumePrice);
231 246
       this.$emit("update:visible", false);
232 247
       this.$emit(
233 248
         "saveSelectList",
@@ -237,13 +252,22 @@ export default {
237 252
         this.latelyKey.length == 0 ? 0 : this.latelyKey,
238 253
         this.superpositionNum,
239 254
         this.maxStoredPricePrice.length == 0 ? 0 : StoredPrice.toString(),
240
-        this.transitionNum
255
+        this.transitionNum,
256
+        this.maxConsumePrice.length == 0 ? 0 : consumeprice.toString()
241 257
       );
242 258
     },
243 259
     // 关闭弹窗
244 260
     closeFilterPop() {
245 261
       this.$emit("update:visible", false);
246 262
     },
263
+    // 消费最小值改变
264
+    minConsume() {
265
+      this.getUserList();
266
+    },
267
+    // 消费最大值改变
268
+    maxConsume() {
269
+      this.getUserList();
270
+    },
247 271
     // 最小值改变
248 272
     minChange() {
249 273
       this.getUserList();
@@ -311,10 +335,9 @@ export default {
311 335
     },
312 336
   },
313 337
   watch: {
314
-    visible(newValue, oldValue) {
315
-      // 关闭打开弹框重置数据
316
-      this.reset();
317
-    },
338
+    resetPop(newValue,oldValue){
339
+      this.reset()
340
+    }
318 341
   },
319 342
 };
320 343
 </script>

+ 1 - 1
src/pages/testSkin/index.vue

@@ -86,7 +86,7 @@ export default {
86 86
       let params = {
87 87
         page: this.currentPage1,
88 88
         limit: this.limit,
89
-        keywords: this.searchText,
89
+        keywords: this.searchText||this.$route.query.id,
90 90
         start_date: start_date,
91 91
         end_date: end_date,
92 92
       };

+ 4 - 1
src/router/map/home.js

@@ -54,7 +54,10 @@ export default {
54 54
   },
55 55
   {
56 56
     path: '/customerMan',
57
-    component: CustomerMan
57
+    component: CustomerMan,
58
+    meta:{
59
+      keepAlive:true
60
+    }
58 61
   },
59 62
   {
60 63
     path: '/customerMan/details',

+ 4 - 0
src/server/home.js

@@ -229,4 +229,8 @@ export default class Home {
229 229
   static getBalanceRecord (params) {
230 230
     return $http.post(url.getBalanceRecord, params)
231 231
   }
232
+  // 获取付费用户列表
233
+  static getUserPayList (params) {
234
+    return $http.get(url.getUserPayList, params)
235
+  }
232 236
 }

+ 4 - 1
src/server/urls.js

@@ -140,5 +140,8 @@ export default {
140 140
   editSign:'/v2/pad/detail/sign',
141 141
 
142 142
   // 余额变更记录
143
-  getBalanceRecord:'/v2/pad/detail/balance'
143
+  getBalanceRecord:'/v2/pad/detail/balance',
144
+
145
+  // 获取付费用户列表
146
+  getUserPayList:'/v2/pad/user/pay_list',
144 147
 }