Ver código fonte

优化首页订单搜索加载状态

yuhao 2 anos atrás
pai
commit
9adc008d15
1 arquivos alterados com 15 adições e 5 exclusões
  1. 15 5
      src/pages/home/index.vue

+ 15 - 5
src/pages/home/index.vue

@@ -118,7 +118,7 @@
118 118
           />
119 119
         </div>
120 120
       </div>
121
-      <div class="list-info">
121
+      <div v-loading="searchLoading" class="list-info">
122 122
         <van-list
123 123
           v-model="loading"
124 124
           :finished="finished"
@@ -193,7 +193,7 @@ import api from "@/server/home";
193 193
 import vanList from "vant/lib/list";
194 194
 import minePupop from "../../components/minePupop/index.vue";
195 195
 import "vant/lib/list/style";
196
-import { log } from 'console';
196
+import { log } from "console";
197 197
 export default {
198 198
   data() {
199 199
     return {
@@ -229,6 +229,7 @@ export default {
229 229
       goodsCode: "", //美妆核销码
230 230
       goodsList: "", //美妆核销信息
231 231
       orderKeyWord: "", //订单搜索关键字
232
+      searchLoading: false, //订单搜索加载
232 233
     };
233 234
   },
234 235
   components: {
@@ -248,7 +249,7 @@ export default {
248 249
     // 美妆产品核销
249 250
     goodsPickUp() {
250 251
       api.goodsPickUp({ code: this.goodsCode }).then((res) => {
251
-        if(res.code==200){
252
+        if (res.code == 200) {
252 253
           this.goodsList = res.data;
253 254
           this.isGoodsPanel = true;
254 255
         }
@@ -350,7 +351,10 @@ export default {
350 351
           let date = new Date();
351 352
           this.date = date.getMonth() + 1 + "月" + date.getDate() + "日";
352 353
           // 订单总数
353
-          this.totalSum = Number(res.data.order_num)+Number(res.data.wait_pay_num)+Number(res.data.cancel_num)
354
+          this.totalSum =
355
+            Number(res.data.order_num) +
356
+            Number(res.data.wait_pay_num) +
357
+            Number(res.data.cancel_num);
354 358
         }
355 359
       });
356 360
     },
@@ -361,10 +365,11 @@ export default {
361 365
       this.loading = true;
362 366
       this.finished = false;
363 367
       this.page = 1;
364
-      this.getToday()
368
+      this.getToday();
365 369
     },
366 370
     //搜索订单
367 371
     searchOrder() {
372
+      this.searchLoading = true;
368 373
       setTimeout(() => {
369 374
         api
370 375
           .getToday({
@@ -376,6 +381,7 @@ export default {
376 381
           .then((res) => {
377 382
             if ((res.code = 200)) {
378 383
               this.orderList = res.data.list;
384
+              this.searchLoading = false;
379 385
             }
380 386
           });
381 387
       }, 1000);
@@ -904,4 +910,8 @@ export default {
904 910
 .color-3 {
905 911
   color: #fc3019 !important;
906 912
 }
913
+// 加载中修改颜色
914
+/deep/.el-loading-spinner .path {
915
+  stroke: #fa7d22;
916
+}
907 917
 </style>