|
|
@@ -120,7 +120,7 @@ |
|
|
|
<!-- 上传照片 --> |
|
|
|
<view class="upload-section" v-if="formData.activeType == '2'"> |
|
|
|
<view class="section-title">上传照片</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('3')"> |
|
|
|
<view class="picture-wrapper" @click="cardFileImageUpdate(100)"> |
|
|
|
<view class="bg"> |
|
|
|
<view class=""> |
|
|
|
<view class="name"> 行驶证主页 </view> |
|
|
@@ -129,14 +129,14 @@ |
|
|
|
<view class="tip-value"> 拍摄规范 </view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<image v-if="!vehicleFrontData.imageName" class="icon" :src="`${$imgUrl}issuance/xz.png`" |
|
|
|
<image v-if="!formData.vehPosImgUrlName" class="icon" :src="`${$imgUrl}issuance/xz.png`" |
|
|
|
:style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="vehicleFrontData.imageName" |
|
|
|
<image v-else class="icon" :src="formData.vehPosImgUrlName" |
|
|
|
:style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('4')"> |
|
|
|
<view class="picture-wrapper" @click="cardFileImageUpdate(101)"> |
|
|
|
<view class="bg"> |
|
|
|
<view class=""> |
|
|
|
<view class="name"> 行驶证副页 </view> |
|
|
@@ -145,10 +145,10 @@ |
|
|
|
<view class="tip-value"> 拍摄规范 </view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<image v-if="!vehicleBackData.imageName" class="icon" :src="`${$imgUrl}issuance/xf.png`" |
|
|
|
<image v-if="!formData.vehNegImgUrlName" class="icon" :src="`${$imgUrl}issuance/xf.png`" |
|
|
|
:style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="imgPathMontage(vehicleBackData.imageName)" |
|
|
|
<image v-else class="icon" :src="imgPathMontage(formData.vehNegImgUrlName)" |
|
|
|
:style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@@ -191,9 +191,6 @@ |
|
|
|
<view class="bottom-button" @click="nextStep"> |
|
|
|
下一步 |
|
|
|
</view> |
|
|
|
<uploadImg :isTakePhotoModeShow="isTakePhotoModeShow" :phoneType="choiceIndex" @close="close" |
|
|
|
@ocrResult="ocrResult"> |
|
|
|
</uploadImg> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
@@ -309,20 +306,6 @@ const close = (e) => { |
|
|
|
isTakePhotoModeShow.value = e |
|
|
|
} |
|
|
|
|
|
|
|
const vehicleFrontData = reactive({}); |
|
|
|
const vehicleBackData = reactive({}) |
|
|
|
const ocrResult = (data) => { |
|
|
|
console.log('输出内容=====================', choiceIndex.value); |
|
|
|
console.log("上传数据:", data) |
|
|
|
|
|
|
|
console.log("上传数据:", data) |
|
|
|
if (choiceIndex.value == "3") { |
|
|
|
Object.assign(vehicleFrontData, data); |
|
|
|
} else if (choiceIndex.value === "4") { |
|
|
|
Object.assign(vehicleBackData, data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isTakePhotoModeShow = ref(false); |
|
|
|
const choiceIndex = ref(''); |
|
|
|
const takePhotoMode = (index) => { |
|
|
@@ -443,24 +426,6 @@ const selectCarNumber = () => { |
|
|
|
vehiclesShow.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
// 上传图片 |
|
|
|
const uploadImage = (type: 'vehicle' | 'device') => { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 1, //只能选取一张照片 |
|
|
|
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
|
|
|
sourceType: ["camera", "album"], //从相册选择 |
|
|
|
success: function (res) { |
|
|
|
// 这里可以添加文件上传逻辑 |
|
|
|
const tempFilePath = res.tempFilePaths[0] |
|
|
|
if (type === 'vehicle') { |
|
|
|
formData.vehicleImage = tempFilePath |
|
|
|
} else { |
|
|
|
formData.deviceImage = tempFilePath |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 显示拍摄规范 |
|
|
|
const showSpec = (type: 'vehicle' | 'device') => { |
|
|
|
const title = type === 'vehicle' ? '车辆45度照拍摄规范' : 'ETC设备安装照拍摄规范' |
|
|
@@ -565,7 +530,7 @@ const nextStep = () => { |
|
|
|
} |
|
|
|
|
|
|
|
if(formData.activeType == '2') { |
|
|
|
if (!vehicleFrontData.imageName) { |
|
|
|
if (!formData.vehPosImgUrlName) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请上传行驶证正面照', |
|
|
|
icon: 'none' |
|
|
@@ -573,7 +538,7 @@ const nextStep = () => { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!vehicleBackData.imageName) { |
|
|
|
if (!formData.vehNegImgUrlName) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请上传行驶证反面照', |
|
|
|
icon: 'none' |
|
|
@@ -627,38 +592,6 @@ const nextStep = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 获取车辆使用性质 |
|
|
|
const getCharacter = () => { |
|
|
|
let approvedCount; |
|
|
|
if (vehicleBackData.apc.indexOf('人') > 0) { |
|
|
|
approvedCount = vehicleBackData.apc.replace("人", ""); |
|
|
|
} else { |
|
|
|
approvedCount = vehicleBackData.apc; |
|
|
|
} |
|
|
|
let totalMass; |
|
|
|
if (vehicleBackData.gross.toString().indexOf('kg') > 0) { |
|
|
|
totalMass = vehicleBackData.gross.replace("kg", ""); |
|
|
|
} else { |
|
|
|
totalMass = vehicleBackData.gross; |
|
|
|
} |
|
|
|
let data = { |
|
|
|
"approvedCount": approvedCount, |
|
|
|
// "axleCount": state.form.axleCount, |
|
|
|
"totalMass": totalMass, |
|
|
|
// "vanType": state.form.vanType, |
|
|
|
"vehicleDimensions": vehicleBackData.overall.replaceAll("x", "X"), |
|
|
|
"plateNum": activationType.value === 'other' ? formData.carNumber : formData.vehiclePlate, |
|
|
|
"vehicleTypeName": vehicleFrontData.vehicle, |
|
|
|
"vehicleUsePropertName": vehicleFrontData.character |
|
|
|
} |
|
|
|
let params = { |
|
|
|
type: 2, |
|
|
|
data: data, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
return requestNew(vehicCharge, params) |
|
|
|
} |
|
|
|
|
|
|
|
const next = () => { |
|
|
|
|
|
|
@@ -667,8 +600,10 @@ const next = () => { |
|
|
|
// setItem('vehicleId', ) |
|
|
|
// if(formData.activeType == '1') { |
|
|
|
setItem('currentActivateData', { |
|
|
|
vehicleFrontImgUrl: vehicleFrontData.imageName, |
|
|
|
vehicleBackImgUrl: vehicleBackData.imageName, |
|
|
|
vehPosImgUrl: formData.vehPosImgUrlName, |
|
|
|
vehNegImgUrl: formData.vehNegImgUrlName, |
|
|
|
vehBodyUrl: formData.vehBodyUrlName, |
|
|
|
deviceImageUrl: formData.deviceImageName, |
|
|
|
vehicleId: `${carNumber}_${formData.colorCode}`, |
|
|
|
vehiclePlate: activationType.value === 'other' ? formData.carNumber : formData.vehiclePlate, |
|
|
|
vehiclePlateColorStr: formData.colorName, |