MrShi
2026-06-09 3f9032e92fdd383bfefc87a0bec9b242e1223851
app/pages/index/index.vue
@@ -341,13 +341,9 @@
         this.scrollHeight = Math.max(windowHeight - this.headerHeight, 0)
         if (this.userInfo.auditStatus === 99) return;
         this.acceptingStatus = this.userInfo.acceptingStatus || 0
         this.$u.api.centerInfo().then(res => {
            if (res.code === 200) {
               this.acceptingStatus = res.data.acceptingStatus
               if (res.data.acceptingStatus === 1) {
                  this.loadOrdersByTab(this.activeTab)
               }
            }
         this.init()
         uni.$on('locationPermissionGranted', () => {
            this.init()
         })
         uni.$on('jiedanSuccess', () => {
            this.loadOrdersByTab(this.activeTab)
@@ -398,6 +394,17 @@
      },
      methods: {
         init() {
            console.log('index-init')
            this.$u.api.centerInfo().then(res => {
               if (res.code === 200) {
                  this.acceptingStatus = res.data.acceptingStatus
                  if (res.data.acceptingStatus === 1) {
                     this.loadOrdersByTab(this.activeTab)
                  }
               }
            })
         },
         handleScrollToLower() {
            if (this.acceptingStatus === 0) return;
            this.hallPage++
@@ -506,12 +513,19 @@
            })
         },
         getActiveOrderCount() {
            checkLocationPermission().then((granted) => {
               if (granted) {
                  console.log('已有位置权限-订单数量')
            this.$u.api.activeOrderCount().then(res => {
               if (res.code === 200) {
                  this.activeOrderCount = res.data
               }
            }).catch((err) => {
               this.activeOrderCount = null
                  })
               } else {
                  console.log('还没有位置权限-订单数量')
               }
            })
         },
@@ -624,14 +638,17 @@
            if (this.userInfo.auditStatus === 99) return;
            if (this.acceptingStatus === 0) return;
            if (tab === 'hall') {
               console.log('抢单大厅')
               this.hallPage = 1
               this.hallHasMore = true
               this.orderList = []
               this.getHallOrders()
            } else if (tab === 'pickup') {
               console.log('待取货')
               this.pickupOrderList = []
               this.getPickupOrders()
            } else if (tab === 'delivering') {
               console.log('配送中')
               this.deliveringOrderList = []
               this.getDeliveringOrders()
            }
@@ -672,7 +689,6 @@
                     }
                  }
                  
                  console.log('接单大厅:', { distance, gradeId, sortType })
                  this.$u.api.grabOrderHall({
                     capacity: this.hallPageSize,
                     page: this.hallPage,
@@ -682,7 +698,6 @@
                        sortType: sortType
                     }
                  }).then(res => {
                     console.log('接单大厅', res)
                     this.hallLoading = false
                     if (res.code === 200) {
                        const list = res.data.records || []
@@ -701,6 +716,10 @@
         getPickupOrders() {
            if (this.acceptingStatus === 0) return;
            if (this.pickupLoading) return
            checkLocationPermission().then((granted) => {
               if (granted) {
                  console.log('已有位置权限')
            this.pickupLoading = true
            this.$u.api.activeOrders({ status: 3 }).then(res => {
               console.log('待取货:', res)
@@ -711,11 +730,19 @@
            }).catch((err) => {
               this.pickupLoading = false
            })
               } else {
                  console.log('还没有位置权限')
               }
            })
         },
         getDeliveringOrders() {
            if (this.acceptingStatus === 0) return;
            if (this.deliveringLoading) return
            checkLocationPermission().then((granted) => {
               if (granted) {
                  console.log('已有位置权限')
            this.deliveringLoading = true
            this.$u.api.activeOrders({ status: 4 }).then(res => {
               console.log('配送中:', res)
@@ -726,6 +753,10 @@
            }).catch((err) => {
               this.deliveringLoading = false
            })
               } else {
                  console.log('还没有位置权限')
               }
            })
         },
         openStatusPicker() {