| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { chooseImageWithNotice, getLocationWithNotice } from '@/utils/utils' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | this.checkOperationRadius(item.id, 'deliver') |
| | | }, |
| | | checkOperationRadius(orderId, mode) { |
| | | uni.getLocation({ |
| | | getLocationWithNotice({ |
| | | type: 'gcj02', |
| | | success: (res) => { |
| | | this.$u.api.checkDriverOperationRadius({ |
| | |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | closePhotoPopup() { |
| | | this.showPhotoPopup = false |
| | |
| | | uni.showToast({ title: '最多上传3张照片', icon: 'none' }) |
| | | return |
| | | } |
| | | uni.chooseImage({ |
| | | chooseImageWithNotice({ |
| | | count: 3 - this.uploadedPhotos.length, |
| | | sourceType: ['camera', 'album'], |
| | | success: (res) => { |
| | | this.uploadedPhotos = [...this.uploadedPhotos, ...res.tempFilePaths] |
| | | } |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | deletePhoto(index) { |
| | | this.uploadedPhotos.splice(index, 1) |
| | | }, |
| | | submitPhotoPopup() { |
| | | submitPhotoPopup() { |
| | | if (this.uploadedPhotos.length === 0) { |
| | | uni.showToast({ title: '请上传照片', icon: 'none' }) |
| | | return |
| | | } |
| | | uni.showLoading({ title: '上传中...' }) |
| | | uni.getLocation({ |
| | | getLocationWithNotice({ |
| | | type: 'gcj02', |
| | | success: (locationRes) => { |
| | | this.doUploadPhotos(locationRes.latitude, locationRes.longitude) |
| | |
| | | fail: () => { |
| | | this.doUploadPhotos(null, null) |
| | | } |
| | | }).catch(() => { |
| | | this.doUploadPhotos(null, null) |
| | | }) |
| | | }, |
| | | |