Browse Source

优化首页

yuhao 2 years ago
parent
commit
c947cd9e1c
1 changed files with 21 additions and 32 deletions
  1. 21 32
      src/pages/home/index.vue

+ 21 - 32
src/pages/home/index.vue

@@ -227,7 +227,7 @@ export default {
227
       isGoodsPanel: false, //控制确认核销打开关闭
227
       isGoodsPanel: false, //控制确认核销打开关闭
228
       goodsCode: "", //美妆核销码
228
       goodsCode: "", //美妆核销码
229
       goodsList: "", //美妆核销信息
229
       goodsList: "", //美妆核销信息
230
-      orderKeyWord:'',//订单搜索关键字
230
+      orderKeyWord: "", //订单搜索关键字
231
     };
231
     };
232
   },
232
   },
233
   components: {
233
   components: {
@@ -238,7 +238,6 @@ export default {
238
   created: function () {
238
   created: function () {
239
     this.getTotal();
239
     this.getTotal();
240
     // this.getToday()
240
     // this.getToday()
241
-    this.getDate();
242
   },
241
   },
243
   destroyed() {
242
   destroyed() {
244
     this.cancelScan();
243
     this.cancelScan();
@@ -249,7 +248,7 @@ export default {
249
     goodsPickUp() {
248
     goodsPickUp() {
250
       api.goodsPickUp({ code: this.goodsCode }).then((res) => {
249
       api.goodsPickUp({ code: this.goodsCode }).then((res) => {
251
         this.goodsList = res.data;
250
         this.goodsList = res.data;
252
-		this.isGoodsPanel = true;
251
+        this.isGoodsPanel = true;
253
       });
252
       });
254
     },
253
     },
255
     // 美妆产品取货
254
     // 美妆产品取货
@@ -257,7 +256,7 @@ export default {
257
       api.goodsTakeOut({ id: this.goodsList.id }).then((res) => {
256
       api.goodsTakeOut({ id: this.goodsList.id }).then((res) => {
258
         if (res.code == 200) {
257
         if (res.code == 200) {
259
           this.$message.success("取货成功");
258
           this.$message.success("取货成功");
260
-          this.isGoodsPanel=false
259
+          this.isGoodsPanel = false;
261
           this.goodsCode = "";
260
           this.goodsCode = "";
262
           this.goodsList = "";
261
           this.goodsList = "";
263
         }
262
         }
@@ -277,24 +276,6 @@ export default {
277
         },
276
         },
278
       });
277
       });
279
     },
278
     },
280
-    // 获取当天日期&&当天预约总数
281
-    getDate() {
282
-      let date = new Date();
283
-      this.date = date.getMonth() + 1 + "月" + date.getDate() + "日";
284
-      let day =
285
-        date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
286
-      api
287
-        .reservedRecords({
288
-          day,
289
-        })
290
-        .then((res) => {
291
-          let total = 0;
292
-          res.data.forEach((item) => {
293
-            total = item.list.length + total;
294
-          });
295
-          this.totalSum = total;
296
-        });
297
-    },
298
     // 扫码核销订单
279
     // 扫码核销订单
299
     cancelQR() {
280
     cancelQR() {
300
       this.startRecognize();
281
       this.startRecognize();
@@ -362,6 +343,11 @@ export default {
362
           this.tabList[0].num = res.data.order_num;
343
           this.tabList[0].num = res.data.order_num;
363
           this.tabList[1].num = res.data.wait_pay_num;
344
           this.tabList[1].num = res.data.wait_pay_num;
364
           this.tabList[2].num = res.data.cancel_num;
345
           this.tabList[2].num = res.data.cancel_num;
346
+          // 今天日期
347
+          let date = new Date();
348
+          this.date = date.getMonth() + 1 + "月" + date.getDate() + "日";
349
+          // 订单总数
350
+          this.totalSum = Number(res.data.order_num)+Number(res.data.wait_pay_num)+Number(res.data.cancel_num)
365
         }
351
         }
366
       });
352
       });
367
     },
353
     },
@@ -372,20 +358,21 @@ export default {
372
       this.loading = false;
358
       this.loading = false;
373
       this.finished = false;
359
       this.finished = false;
374
       this.page = 1;
360
       this.page = 1;
361
+      this.getToday();
375
     },
362
     },
376
     //搜索订单
363
     //搜索订单
377
-    searchOrder(){
364
+    searchOrder() {
378
       setTimeout(() => {
365
       setTimeout(() => {
379
         api
366
         api
380
           .getToday({
367
           .getToday({
381
             page: 1,
368
             page: 1,
382
             limit: 20,
369
             limit: 20,
383
             type: 0,
370
             type: 0,
384
-            keywords:this.orderKeyWord
371
+            keywords: this.orderKeyWord,
385
           })
372
           })
386
           .then((res) => {
373
           .then((res) => {
387
             if ((res.code = 200)) {
374
             if ((res.code = 200)) {
388
-              this.orderList = res.data.list
375
+              this.orderList = res.data.list;
389
             }
376
             }
390
           });
377
           });
391
       }, 1000);
378
       }, 1000);
@@ -692,28 +679,27 @@ export default {
692
   .order-list {
679
   .order-list {
693
     margin-top: 18px;
680
     margin-top: 18px;
694
     width: 100%;
681
     width: 100%;
695
-    background: #ffffff;
682
+    background: #f7f8fa;
696
     box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
683
     box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
697
     border-radius: 8px;
684
     border-radius: 8px;
698
     overflow: hidden;
685
     overflow: hidden;
699
 
686
 
700
-    // padding:0px 12px 14px 12px;
701
     .order-list-top {
687
     .order-list-top {
702
       width: 100%;
688
       width: 100%;
703
       height: 48px;
689
       height: 48px;
704
       display: flex;
690
       display: flex;
705
-
691
+      background-color: #fff;
706
       .tab {
692
       .tab {
707
         width: 402px;
693
         width: 402px;
708
         height: 48px;
694
         height: 48px;
709
         background-color: #ffffff;
695
         background-color: #ffffff;
710
         display: flex;
696
         display: flex;
711
         overflow: hidden;
697
         overflow: hidden;
712
-
698
+        border-radius: 8px;
713
         .tabItem {
699
         .tabItem {
714
           width: 134px;
700
           width: 134px;
715
           height: 48px;
701
           height: 48px;
716
-          background: #ffffff;
702
+          background-color: #ffffff;
717
           text-align: center;
703
           text-align: center;
718
           line-height: 48px;
704
           line-height: 48px;
719
           font-size: 20px;
705
           font-size: 20px;
@@ -722,6 +708,7 @@ export default {
722
           position: relative;
708
           position: relative;
723
           display: flex;
709
           display: flex;
724
           justify-content: center;
710
           justify-content: center;
711
+          border-radius: 8px;
725
         }
712
         }
726
 
713
 
727
         .tabName {
714
         .tabName {
@@ -753,7 +740,7 @@ export default {
753
 
740
 
754
       .search {
741
       .search {
755
         flex: 1;
742
         flex: 1;
756
-        border-radius: 0px 0px 0px 30px;
743
+        border-radius: 0px 0px 0px 24px;
757
         background-color: #f7f8fa;
744
         background-color: #f7f8fa;
758
         display: flex;
745
         display: flex;
759
         align-items: center;
746
         align-items: center;
@@ -792,7 +779,9 @@ export default {
792
     .list-info {
779
     .list-info {
793
       height: 450px;
780
       height: 450px;
794
       overflow: auto;
781
       overflow: auto;
795
-
782
+      border-radius: 0 8px 0 0;
783
+      overflow: hidden;
784
+      background-color: #fff;
796
       .user-info {
785
       .user-info {
797
         padding: 14px 0;
786
         padding: 14px 0;
798
         border-bottom: 1px solid #e6e6e6;
787
         border-bottom: 1px solid #e6e6e6;