MrShi
2026-05-20 b806c4ad52a661a1e5f0695650ec1a7e42f01633
app/pages/order-detail/order-detail.vue
@@ -119,7 +119,7 @@
                     <image class="order-detail-page__qrcode-image" :src="'https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=' + orderDetail.driverVerifyCode" mode="aspectFit"></image>
                  </view>
                  <text class="order-detail-page__qrcode-value">{{ orderDetail.driverVerifyCode }}</text>
                  <text class="order-detail-page__qrcode-label">取货码</text>
                  <text class="order-detail-page__qrcode-label">{{ orderDetail.status === 3 ? '取货码' : '存件码' }}</text>
               </view>
            </view>
@@ -451,7 +451,6 @@
         this.topFixedHeight = uni.upx2px(500 + 92)
         if (this.orderId) {
            this.getOrderDetail()
            this.initOperationRadius()
         }
      },
@@ -466,34 +465,45 @@
         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'
                           })
            console.log('initOperationRadius')
            return new Promise((resolve) => {
               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
                           console.log(res.data)
                           if (!this.isWithinOperationRadius) {
                              uni.showToast({
                                 title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                                 icon: 'none'
                              })
                              resolve(false)
                           } else {
                              resolve(true)
                           }
                        } else {
                           resolve(false)
                        }
                     }
                  })
               },
               fail: () => {
                  this.isWithinOperationRadius = false
                  uni.showToast({
                     title: '您当前位置权限没有开启,请先开启后再来操作',
                     icon: 'none'
                  })
               }
                     }).catch(() => {
                        resolve(false)
                     })
                  },
                  fail: () => {
                     this.isWithinOperationRadius = false
                     uni.showToast({
                        title: '您当前位置权限没有开启,请先开启后再来操作',
                        icon: 'none'
                     })
                     resolve(false)
                  }
               })
            })
         },
@@ -634,17 +644,14 @@
            }
            if (action === 'pickup' || action === 'deliver') {
               if (!this.isWithinOperationRadius) {
                  uni.showToast({
                     title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                     icon: 'none'
                  })
                  return
               }
               this.uploadedPhotos = []
               this.photoRemark = ''
               this.photoPopupMode = action
               this.showPhotoPopup = true
               this.initOperationRadius().then((isValid) => {
                  console.log(isValid)
                  if (!isValid) return
                  this.uploadedPhotos = []
                  this.photoRemark = ''
                  this.photoPopupMode = action
                  this.showPhotoPopup = true
               })
               return
            }
@@ -682,6 +689,7 @@
               if (res.code === 200) {
                  uni.showToast({ title: '接单成功', icon: 'success' })
                  this.getOrderDetail()
                  uni.$emit('jiedanSuccess')
                  setTimeout(() => {
                     uni.navigateBack()
                  }, 1500)