Commit 496b80f0 by cen

fix: 在车架号也识别返回车型

1 parent 372e5c40
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1
const index = 2
/**
*
0本地
......
......@@ -1328,29 +1328,32 @@ export default {
if (res.data.code == 0) {
if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.vin = res.data.data.vin
validateVin(this.formData.carBaseReqDTO.vin)
.then(result => {
console.log('validateVin', result)
let { valid } = result.data
this.validateState = valid
// 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result)
})
.catch(err => {
console.log('validateVinErr', result)
})
uni.$api.evaluationApi
.queryByVin({
vin: this.formData.carBaseReqDTO.vin
})
.then(res => {
console.log('res:', res)
if (res.data.code == 0) {
this.carTips = res.data.data.base.commonName || ''
} else {
this.carTips = ''
}
})
// 只有有 VIN 时才做后续校验和 queryByVin
if (this.formData.carBaseReqDTO.vin) {
validateVin(this.formData.carBaseReqDTO.vin)
.then(result => {
console.log('validateVin', result)
let { valid } = result.data
this.validateState = valid
// 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result)
})
.catch(err => {
console.log('validateVinErr', err)
})
uni.$api.evaluationApi
.queryByVin({
vin: this.formData.carBaseReqDTO.vin
})
.then(res => {
console.log('res:queryByVin', res)
if (res.data.code == 0) {
this.carTips = res.data.data.base.commonName || ''
} else {
this.carTips = ''
}
})
}
uni.showToast({ title: '车架号识别完成并已自动填写到表单中', icon: 'none' })
uni.hideLoading()
} else {
......@@ -1486,6 +1489,21 @@ export default {
this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName
this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName
this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName
// 行驶证识别到 VIN 后,再调用 queryByVin
if (this.formData.carBaseReqDTO.vin) {
uni.$api.evaluationApi
.queryByVin({
vin: this.formData.carBaseReqDTO.vin
})
.then(res => {
console.log('res:', res)
if (res.data.code == 0) {
this.carTips = res.data.data.base.commonName || ''
} else {
this.carTips = ''
}
})
}
} else {
uni.hideLoading()
uni.showToast({ title: res.data.data.errorMessage, icon: 'none' })
......
......@@ -4,7 +4,7 @@
<view class="search-box flex">
<view :class="['form-item form-item-input', { active: focusIndex == 0 }]">
<view class="form-item-box flex">
<input :maxlength="50" v-model="searchText" class="input" placeholder="请输入车架号" @focus="focusIndex = 0" @blur="resetFocusIndex" placeholder-class="placeholder" />
<input :maxlength="20" v-model="searchText" class="input" placeholder="请输入车架号" @focus="focusIndex = 0" @blur="resetFocusIndex" placeholder-class="placeholder" />
<view class="sprite-icon icon-vinScan" @click.stop="scan('vinOcr')"></view>
</view>
</view>
......@@ -363,6 +363,12 @@ export default {
sizeType: ['original'],
sourceType: ['camera'],
success: async res => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!