|
@@ -1,5 +1,4 @@
|
|
|
import WxValidate from '../../utils/WxValidate.js';
|
|
|
-// import { readSync } from 'fs';
|
|
|
const app = require('../../utils/util.js');
|
|
|
const request = require('../../utils/request.js');
|
|
|
const COS = require('../../utils/cos.js');
|
|
@@ -20,7 +19,7 @@ Page({
|
|
|
assetCar: '',
|
|
|
assetCarValue: '',
|
|
|
assetCarLoan: '',
|
|
|
- isCommen: '',
|
|
|
+ isCommon: '',
|
|
|
controlTime: '',
|
|
|
workStatus: '',
|
|
|
companyNature: '',
|
|
@@ -46,7 +45,7 @@ Page({
|
|
|
assetCarArr: [],
|
|
|
assetCarValueArr: [],
|
|
|
assetCarLoanArr: [],
|
|
|
- isCommenArr: ['没有', '一起'],
|
|
|
+ isCommonArr: ['没有', '一起'],
|
|
|
controlTimeArr: [],
|
|
|
workStatusArr: [],
|
|
|
companyNatureArr: [],
|
|
@@ -55,7 +54,7 @@ Page({
|
|
|
matherWorkArr: [],
|
|
|
parentAssetsArr: [],
|
|
|
compositionArr: [],
|
|
|
- figureArr: ['龟息养生从不运动', '三天打鱼偶尔运动', '动如脱兔成天运动']
|
|
|
+ motionStateArr: []
|
|
|
},
|
|
|
phoneChange(e) {
|
|
|
let phone = 'form.phone'
|
|
@@ -154,11 +153,11 @@ Page({
|
|
|
[assetCarLoan]: this.data.assetCarLoanArrValue[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
- isCommenChange(e) {
|
|
|
- let isCommen = 'form.isCommen'
|
|
|
+ isCommonChange(e) {
|
|
|
+ let isCommon = 'form.isCommon'
|
|
|
this.setData({
|
|
|
- [isCommen]: e.detail.value,
|
|
|
- isCommenLabel: this.data.isCommenArr[e.detail.value],
|
|
|
+ [isCommon]: e.detail.value,
|
|
|
+ isCommonLabel: this.data.isCommonArr[e.detail.value],
|
|
|
})
|
|
|
},
|
|
|
controlTimeChange(e) {
|
|
@@ -261,7 +260,8 @@ Page({
|
|
|
figurePicker(e) {
|
|
|
let motionState = 'form.motionState'
|
|
|
this.setData({
|
|
|
- [motionState]: this.data.figureArr[e.detail.value]
|
|
|
+ [motionState]: e.detail.value,
|
|
|
+ motionStateLabel: this.data.motionStateArr[e.detail.value],
|
|
|
})
|
|
|
},
|
|
|
hobbyChange(e) {
|
|
@@ -304,7 +304,7 @@ Page({
|
|
|
url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
|
|
|
method: "get",
|
|
|
success: (res) => {
|
|
|
- console.log(res.data.info, '我是获取的信息')
|
|
|
+ console.log(res, '我是获取的信息')
|
|
|
let phone = 'form.phone'
|
|
|
let height = 'form.height'
|
|
|
let weight = 'form.weight'
|
|
@@ -318,7 +318,7 @@ Page({
|
|
|
let assetCar = 'form.assetCar'
|
|
|
let assetCarValue = 'form.assetCarValue'
|
|
|
let assetCarLoan = 'form.assetCarLoan'
|
|
|
- let isCommen = 'form.isCommen'
|
|
|
+ let isCommon = 'form.isCommon'
|
|
|
let controlTime = 'form.controlTime'
|
|
|
let workStatus = 'form.workStatus'
|
|
|
let companyNature = 'form.companyNature'
|
|
@@ -331,146 +331,197 @@ Page({
|
|
|
let motionState = 'form.motionState'
|
|
|
let hobby = 'form.hobby'
|
|
|
tool.formDetails('he_body_height').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.height) {
|
|
|
- this.setData({
|
|
|
- heightLabel: result[0][i],
|
|
|
- [height]: result[1][i],
|
|
|
- heightArr: result[0],
|
|
|
- heightArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ heightArr: result[0],
|
|
|
+ heightArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.height) {
|
|
|
+ this.setData({
|
|
|
+ heightLabel: result[0][i],
|
|
|
+ [height]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_body_weight').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.weight) {
|
|
|
- this.setData({
|
|
|
- weightLabel: result[0][i],
|
|
|
- [weight]: result[1][i],
|
|
|
- weightArr: result[0],
|
|
|
- weightArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ weightArr: result[0],
|
|
|
+ weightArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.weight) {
|
|
|
+ this.setData({
|
|
|
+ weightLabel: result[0][i],
|
|
|
+ [weight]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_education').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.education) {
|
|
|
- this.setData({
|
|
|
- educationLabel: result[0][i],
|
|
|
- [education]: result[1][i],
|
|
|
- educationArr: result[0],
|
|
|
- educationArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ educationArr: result[0],
|
|
|
+ educationArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.education) {
|
|
|
+ this.setData({
|
|
|
+ educationLabel: result[0][i],
|
|
|
+ [education]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_income').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.income) {
|
|
|
- this.setData({
|
|
|
- incomeLabel: result[0][i],
|
|
|
- [income]: result[1][i],
|
|
|
- incomeArr: result[0],
|
|
|
- incomeArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ incomeArr: result[0],
|
|
|
+ incomeArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.income) {
|
|
|
+ this.setData({
|
|
|
+ incomeLabel: result[0][i],
|
|
|
+ [income]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_marriage').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.marriage) {
|
|
|
- this.setData({
|
|
|
- marriageLabel: result[0][i],
|
|
|
- [marriage]: result[1][i],
|
|
|
- marriageList: result[0],
|
|
|
- marriageListValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ marriageList: result[0],
|
|
|
+ marriageListValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.marriage) {
|
|
|
+ this.setData({
|
|
|
+ marriageLabel: result[0][i],
|
|
|
+ [marriage]: result[1][i]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_children').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.children) {
|
|
|
- this.setData({
|
|
|
- childrenLabel: result[0][i],
|
|
|
- [children]: result[1][i],
|
|
|
- childrenArr: result[0],
|
|
|
- childrenArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ childrenArr: result[0],
|
|
|
+ childrenArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.children) {
|
|
|
+ this.setData({
|
|
|
+ childrenLabel: result[0][i],
|
|
|
+ [children]: result[1][i]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_house').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetHouse) {
|
|
|
- this.setData({
|
|
|
- assetHouseLabel: result[0][i],
|
|
|
- [assetHouse]: result[1][i],
|
|
|
- assetHouseArr: result[0],
|
|
|
- assetHouseArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetHouseArr: result[0],
|
|
|
+ assetHouseArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetHouse) {
|
|
|
+ this.setData({
|
|
|
+ assetHouseLabel: result[0][i],
|
|
|
+ [assetHouse]: result[1][i],
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_house_area').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetHouseArea) {
|
|
|
- this.setData({
|
|
|
- assetAreaLabel: result[0][i],
|
|
|
- [assetHouseArea]: result[1][i],
|
|
|
- assetAreaArr: result[0],
|
|
|
- assetAreaArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetAreaArr: result[0],
|
|
|
+ assetAreaArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetHouseArea) {
|
|
|
+ this.setData({
|
|
|
+ assetAreaLabel: result[0][i],
|
|
|
+ [assetHouseArea]: result[1][i],
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_house_loan').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetHouseLoan) {
|
|
|
- this.setData({
|
|
|
- assetHouseLoanLabel: result[0][i],
|
|
|
- [assetHouseLoan]: result[1][i],
|
|
|
- assetHouseLoanArr: result[0],
|
|
|
- assetHouseLoanArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetHouseLoanArr: result[0],
|
|
|
+ assetHouseLoanArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetHouseLoan) {
|
|
|
+ this.setData({
|
|
|
+ assetHouseLoanLabel: result[0][i],
|
|
|
+ [assetHouseLoan]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_car').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetCar) {
|
|
|
- this.setData({
|
|
|
- assetCarLabel: result[0][i],
|
|
|
- [assetCar]: result[1][i],
|
|
|
- assetCarArr: result[0],
|
|
|
- assetCarArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetCarArr: result[0],
|
|
|
+ assetCarArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetCar) {
|
|
|
+ this.setData({
|
|
|
+ assetCarLabel: result[0][i],
|
|
|
+ [assetCar]: result[1][i],
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_car_value').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetCarValue) {
|
|
|
- this.setData({
|
|
|
- assetCarValueLabel: result[0][i],
|
|
|
- [assetCarValue]: result[1][i],
|
|
|
- assetCarValueArr: result[0],
|
|
|
- assetCarValueArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetCarValueArr: result[0],
|
|
|
+ assetCarValueArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetCarValue) {
|
|
|
+ this.setData({
|
|
|
+ assetCarValueLabel: result[0][i],
|
|
|
+ [assetCarValue]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_asset_car_loan').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.assetCarLoan) {
|
|
|
- this.setData({
|
|
|
- assetCarLoanLabel: result[0][i],
|
|
|
- [assetCarLoan]: result[1][i],
|
|
|
- assetCarLoanArr: result[0],
|
|
|
- assetCarLoanArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ assetCarLoanArr: result[0],
|
|
|
+ assetCarLoanArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.assetCarLoan) {
|
|
|
+ this.setData({
|
|
|
+ assetCarLoanLabel: result[0][i],
|
|
|
+ [assetCarLoan]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -482,29 +533,34 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- let resControlTime = res.data.info.controlTime.split(",");
|
|
|
- let resControlTimeIndexArr = [];
|
|
|
- for (let i = 0; i < resControlTime.length; i++) {
|
|
|
- for (let j = 0; j < result[1].length; j++) {
|
|
|
- if (resControlTime[i] == result[1][j]) {
|
|
|
- resControlTimeIndexArr.push(i)
|
|
|
+
|
|
|
+ if (res.data.info) {
|
|
|
+ let resControlTime = res.data.info.controlTime.split(",");
|
|
|
+ let resControlTimeIndexArr = [];
|
|
|
+ for (let i = 0; i < resControlTime.length; i++) {
|
|
|
+ for (let j = 0; j < result[1].length; j++) {
|
|
|
+ if (resControlTime[i] == result[1][j]) {
|
|
|
+ resControlTimeIndexArr.push(i)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- let resControlTimeLabel = [];
|
|
|
- for (let i = 0; i < resControlTimeIndexArr.length; i++) {
|
|
|
- resControlTimeLabel.push(result[0][resControlTimeIndexArr[i]])
|
|
|
- }
|
|
|
- for (let i = 0; i < resControlTimeLabel.length; i++) {
|
|
|
- if (resControlTimeLabel[i] == controlTimeArr[i].value) {
|
|
|
- controlTimeArr[i].checked = true;
|
|
|
+ let resControlTimeLabel = [];
|
|
|
+ for (let i = 0; i < resControlTimeIndexArr.length; i++) {
|
|
|
+ resControlTimeLabel.push(result[0][resControlTimeIndexArr[i]])
|
|
|
+ }
|
|
|
+ for (let i = 0; i < resControlTimeLabel.length; i++) {
|
|
|
+ if (resControlTimeLabel[i] == controlTimeArr[i].value) {
|
|
|
+ controlTimeArr[i].checked = true;
|
|
|
+ }
|
|
|
}
|
|
|
+ this.setData({
|
|
|
+ [controlTime]: resControlTimeLabel
|
|
|
+ })
|
|
|
}
|
|
|
this.setData({
|
|
|
controlTimeArr: controlTimeArr,
|
|
|
controlTimeArrLabel: result[0],
|
|
|
controlTimeArrValue: result[1],
|
|
|
- [controlTime]: resControlTimeLabel
|
|
|
})
|
|
|
})
|
|
|
tool.formDetails('he_work_status').then(result => {
|
|
@@ -515,54 +571,60 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- let resWorkStatus = res.data.info.workStatus.split(",");
|
|
|
- let resWorkStatusIndexArr = [];
|
|
|
- for (let i = 0; i < resWorkStatus.length; i++) {
|
|
|
- for (let j = 0; j < result[1].length; j++) {
|
|
|
- if (resWorkStatus[i] == result[1][j]) {
|
|
|
- resWorkStatusIndexArr.push(i)
|
|
|
+ if (res.data.info) {
|
|
|
+ let resWorkStatus = res.data.info.workStatus.split(",");
|
|
|
+ let resWorkStatusIndexArr = [];
|
|
|
+ for (let i = 0; i < resWorkStatus.length; i++) {
|
|
|
+ for (let j = 0; j < result[1].length; j++) {
|
|
|
+ if (resWorkStatus[i] == result[1][j]) {
|
|
|
+ resWorkStatusIndexArr.push(i)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- let resWorkStatusLabel = [];
|
|
|
- for (let i = 0; i < resWorkStatusIndexArr.length; i++) {
|
|
|
- resWorkStatusLabel.push(result[0][resWorkStatusIndexArr[i]])
|
|
|
- }
|
|
|
- for (let i = 0; i < resWorkStatusLabel.length; i++) {
|
|
|
- if (resWorkStatusLabel[i] == workStatusArr[i].value) {
|
|
|
- workStatusArr[i].checked = true;
|
|
|
+ let resWorkStatusLabel = [];
|
|
|
+ for (let i = 0; i < resWorkStatusIndexArr.length; i++) {
|
|
|
+ resWorkStatusLabel.push(result[0][resWorkStatusIndexArr[i]])
|
|
|
+ }
|
|
|
+ for (let i = 0; i < resWorkStatusLabel.length; i++) {
|
|
|
+ if (resWorkStatusLabel[i] == workStatusArr[i].value) {
|
|
|
+ workStatusArr[i].checked = true;
|
|
|
+ }
|
|
|
}
|
|
|
+ this.setData({
|
|
|
+ [workStatus]: resWorkStatusLabel
|
|
|
+ })
|
|
|
}
|
|
|
this.setData({
|
|
|
workStatusArr: workStatusArr,
|
|
|
workStatusArrLabel: result[0],
|
|
|
- workStatusArrValue: result[1],
|
|
|
- [workStatus]: resWorkStatusLabel
|
|
|
+ workStatusArrValue: result[1]
|
|
|
})
|
|
|
})
|
|
|
tool.formDetails('he_company_nature').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.companyNature) {
|
|
|
- this.setData({
|
|
|
- companyNatureLabel: result[0][i],
|
|
|
- [companyNature]: result[1][i]
|
|
|
- })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.companyNature) {
|
|
|
+ this.setData({
|
|
|
+ companyNatureLabel: result[0][i],
|
|
|
+ [companyNature]: result[1][i]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.fatherWork) {
|
|
|
- this.setData({
|
|
|
- fatherWorkLabel: result[0][i],
|
|
|
- [fatherWork]: result[1][i]
|
|
|
- })
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.fatherWork) {
|
|
|
+ this.setData({
|
|
|
+ fatherWorkLabel: result[0][i],
|
|
|
+ [fatherWork]: result[1][i]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.matherWork) {
|
|
|
- this.setData({
|
|
|
- matherWorkLabel: result[0][i],
|
|
|
- [matherWork]: result[1][i]
|
|
|
- })
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.matherWork) {
|
|
|
+ this.setData({
|
|
|
+ matherWorkLabel: result[0][i],
|
|
|
+ [matherWork]: result[1][i]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
@@ -574,35 +636,45 @@ Page({
|
|
|
matherWorkArrValue: result[1]
|
|
|
})
|
|
|
})
|
|
|
- this.setData({
|
|
|
- [phone]: res.data.info.tel,
|
|
|
- [company]: res.data.info.company,
|
|
|
- [motionState]: res.data.info.motionState,
|
|
|
- [hobby]: res.data.info.hobby,
|
|
|
- [isCommen]: res.data.info.isCommen,
|
|
|
- isCommenLabel: this.data.isCommenArr[res.data.info.isCommen],
|
|
|
- })
|
|
|
+ if (res.data.info) {
|
|
|
+ this.setData({
|
|
|
+ [phone]: res.data.info.tel,
|
|
|
+ [company]: res.data.info.company,
|
|
|
+ [hobby]: res.data.info.hobby,
|
|
|
+ [isCommon]: res.data.info.isCommon,
|
|
|
+ isCommonLabel: this.data.isCommonArr[res.data.info.isCommon],
|
|
|
+ })
|
|
|
+ }
|
|
|
tool.formDetails('he_parents').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.parents) {
|
|
|
- this.setData({
|
|
|
- parentsLabel: result[0][i],
|
|
|
- [parents]: result[1][i],
|
|
|
- parentsArr: result[0],
|
|
|
- parentsArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ parentsArr: result[0],
|
|
|
+ parentsArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.parents) {
|
|
|
+ this.setData({
|
|
|
+ parentsLabel: result[0][i],
|
|
|
+ [parents]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
tool.formDetails('he_parent_assets').then(result => {
|
|
|
- for (let i = 0; i < result[0].length; i++) {
|
|
|
- if (result[1][i] == res.data.info.parentAssets) {
|
|
|
- this.setData({
|
|
|
- parentAssetsLabel: result[0][i],
|
|
|
- [parentAssets]: result[1][i],
|
|
|
- parentAssetsArr: result[0],
|
|
|
- parentAssetsArrValue: result[1]
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ parentAssetsArr: result[0],
|
|
|
+ parentAssetsArrValue: result[1]
|
|
|
+ })
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.parentAssets) {
|
|
|
+ this.setData({
|
|
|
+ parentAssetsLabel: result[0][i],
|
|
|
+ [parentAssets]: result[1][i],
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -614,30 +686,53 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- let resComposition = res.data.info.composition.split(",");
|
|
|
- let resCompositionIndexArr = [];
|
|
|
- for (let i = 0; i < resComposition.length; i++) {
|
|
|
- for (let j = 0; j < result[1].length; j++) {
|
|
|
- if (resComposition[i] == result[1][j]) {
|
|
|
- resCompositionIndexArr.push(i)
|
|
|
+ if (res.data.info) {
|
|
|
+ let resComposition = res.data.info.composition.split(",");
|
|
|
+ let resCompositionIndexArr = [];
|
|
|
+ for (let i = 0; i < resComposition.length; i++) {
|
|
|
+ for (let j = 0; j < result[1].length; j++) {
|
|
|
+ if (resComposition[i] == result[1][j]) {
|
|
|
+ resCompositionIndexArr.push(i)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- let resCompositionLabel = [];
|
|
|
- for (let i = 0; i < resCompositionIndexArr.length; i++) {
|
|
|
- resCompositionLabel.push(result[0][resCompositionIndexArr[i]])
|
|
|
- }
|
|
|
- for (let i = 0; i < resCompositionLabel.length; i++) {
|
|
|
- if (resCompositionLabel[i] == compositionArr[i].value) {
|
|
|
- compositionArr[i].checked = true;
|
|
|
+ let resCompositionLabel = [];
|
|
|
+ for (let i = 0; i < resCompositionIndexArr.length; i++) {
|
|
|
+ resCompositionLabel.push(result[0][resCompositionIndexArr[i]])
|
|
|
+ }
|
|
|
+ for (let i = 0; i < resCompositionLabel.length; i++) {
|
|
|
+ if (resCompositionLabel[i] == compositionArr[i].value) {
|
|
|
+ compositionArr[i].checked = true;
|
|
|
+ }
|
|
|
}
|
|
|
+ this.setData({
|
|
|
+ [composition]: resCompositionLabel
|
|
|
+ })
|
|
|
}
|
|
|
this.setData({
|
|
|
compositionArr: compositionArr,
|
|
|
compositionArrLabel: result[0],
|
|
|
compositionArrValue: result[1],
|
|
|
- [composition]: resCompositionLabel
|
|
|
+
|
|
|
+ })
|
|
|
+ })
|
|
|
+ tool.formDetails('he_sports').then(result => {
|
|
|
+ console.log(result)
|
|
|
+ this.setData({
|
|
|
+ motionStateArr: result[0],
|
|
|
+ motionStateValue: result[1]
|
|
|
})
|
|
|
+ if (res.data.info) {
|
|
|
+ for (let i = 0; i < result[0].length; i++) {
|
|
|
+ if (result[1][i] == res.data.info.motionState) {
|
|
|
+ console.log(i)
|
|
|
+ this.setData({
|
|
|
+ motionStateLabel: result[0][i],
|
|
|
+ [motionState]: result[1][i],
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -774,7 +869,7 @@ Page({
|
|
|
assetCarLoan: {
|
|
|
required: true
|
|
|
},
|
|
|
- isCommen: {
|
|
|
+ isCommon: {
|
|
|
required: true
|
|
|
},
|
|
|
controlTime: {
|
|
@@ -845,7 +940,7 @@ Page({
|
|
|
assetCarLoan: {
|
|
|
required: '请选择车子贷款了没'
|
|
|
},
|
|
|
- isCommen: {
|
|
|
+ isCommon: {
|
|
|
required: '请选择是否与父母同住'
|
|
|
},
|
|
|
controlTime: {
|