| | |
| | | <view class="driver-cert-card__upload-list"> |
| | | <view class="driver-cert-card__upload-item" @click="handleUpload('idcardImg', 1)" style="height: 196rpx;"> |
| | | <template v-if="previewImages.idcardImg"> |
| | | <image class="driver-cert-card__upload-img" :src="previewImages.idcardImg" mode="widthFix"></image> |
| | | <view class="driver-cert-card__upload-img"> |
| | | <image style="height: 100%;" :src="previewImages.idcardImg" mode="heightFix"></image> |
| | | </view> |
| | | <view class="driver-cert-card__upload-remove" @click.stop="removeImage('idcardImg')">删除</view> |
| | | </template> |
| | | <template v-else> |
| | |
| | | </view> |
| | | <view class="driver-cert-card__upload-item" @click="handleUpload('idcardImgBack', 1)" style="height: 196rpx;"> |
| | | <template v-if="previewImages.idcardImgBack"> |
| | | <image class="driver-cert-card__upload-img" :src="previewImages.idcardImgBack" mode="widthFix"></image> |
| | | <view class="driver-cert-card__upload-img"> |
| | | <image style="height: 100%;" :src="previewImages.idcardImgBack" mode="heightFix"></image> |
| | | </view> |
| | | <view class="driver-cert-card__upload-remove" @click.stop="removeImage('idcardImgBack')">删除</view> |
| | | </template> |
| | | <template v-else> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="driver-cert-card__upload-block driver-cert-card__upload-block--stacked"> |
| | | <view v-if="needLicense" class="driver-cert-card__upload-block driver-cert-card__upload-block--stacked"> |
| | | <view class="driver-cert-card__upload-title-row"> |
| | | <text class="driver-cert-card__label">驾驶证照片</text> |
| | | <text class="driver-cert-card__required">*</text> |
| | |
| | | color: '', |
| | | carType: '' |
| | | }, |
| | | needLicense: false, |
| | | showCarTypePicker: false, |
| | | carTypeList: [], |
| | | carTypeColumns: [], |
| | |
| | | this.vehicleForm.plateNumber = res.data.carCode || '' |
| | | this.vehicleForm.carType = res.data.carType || '' |
| | | this.vehicleForm.color = res.data.carColor || '' |
| | | if (this.carTypeList.length > 0) { |
| | | const selectedCarType = this.carTypeList.find(item => item.id === res.data.carType) |
| | | this.needLicense = selectedCarType && selectedCarType.otherField === 1 |
| | | } |
| | | this.previewImages.idcardImg = res.data.idcardImg ? res.data.imgPrefix + res.data.idcardImg : '' |
| | | this.previewImages.idcardImgBack = res.data.idcardImgBack ? res.data.imgPrefix + res.data.idcardImgBack : '' |
| | | this.form.carImgUrls = (res.data.carImgList || []).map(item => item.fileurl) |
| | |
| | | text: item.name |
| | | } |
| | | })] |
| | | if (this.vehicleForm.carType) { |
| | | const selectedCarType = this.carTypeList.find(item => item.id === this.vehicleForm.carType) |
| | | this.needLicense = selectedCarType && selectedCarType.otherField === 1 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | confirmCarType(e) { |
| | | const { id, text } = e.value[0] |
| | | this.vehicleForm.carType = id |
| | | const selectedCarType = this.carTypeList.find(item => item.id === id) |
| | | this.needLicense = selectedCarType && selectedCarType.otherField === 1 |
| | | this.showCarTypePicker = false |
| | | }, |
| | | openDatePicker(mode) { |
| | |
| | | uni.showToast({ title: '请上传车辆照片', icon: 'none' }) |
| | | return false |
| | | } |
| | | if (this.form.licenseImgUrls.length === 0) { |
| | | if (this.needLicense && this.form.licenseImgUrls.length === 0) { |
| | | uni.showToast({ title: '请上传驾驶证照片', icon: 'none' }) |
| | | return false |
| | | } |
| | |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1500) |
| | | } else { |
| | | uni.showToast({ title: res.msg || '提交失败', icon: 'none' }) |
| | | } |
| | | }).catch(err => { |
| | | uni.hideLoading() |
| | | uni.showToast({ title: '提交失败', icon: 'none' }) |
| | | }) |
| | | }, |
| | | goPrevStep() { |
| | |
| | | |
| | | &__upload-img { |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 8rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | &__upload-remove { |