Просмотр исходного кода

退回上一页动画修改及接单中心样式修改

Yannay месяцев назад: 2
Родитель
Сommit
46ec2e34bf
2 измененных файлов с 56 добавлено и 23 удалено
  1. 8 2
      pages/orderDetailNew/components/pageFour.vue
  2. 48 21
      pages/pagereceivecenter/pagereceivecenter.vue

+ 8 - 2
pages/orderDetailNew/components/pageFour.vue

@@ -504,8 +504,14 @@ export default {
504
                             message: "入库成功",
504
                             message: "入库成功",
505
                             iconUrl: "https://uviewui.com/demo/toast/success.png",
505
                             iconUrl: "https://uviewui.com/demo/toast/success.png",
506
                             complete() {
506
                             complete() {
507
-                                uni.navigateTo({
508
-                                    url: '/pages/pagereceivecenter/pagereceivecenter',
507
+                                // uni.navigateTo({
508
+                                //     url: '/pages/pagereceivecenter/pagereceivecenter',
509
+                                // })
510
+
511
+                                //退回上一页
512
+                                uni.navigateBack({
513
+                                    delta: 1,
514
+                                    animationType: 'pop-out'
509
                                 })
515
                                 })
510
                             },
516
                             },
511
                         });
517
                         });

+ 48 - 21
pages/pagereceivecenter/pagereceivecenter.vue

@@ -97,7 +97,8 @@ export default {
97
         //获取统计数据
97
         //获取统计数据
98
         async getStatisticsSendStatus() {
98
         async getStatisticsSendStatus() {
99
             const { data } = await uni.$u.api.statisticsSendStatus({ type: this.activeType });
99
             const { data } = await uni.$u.api.statisticsSendStatus({ type: this.activeType });
100
-            console.log('统计数据是', data)
100
+            // console.log('统计数据是', data)
101
+
101
             this.statisticsSendStatus = data;
102
             this.statisticsSendStatus = data;
102
         },
103
         },
103
         // 处理按钮点击事件
104
         // 处理按钮点击事件
@@ -176,12 +177,13 @@ export default {
176
 
177
 
177
         //滑动加载
178
         //滑动加载
178
         scrolltolower() {
179
         scrolltolower() {
179
-            console.log('到底了');
180
-            // if (this.orderList.length >= this.page.total) {
181
-            //     return uni.$u.toast('没有更多了');
182
-            // }
183
-            this.page.pageNum++;
184
-            this.getOrderList();
180
+            // console.log('到底了');
181
+            if (this.orderList.length >= this.page.total) {
182
+                //到底了,没有更多
183
+            } else {
184
+                this.page.pageNum++;
185
+                this.getOrderList();
186
+            }
185
         },
187
         },
186
 
188
 
187
         //获取全部标签
189
         //获取全部标签
@@ -236,10 +238,19 @@ export default {
236
         },
238
         },
237
         //切换统计数据的类型
239
         //切换统计数据的类型
238
         changeStatus(param) {
240
         changeStatus(param) {
239
-            this.activeStatus = param;
240
-            this.page.pageNum = 1;
241
-            this.orderList = [];
242
-            this.getOrderList();
241
+            if (param == this.activeStatus) {
242
+                //如果当前点击的状态和当前选中的状态相同,则取消选中
243
+                this.activeStatus = '';
244
+                this.page.pageNum = 1;
245
+                this.orderList = [];
246
+                this.getOrderList();
247
+            } else {
248
+                //如果当前点击的状态和当前选中的状态不同,则切换选中状态
249
+                this.activeStatus = param;
250
+                this.page.pageNum = 1;
251
+                this.orderList = [];
252
+                this.getOrderList();
253
+            }
243
         },
254
         },
244
     }
255
     }
245
 }
256
 }
@@ -253,13 +264,16 @@ export default {
253
         <u-tabs :list="filterList" @click="changeFilter"></u-tabs>
264
         <u-tabs :list="filterList" @click="changeFilter"></u-tabs>
254
 
265
 
255
         <!-- 统计数据 -->
266
         <!-- 统计数据 -->
256
-        <view class="statisticsContainer">
257
-            <view v-for="item in statisticsSendStatus" :key="item.status" @click="changeStatus(item.status)"
258
-                class="statisticsItem">
259
-                <view>{{ item.statusName }}</view>
260
-                <view>({{ item.count || 0 }})</view>
267
+        <scroll-view scroll-x class="statusScrollView" style="width: 100%;">
268
+            <view class="statisticsContainer">
269
+                <view v-for="item in statisticsSendStatus" :key="item.status" @click="changeStatus(item.status)"
270
+                    class="statisticsItem" :class="{ 'activeStatusClass': item.status == activeStatus }">
271
+                    <view>{{ item.statusName }}</view>
272
+                    <view>({{ item.count || 0 }})</view>
273
+                </view>
261
             </view>
274
             </view>
262
-        </view>
275
+        </scroll-view>
276
+
263
 
277
 
264
         <view class="scrollViewContainer">
278
         <view class="scrollViewContainer">
265
             <scroll-view class="scrollView" scroll-y @scrolltolower="scrolltolower">
279
             <scroll-view class="scrollView" scroll-y @scrolltolower="scrolltolower">
@@ -349,7 +363,7 @@ export default {
349
                     </view>
363
                     </view>
350
                 </transition-group>
364
                 </transition-group>
351
                 <view class="hasMore">
365
                 <view class="hasMore">
352
-                    <!-- {{ orderList.length >= page.total ? '没有更多了~' : '向下滑动加载更多~' }} -->
366
+                    {{ orderList.length >= page.total ? '没有更多了~' : '向下滑动加载更多~' }}
353
                 </view>
367
                 </view>
354
             </scroll-view>
368
             </scroll-view>
355
         </view>
369
         </view>
@@ -587,9 +601,10 @@ export default {
587
 
601
 
588
 .statisticsContainer {
602
 .statisticsContainer {
589
     display: flex;
603
     display: flex;
590
-    justify-content: space-around;
591
     align-items: center;
604
     align-items: center;
592
-    gap: 20rpx;
605
+    flex-wrap: nowrap;
606
+    white-space: nowrap;
607
+    padding: 0 0rpx;
593
 }
608
 }
594
 
609
 
595
 .statisticsItem {
610
 .statisticsItem {
@@ -601,6 +616,18 @@ export default {
601
     border-radius: 15rpx;
616
     border-radius: 15rpx;
602
     font-size: 24rpx;
617
     font-size: 24rpx;
603
     font-weight: 700;
618
     font-weight: 700;
604
-    width: 100rpx;
619
+    margin: 0 10rpx;
620
+    white-space: nowrap;
621
+    flex-shrink: 0;
622
+}
623
+
624
+.activeStatusClass {
625
+    background-color: #2563EB;
626
+    color: #fff;
627
+
628
+}
629
+
630
+::v-deep .u-tabs__wrapper__nav__line {
631
+    top: 7px;
605
 }
632
 }
606
 </style>
633
 </style>