| | |
| | | locationTimer: null, |
| | | distance: 0, |
| | | duration: 0, |
| | | isWithinOperationRadius: true, |
| | | statusTextMap: { |
| | | 2: '待接单', |
| | | 3: '待取货', |
| | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | if (action === 'pickup' || action === 'deliver') { |
| | | if (!this.isWithinOperationRadius) { |
| | | uni.showToast({ |
| | | title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照', |
| | | icon: 'none' |
| | | }) |
| | | return |
| | | } |
| | | this.uploadedPhotos = [] |
| | | this.photoRemark = '' |
| | | this.photoPopupMode = action |