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