From 609b98f8f5d1925f40a9c69f13300f1941f4f5df Mon Sep 17 00:00:00 2001 From: 396316021 <396316021@qq.com> Date: Tue, 5 Dec 2023 14:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=B2=A1=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/toExamine/pages/first/first.js | 136 +++++++++++++++------------ 1 file changed, 74 insertions(+), 62 deletions(-) diff --git a/pages/toExamine/pages/first/first.js b/pages/toExamine/pages/first/first.js index 4f5b40b..f06b5f4 100644 --- a/pages/toExamine/pages/first/first.js +++ b/pages/toExamine/pages/first/first.js @@ -249,6 +249,7 @@ Page({ order_id: res.data.basics.id }) let obj = Object.assign(res.data.basics, res.data.car_assessment); + that.assignment(obj) } @@ -870,9 +871,8 @@ Page({ assignment(data) { let obj = this.data.obj; let vehicle = this.data.vehicle; - console.log(data) - if (data.id_card_photo.split(",").length > 0) { - data.id_card_photo.split(",").forEach((liem, index) => { + if (data?.id_card_photo?.split(",").length > 0) { + data?.id_card_photo?.split(",").forEach((liem, index) => { console.log(liem) if (liem) { obj.id_card_photo.img_arr.push(wx.getStorageSync("serverurl") + liem) @@ -883,8 +883,8 @@ Page({ } }) } - if (data.drive_license.split(",").length > 0) { - data.drive_license.split(",").forEach((liem, index) => { + if (data?.drive_license?.split(",").length > 0) { + data?.drive_license?.split(",").forEach((liem, index) => { if (liem) { obj.drive_license.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.drive_license.up_img_arr.push(liem) @@ -894,8 +894,8 @@ Page({ } }) } - if (data.bank_card.split(",").length > 0) { - data.bank_card.split(",").forEach((liem, index) => { + if (data?.bank_card?.split(",").length > 0) { + data?.bank_card?.split(",").forEach((liem, index) => { if (liem) { obj.bank_card.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.bank_card.up_img_arr.push(liem) @@ -905,8 +905,8 @@ Page({ } }) } - if (data.credit_reporting.split(",").length > 0) { - data.credit_reporting.split(",").forEach((liem, index) => { + if (data?.credit_reporting?.split(",").length > 0) { + data?.credit_reporting?.split(",").forEach((liem, index) => { if (liem) { obj.credit_reporting.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.credit_reporting.up_img_arr.push(liem) @@ -916,25 +916,28 @@ Page({ } }) } - this.data.arr.map((item, index) => { - if (item.name == data.marriage) { + this.data?.arr?.map((item, index) => { + if (item.name == data?.marriage) { this.data.obj.marriage.option = index } }) - this.data.list.map((item, index) => { - if (item.name == data.relation) { + this.data?.list?.map((item, index) => { + if (item.name == data?.relation) { this.data.obj.relation.option = index } }) - obj.lessee_name.text_center = data.lessee_name ? data.lessee_name : ''; - obj.marriage.option = data.marriage ? this.data.obj.marriage.option : ''; - obj.age.text_center = data.age ? data.age : ''; - obj.id_card.text_center = data.id_card ? data.id_card : ''; - obj.id_card_address.text_center = data.id_card_address ? data.id_card_address : '', - obj.phone.text_center = data.phone ? data.phone : ''; - obj.email.text_center = data.email ? data.email : ''; - if (data.b_id_card_photo.split(",").length > 0) { - data.b_id_card_photo.split(",").forEach((liem, index) => { + + obj.lessee_name.text_center = data?.lessee_name ? data?.lessee_name : ''; + obj.marriage.option = data?.marriage ? this.data?.obj.marriage.option : ''; + obj.age.text_center = data?.age ? data?.age : ''; + obj.id_card.text_center = data?.id_card ? data?.id_card : ''; + obj.id_card_address.text_center = data?.id_card_address ? data?.id_card_address : '', + obj.phone.text_center = data?.phone ? data?.phone : ''; + // obj.email.text_center = data?.email ? data?.email : ''; + console.log(123123) + if (data?.b_id_card_photo?.split(",").length > 0) { + data?.b_id_card_photo?.split(",").forEach((liem, index) => { + if (liem) { obj.b_id_card_photo.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.b_id_card_photo.up_img_arr.push(liem) @@ -944,8 +947,9 @@ Page({ } }) } - if (data.b_credit_reporting.split(",").length > 0) { - data.b_credit_reporting.split(",").forEach((liem, index) => { + + if (data?.b_credit_reporting?.split(",").length > 0) { + data?.b_credit_reporting?.split(",").forEach((liem, index) => { if (liem) { obj.b_credit_reporting.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.b_credit_reporting.up_img_arr.push(liem) @@ -955,19 +959,26 @@ Page({ } }) } - obj.guarantee_name.text_center = data.guarantee_name ? data.guarantee_name : ''; - obj.relation.option = data.relation ? this.data.obj.relation.option : ''; - obj.b_id_card.text_center = data.b_id_card ? data.b_id_card : ''; - obj.b_phone.text_center = data.b_phone ? data.b_phone : ''; - obj.address.option = data.address ? data.address.split(",") : ''; - obj.address_detail.text_center = data.address_detail ? data.address_detail : ''; - obj.b_word_address.text_center = data.b_word_address ? data.b_word_address : ''; - obj.b_work_year.text_center = data.b_work_year ? data.b_work_year : ''; - obj.b_word.text_center = data.b_word ? data.b_word : ''; - obj.b_month_money.text_center = data.b_month_money ? data.b_month_money : ''; - obj.remark.text_center = data.remark ? data.remark : ''; - if (data.other.split(",").length > 0) { - data.other.split(",").forEach((liem, index) => { + + obj.guarantee_name.text_center = data?.guarantee_name ? data?.guarantee_name : ''; + obj.relation.option = data?.relation ? this.data?.obj.relation.option : ''; + + obj.b_id_card.text_center = data?.b_id_card ? data?.b_id_card : ''; + + obj.b_phone.text_center = data?.b_phone ? data?.b_phone : ''; + + obj.address.option = data?.address ? data?.address?.split(",") : ''; + + obj.address_detail.text_center = data?.address_detail ? data?.address_detail : ''; + + // obj.b_word_address.text_center = data?.b_word_address ? data?.b_word_address : ''; + + // obj.b_work_year.text_center = data?.b_work_year ? data?.b_work_year : ''; + // obj.b_word.text_center = data?.b_word ? data?.b_word : ''; + // obj.b_month_money.text_center = data?.b_month_money ? data?.b_month_money : ''; + obj.remark.text_center = data?.remark ? data?.remark : ''; + if (data?.other?.split(",").length > 0) { + data?.other?.split(",").forEach((liem, index) => { if (liem) { obj.other.img_arr.push(wx.getStorageSync("serverurl") + liem) obj.other.up_img_arr.push(liem) @@ -976,8 +987,8 @@ Page({ } // 车辆评估 - if (data.repair.split(",").length > 0) { - data.repair.split(",").forEach((liem, index) => { + if (data?.repair?.split(",").length > 0) { + data?.repair?.split(",").forEach((liem, index) => { if (liem) { vehicle.repair.img_arr.push(wx.getStorageSync("serverurl") + liem) vehicle.repair.up_img_arr.push(liem) @@ -987,9 +998,9 @@ Page({ } }) } - console.log(this.data.obj) - if (data.car_three.split(",").length > 0) { - data.car_three.split(",").forEach((liem, index) => { + console.log(this.data?.obj) + if (data?.car_three?.split(",").length > 0) { + data?.car_three?.split(",").forEach((liem, index) => { if (liem) { vehicle.car_three.img_arr.push(wx.getStorageSync("serverurl") + liem) vehicle.car_three.up_img_arr.push(liem) @@ -1000,8 +1011,8 @@ Page({ }) } - if (data.travel.split(",").length > 0) { - data.travel.split(",").forEach((liem, index) => { + if (data?.travel?.split(",").length > 0) { + data?.travel?.split(",").forEach((liem, index) => { if (liem) { vehicle.travel.img_arr.push(wx.getStorageSync("serverurl") + liem) vehicle.travel.up_img_arr.push(liem) @@ -1011,38 +1022,39 @@ Page({ } }) } - this.data.rate.map((item, index) => { - if (item.name == data.apply_rate) { + this.data?.rate?.map((item, index) => { + if (item.name == data?.apply_rate) { this.data.vehicle.apply_rate.option = index } }) - this.data.num.map((item, index) => { - if (item.name == data.apply_number) { + this.data?.num?.map((item, index) => { + if (item.name == data?.apply_number) { this.data.vehicle.apply_number.option = index } }) - vehicle.car_license.text_center = data.car_license ? data.car_license : ''; - vehicle.vin.text_center = data.vin ? data.vin : ''; - vehicle.car_model.text_center = data.car_model ? data.car_model.split(',') : ''; - vehicle.up_plate_date.option = data.up_plate_date ? data.up_plate_date : ''; - vehicle.engine_number.text_center = data.engine_number ? data.engine_number : ''; - vehicle.mileage.text_center = data.mileage ? data.mileage : ''; - vehicle.color.text_center = data.color ? data.color : ''; - vehicle.assessment_price.text_center = data.assessment_price ? data.assessment_price : ''; - vehicle.apply.text_center = data.apply ? data.apply : ''; - vehicle.apply_rate.option = data.apply_rate ? this.data.vehicle.apply_rate.option : ''; - vehicle.apply_number.option = data.apply_number ? this.data.vehicle.apply_number.option : ''; - vehicle.remark.text_center = data.r_remark ? data.r_remark : ''; + vehicle.car_license.text_center = data?.car_license ? data?.car_license : ''; + vehicle.vin.text_center = data?.vin ? data?.vin : ''; + vehicle.car_model.text_center = data?.car_model ? data?.car_model?.split(',') : ''; + vehicle.up_plate_date.option = data?.up_plate_date ? data?.up_plate_date : ''; + vehicle.engine_number.text_center = data?.engine_number ? data?.engine_number : ''; + vehicle.mileage.text_center = data?.mileage ? data?.mileage : ''; + vehicle.color.text_center = data?.color ? data?.color : ''; + vehicle.assessment_price.text_center = data?.assessment_price ? data?.assessment_price : ''; + vehicle.apply.text_center = data?.apply ? data?.apply : ''; + vehicle.apply_rate.option = data?.apply_rate ? this.data?.vehicle.apply_rate.option : ''; + vehicle.apply_number.option = data?.apply_number ? this.data?.vehicle.apply_number.option : ''; + vehicle.remark.text_center = data?.r_remark ? data?.r_remark : ''; - if (data.r_other.split(",").length > 0) { - data.r_other.split(",").forEach((liem, index) => { + if (data?.r_other?.split(",").length > 0) { + data?.r_other?.split(",").forEach((liem, index) => { if (liem) { vehicle.other.img_arr.push(wx.getStorageSync("serverurl") + liem) vehicle.other.up_img_arr.push(liem) } }) } + this.setData({ obj: obj, vehicle: vehicle,