| | |
| | | <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> |
| | | |
| | |
| | | this.topFixedHeight = uni.upx2px(500 + 92) |
| | | if (this.orderId) { |
| | | this.getOrderDetail() |
| | | this.initOperationRadius() |
| | | } |
| | | }, |
| | | |
| | |
| | | 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) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | |
| | | if (res.code === 200) { |
| | | uni.showToast({ title: '接单成功', icon: 'success' }) |
| | | this.getOrderDetail() |
| | | uni.$emit('jiedanSuccess') |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1500) |