MrShi
2026-05-08 8a899e63502939dbf034b90ba46741e0faa9023c
app/pages/order-detail/order-detail.vue
@@ -306,6 +306,7 @@
            locationTimer: null,
            distance: 0,
            duration: 0,
            isWithinOperationRadius: true,
            statusTextMap: {
               2: '待接单',
               3: '待取货',
@@ -450,18 +451,52 @@
         this.topFixedHeight = uni.upx2px(500 + 92)
         if (this.orderId) {
            this.getOrderDetail()
            this.initOperationRadius()
         }
      },
      onUnload() {
         if (this.locationTimer) {
            clearInterval(this.locationTimer)
            this.locationTimer = null
         }
      },
      methods: {
         handleBack() {
            uni.navigateBack({ delta: 1 });
         },
         initOperationRadius() {
            uni.getLocation({
               type: 'gcj02',
               success: (res) => {
                  this.$u.api.checkDriverOperationRadius({
                     lat: res.latitude,
                     lng: res.longitude,
                     orderId: this.orderId
                  }).then(res => {
                     if (res.code === 200) {
                        this.isWithinOperationRadius = res.data
                        if (!this.isWithinOperationRadius) {
                           uni.showToast({
                              title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                              icon: 'none'
                           })
                        }
                     }
                  })
               },
               fail: () => {
                  this.isWithinOperationRadius = false
                  uni.showToast({
                     title: '您当前位置权限没有开启,请先开启后再来操作',
                     icon: 'none'
                  })
               }
            })
         },
         getOrderDetail() {
            this.$u.api.orderDetail({ orderId: this.orderId }).then(res => {
               if (res.code === 200) {
@@ -599,6 +634,13 @@
            }
            if (action === 'pickup' || action === 'deliver') {
               if (!this.isWithinOperationRadius) {
                  uni.showToast({
                     title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                     icon: 'none'
                  })
                  return
               }
               this.uploadedPhotos = []
               this.photoRemark = ''
               this.photoPopupMode = action