| | |
| | | </view> |
| | | |
| | | <view class="order-detail-page__summary-right"> |
| | | <text class="order-detail-page__price">¥{{ orderDetail.platformRewardAmount ? (orderDetail.driverFee + orderDetail.platformRewardAmount) / 100 : (orderDetail.driverFee / 100).toFixed(2) }}</text> |
| | | <text class="order-detail-page__price">¥{{ orderDetail.platformRewardAmount ? ((orderDetail.driverFee + orderDetail.platformRewardAmount) / 100).toFixed(2) : (orderDetail.driverFee / 100).toFixed(2) }}</text> |
| | | <text v-if="orderDetail.platformRewardAmount" class="order-detail-page__extra">含加急¥{{ (orderDetail.platformRewardAmount / 100).toFixed(2) }}</text> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="order-detail-page__done-summary-right"> |
| | | <view class="order-detail-page__done-price-row"> |
| | | <text class="order-detail-page__price">¥{{ (orderDetail.driverFee / 100).toFixed(1) }}</text> |
| | | <text class="order-detail-page__price">¥{{ (orderDetail.driverFee / 100).toFixed(2) }}</text> |
| | | </view> |
| | | <text v-if="orderDetail.isUrgent === 1" class="order-detail-page__extra">含加急¥{{ orderDetail.urgentAmount / 100 }}</text> |
| | | <text v-if="orderDetail.isUrgent === 1" class="order-detail-page__extra">含加急¥{{ (orderDetail.urgentAmount / 100).toFixed(2) }}</text> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | <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> |
| | | |
| | |
| | | locationTimer: null, |
| | | distance: 0, |
| | | duration: 0, |
| | | isWithinOperationRadius: true, |
| | | statusTextMap: { |
| | | 2: '待接单', |
| | | 3: '待取货', |
| | |
| | | this.getOrderDetail() |
| | | } |
| | | }, |
| | | |
| | | onUnload() { |
| | | if (this.locationTimer) { |
| | | clearInterval(this.locationTimer) |
| | | this.locationTimer = null |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | handleBack() { |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, |
| | | initOperationRadius() { |
| | | 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) |
| | | } |
| | | }).catch(() => { |
| | | resolve(false) |
| | | }) |
| | | }, |
| | | fail: () => { |
| | | this.isWithinOperationRadius = false |
| | | uni.showToast({ |
| | | title: '您当前位置权限没有开启,请先开启后再来操作', |
| | | icon: 'none' |
| | | }) |
| | | resolve(false) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | getOrderDetail() { |
| | | this.$u.api.orderDetail({ orderId: this.orderId }).then(res => { |
| | | if (res.code === 200) { |
| | |
| | | } |
| | | const from = `${this.currentLocation.latitude},${this.currentLocation.longitude}` |
| | | const to = `${this.orderDetail.navigateLng},${this.orderDetail.navigateLat}` |
| | | console.log('driverType', this.userInfo.driverType) |
| | | this.$u.api.directionInfo({ |
| | | from, |
| | | to, |
| | |
| | | } |
| | | |
| | | if (action === 'pickup' || action === 'deliver') { |
| | | 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) |