Commit d2e4268a authored by Facius's avatar Facius
parents e034aa50 e7d05f74
......@@ -116,14 +116,14 @@ export default {
* vehicle:车辆照
**/
other_photos: {
"driver_license": {
"url": "",
driver_license: {
url: "",
},
"driving_license": {
"url": "",
driving_license: {
url: "",
},
"vehicle":{
"url": "",
vehicle: {
url: "",
},
},
id_card_back_check: false,
......@@ -134,7 +134,8 @@ export default {
electrician_certificate: [],
driver_license: [],
driving_license: [],
vehicle: [],
vehicle_front: [],
vehicle_side: [],
},
formShowList: [{
filedName: "id_card_front",
......@@ -171,7 +172,7 @@ export default {
placeholderImages: [qn_base_url + 'jiashi.png', qn_base_url + 'jiashi.png']
},
{
filedName: "vehicle",
filedName: "vehicle_front",
label: "车辆照",
maxImgs: 1,
tips: "上传车辆照片",
......@@ -259,8 +260,8 @@ export default {
self.uploadType = item.filedName || ''
// 默认上传证件类型图片
let attr = {category: self.categories[1]}
switch (index) {
case 0:
switch (item.filedName) {
case 'id_card_front':
// 身份证
// 上传图片
// 成功之后更新 fileInfo、 item里的imgs
......@@ -273,6 +274,26 @@ export default {
self.uploadType = "id_card_back"
}
break;
case 'driver_license':
// 驾驶证/行驶证
if(key == 0) {
// 驾驶证照片
self.uploadType = "driver_license"
} else {
// 行驶证照片
self.uploadType = "driving_license"
}
break;
case 'vehicle_front':
// 车辆照
if(key == 0) {
// 车辆正面照片
self.uploadType = "vehicle_front"
} else {
// 车辆侧面照片
self.uploadType = "vehicle_side"
}
break;
default:
//其他
// 上传图片
......@@ -295,15 +316,23 @@ export default {
if (uploadImgs && uploadImgs.length < 1) {
return
}
if (uploadType === 'driver_license' || uploadType === 'driving_license' || uploadType === 'vehicle') {
const otherImgs = this.imgObj[uploadType]
let photoType = uploadType;
if(uploadType === 'vehicle_front' || uploadType === 'vehicle_side') {
photoType = 'vehicle'
}
if (photoType === 'driver_license' || photoType === 'driving_license' || photoType === 'vehicle') {
let otherImgs = this.imgObj[uploadType]
if (photoType === 'vehicle') {
otherImgs = this.imgObj['vehicle_front'].concat(this.imgObj['vehicle_side'])
}
let imgs = []
otherImgs.map(item => {
const img = item.key || item.src || ''
imgs.push(img)
})
this.fileInfo[uploadType] = imgs.join(',')
this.fileInfo['other_photos'][photoType]['url'] = imgs.join(',')
return
}
this.fileInfo[uploadType] = uploadImgs[0].key || uploadImgs[0].src || ''
......@@ -368,6 +397,9 @@ export default {
const fileInfo = this.fileInfo;
let checkFunc = function(item) {
if(item.filedName === 'id_card') {
const value = fileInfo['id_card_front'];
}
const value = fileInfo[item.filedName];
const tips = "请上传您的" + item.label;
if (!value) {
......@@ -412,7 +444,9 @@ export default {
if (!this.checkFileInfo()) {
return;
}
const fileInfo = this.fileInfo;
let fileInfo = this.fileInfo;
debugger
fileInfo.other_photos = JSON.stringify(fileInfo.other_photos)
let submitInfoData = {
...fileInfo,
recommender: getApp().globalData.settleRecommend
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment