|
@@ -1,4 +1,5 @@
|
|
|
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');
|
|
@@ -14,7 +15,7 @@ Page({
|
|
|
marriage: '',
|
|
|
children: '',
|
|
|
assetHouse: '',
|
|
|
- assetArea: '',
|
|
|
+ assetHouseArea: '',
|
|
|
assetHouseLoan: '',
|
|
|
assetCar: '',
|
|
|
assetCarValue: '',
|
|
@@ -26,12 +27,12 @@ Page({
|
|
|
company: '',
|
|
|
parents: '',
|
|
|
fatherWork: '',
|
|
|
- motherWork: '',
|
|
|
+ matherWork: '',
|
|
|
parentAssets: '',
|
|
|
composition: '',
|
|
|
motionState: '',
|
|
|
hobby: '',
|
|
|
- photo: ''
|
|
|
+ // photoUrl: ''
|
|
|
},
|
|
|
heightArr: [],
|
|
|
weightArr: [],
|
|
@@ -45,17 +46,23 @@ Page({
|
|
|
assetCarArr: [],
|
|
|
assetCarValueArr: [],
|
|
|
assetCarLoanArr: [],
|
|
|
- isCommenArr: ['一起', '没有'],
|
|
|
+ isCommenArr: ['没有', '一起'],
|
|
|
controlTimeArr: [],
|
|
|
workStatusArr: [],
|
|
|
companyNatureArr: [],
|
|
|
parentsArr: [],
|
|
|
fatherWorkArr: [],
|
|
|
- motherWorkArr: [],
|
|
|
+ matherWorkArr: [],
|
|
|
parentAssetsArr: [],
|
|
|
compositionArr: [],
|
|
|
figureArr: ['龟息养生从不运动', '三天打鱼偶尔运动', '动如脱兔成天运动']
|
|
|
},
|
|
|
+ phoneChange(e) {
|
|
|
+ let phone = 'form.phone'
|
|
|
+ this.setData({
|
|
|
+ [phone]: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
heightPicker(e) {
|
|
|
let height = 'form.height'
|
|
|
this.setData({
|
|
@@ -108,14 +115,15 @@ Page({
|
|
|
},
|
|
|
assetAreaPickerChange(e) {
|
|
|
console.log(e)
|
|
|
- let assetArea = 'form.assetArea'
|
|
|
+ let assetHouseArea = 'form.assetHouseArea'
|
|
|
this.setData({
|
|
|
assetAreaLabel: this.data.assetAreaArr[e.detail.value],
|
|
|
- [assetArea]: this.data.assetAreaArrValue[e.detail.value]
|
|
|
+ [assetHouseArea]: this.data.assetAreaArrValue[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
assetHouseLoanPickerChange(e) {
|
|
|
- console.log(e)
|
|
|
+ console.log(this.data.assetHouseLoanArr)
|
|
|
+ console.log(this.data.assetHouseLoanArrValue)
|
|
|
let assetHouseLoan = 'form.assetHouseLoan'
|
|
|
this.setData({
|
|
|
assetHouseLoanLabel: this.data.assetHouseLoanArr[e.detail.value],
|
|
@@ -149,12 +157,14 @@ Page({
|
|
|
isCommenChange(e) {
|
|
|
let isCommen = 'form.isCommen'
|
|
|
this.setData({
|
|
|
- [isCommen]: this.data.isCommenArr[e.detail.value]
|
|
|
+ [isCommen]: e.detail.value,
|
|
|
+ isCommenLabel: this.data.isCommenArr[e.detail.value],
|
|
|
})
|
|
|
},
|
|
|
controlTimeChange(e) {
|
|
|
const items = this.data.controlTimeArr;
|
|
|
const values = e.detail.value;
|
|
|
+ let controlTime = 'form.controlTime'
|
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
|
items[i].checked = false
|
|
|
for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
|
|
@@ -164,20 +174,10 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let indexArr = [];
|
|
|
- for (let i = 0; i < e.detail.value.length; i++) {
|
|
|
- indexArr.push(this.data.controlTimeArrLabel.indexOf(e.detail.value[i]))
|
|
|
- }
|
|
|
- let value = [];
|
|
|
- for (let i = 0; i < indexArr.length; i++) {
|
|
|
- value.push(this.data.controlTimeArrValue[indexArr[i]])
|
|
|
- }
|
|
|
- let controlTime = 'form.controlTime'
|
|
|
this.setData({
|
|
|
controlTimeArr: this.data.controlTimeArr,
|
|
|
- [controlTime]: value
|
|
|
+ [controlTime]: e.detail.value
|
|
|
})
|
|
|
- console.log(this.data.form.controlTime)
|
|
|
},
|
|
|
workStatusChange(e) {
|
|
|
console.log(e.detail.value)
|
|
@@ -192,20 +192,11 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let indexArr = [];
|
|
|
- for (let i = 0; i < e.detail.value.length; i++) {
|
|
|
- indexArr.push(this.data.workStatusArrLabel.indexOf(e.detail.value[i]))
|
|
|
- }
|
|
|
- let value = [];
|
|
|
- for (let i = 0; i < indexArr.length; i++) {
|
|
|
- value.push(this.data.workStatusArrValue[indexArr[i]])
|
|
|
- }
|
|
|
let workStatus = 'form.workStatus'
|
|
|
this.setData({
|
|
|
- [workStatus]: value,
|
|
|
+ [workStatus]: e.detail.value,
|
|
|
workStatusArr: this.data.workStatusArr
|
|
|
})
|
|
|
- console.log(this.data.form.workStatus)
|
|
|
},
|
|
|
companyNaturePicker(e) {
|
|
|
let companyNature = 'form.companyNature'
|
|
@@ -214,6 +205,12 @@ Page({
|
|
|
[companyNature]: this.data.companyNatureArrValue[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
+ companyChange(e) {
|
|
|
+ let company = 'form.company'
|
|
|
+ this.setData({
|
|
|
+ [company]: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
parentsPicker(e) {
|
|
|
let parents = 'form.parents'
|
|
|
this.setData({
|
|
@@ -228,11 +225,11 @@ Page({
|
|
|
[fatherWork]: this.data.fatherWorkArrValue[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
- motherworkPicker(e) {
|
|
|
- let motherWork = 'form.motherWork'
|
|
|
+ matherworkPicker(e) {
|
|
|
+ let matherWork = 'form.matherWork'
|
|
|
this.setData({
|
|
|
- motherWorkLabel: this.data.motherWorkArr[e.detail.value],
|
|
|
- [motherWork]: this.data.motherWorkArrValue[e.detail.value]
|
|
|
+ matherWorkLabel: this.data.matherWorkArr[e.detail.value],
|
|
|
+ [matherWork]: this.data.matherWorkArrValue[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
parentAssetsPicker(e) {
|
|
@@ -255,18 +252,10 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let indexArr = [];
|
|
|
- for (let i = 0; i < e.detail.value.length; i++) {
|
|
|
- indexArr.push(this.data.compositionArrLabel.indexOf(e.detail.value[i]))
|
|
|
- }
|
|
|
- let value = [];
|
|
|
- for (let i = 0; i < indexArr.length; i++) {
|
|
|
- value.push(this.data.compositionArrValue[indexArr[i]])
|
|
|
- }
|
|
|
let composition = 'form.composition'
|
|
|
this.setData({
|
|
|
compositionArr: this.data.compositionArr,
|
|
|
- [composition]: value
|
|
|
+ [composition]: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
figurePicker(e) {
|
|
@@ -275,10 +264,436 @@ Page({
|
|
|
[motionState]: this.data.figureArr[e.detail.value]
|
|
|
})
|
|
|
},
|
|
|
+ hobbyChange(e) {
|
|
|
+ let hobby = 'form.hobby'
|
|
|
+ this.setData({
|
|
|
+ [hobby]: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取手机号
|
|
|
+ getPhoneNumber(e) {
|
|
|
+ console.log(e)
|
|
|
+ if (e.detail.errMsg == "getPhoneNumber:ok") {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded',
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ sessionKey: this.data.sessionkey,
|
|
|
+ signature: this.data.signature,
|
|
|
+ rawData: this.data.rawData,
|
|
|
+ encryptedData: e.detail.encryptedData,
|
|
|
+ iv: e.detail.iv
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.data.phoneNumber, '我是解析的手机号');
|
|
|
+ let phone = 'form.phone'
|
|
|
+ this.setData({
|
|
|
+ [phone]: res.data.phoneNumber
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // console.log(e.detail.iv)
|
|
|
+ // console.log(e.detail.encryptedData)
|
|
|
+ },
|
|
|
+ getInfos() {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
|
|
|
+ method: "get",
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.data.info, '我是获取的信息')
|
|
|
+ let phone = 'form.phone'
|
|
|
+ let height = 'form.height'
|
|
|
+ let weight = 'form.weight'
|
|
|
+ let education = 'form.education'
|
|
|
+ let income = 'form.income'
|
|
|
+ let marriage = 'form.marriage'
|
|
|
+ let children = 'form.children'
|
|
|
+ let assetHouse = 'form.assetHouse'
|
|
|
+ let assetHouseArea = 'form.assetHouseArea'
|
|
|
+ let assetHouseLoan = 'form.assetHouseLoan'
|
|
|
+ let assetCar = 'form.assetCar'
|
|
|
+ let assetCarValue = 'form.assetCarValue'
|
|
|
+ let assetCarLoan = 'form.assetCarLoan'
|
|
|
+ let isCommen = 'form.isCommen'
|
|
|
+ let controlTime = 'form.controlTime'
|
|
|
+ let workStatus = 'form.workStatus'
|
|
|
+ let companyNature = 'form.companyNature'
|
|
|
+ let company = 'form.company'
|
|
|
+ let parents = 'form.parents'
|
|
|
+ let fatherWork = 'form.fatherWork'
|
|
|
+ let matherWork = 'form.matherWork'
|
|
|
+ let parentAssets = 'form.parentAssets'
|
|
|
+ let composition = 'form.composition'
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ tool.formDetails('he_control_time').then(result => {
|
|
|
+ let controlTimeArr = result[0].map((item, index) => {
|
|
|
+ return Object.assign({}, {
|
|
|
+ 'name': item,
|
|
|
+ 'value': item,
|
|
|
+ '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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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({
|
|
|
+ controlTimeArr: controlTimeArr,
|
|
|
+ controlTimeArrLabel: result[0],
|
|
|
+ controlTimeArrValue: result[1],
|
|
|
+ [controlTime]: resControlTimeLabel
|
|
|
+ })
|
|
|
+ })
|
|
|
+ tool.formDetails('he_work_status').then(result => {
|
|
|
+ let workStatusArr = result[0].map((item, index) => {
|
|
|
+ return Object.assign({}, {
|
|
|
+ 'name': item,
|
|
|
+ 'value': item,
|
|
|
+ '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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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({
|
|
|
+ workStatusArr: workStatusArr,
|
|
|
+ workStatusArrLabel: result[0],
|
|
|
+ workStatusArrValue: result[1],
|
|
|
+ [workStatus]: resWorkStatusLabel
|
|
|
+ })
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ companyNatureArr: result[0],
|
|
|
+ companyNatureArrValue: result[1],
|
|
|
+ fatherWorkArr: result[0],
|
|
|
+ fatherWorkArrValue: result[1],
|
|
|
+ matherWorkArr: result[0],
|
|
|
+ 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],
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ tool.formDetails('he_composition').then(result => {
|
|
|
+ let compositionArr = result[0].map((item, index) => {
|
|
|
+ return Object.assign({}, {
|
|
|
+ 'name': item,
|
|
|
+ 'value': item,
|
|
|
+ '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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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({
|
|
|
+ compositionArr: compositionArr,
|
|
|
+ compositionArrLabel: result[0],
|
|
|
+ compositionArrValue: result[1],
|
|
|
+ [composition]: resCompositionLabel
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 提交
|
|
|
formSubmit(e) {
|
|
|
+ console.log(e)
|
|
|
const params = e.detail.value
|
|
|
- console.log(params)
|
|
|
+ let controlTime = 'form.controlTime';
|
|
|
+ let workStatus = 'form.workStatus';
|
|
|
+ let composition = 'form.composition'
|
|
|
+ let indexArr = [];
|
|
|
+ for (let i = 0; i < params.controlTime.length; i++) {
|
|
|
+ indexArr.push(this.data.controlTimeArrLabel.indexOf(params.controlTime[i]))
|
|
|
+ }
|
|
|
+ let value = [];
|
|
|
+ for (let i = 0; i < indexArr.length; i++) {
|
|
|
+ value.push(this.data.controlTimeArrValue[indexArr[i]])
|
|
|
+ }
|
|
|
+ let str = '';
|
|
|
+ for (let i = 0; i < value.length; i++) {
|
|
|
+ str += value[i] + ','
|
|
|
+ }
|
|
|
+
|
|
|
+ let indexArr2 = [];
|
|
|
+ for (let i = 0; i < params.workStatus.length; i++) {
|
|
|
+ indexArr2.push(this.data.workStatusArrLabel.indexOf(params.workStatus[i]))
|
|
|
+ }
|
|
|
+ let value2 = [];
|
|
|
+ for (let i = 0; i < indexArr2.length; i++) {
|
|
|
+ value2.push(this.data.workStatusArrValue[indexArr2[i]])
|
|
|
+ }
|
|
|
+ let str2 = '';
|
|
|
+ for (let i = 0; i < value2.length; i++) {
|
|
|
+ str2 += value2[i] + ','
|
|
|
+ }
|
|
|
+
|
|
|
+ let indexArr3 = [];
|
|
|
+ for (let i = 0; i < params.composition.length; i++) {
|
|
|
+ indexArr3.push(this.data.compositionArrLabel.indexOf(params.composition[i]))
|
|
|
+ }
|
|
|
+ let value3 = [];
|
|
|
+ for (let i = 0; i < indexArr3.length; i++) {
|
|
|
+ value3.push(this.data.compositionArrValue[indexArr3[i]])
|
|
|
+ }
|
|
|
+ let str3 = '';
|
|
|
+ for (let i = 0; i < value3.length; i++) {
|
|
|
+ str3 += value3[i] + ','
|
|
|
+ }
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ [controlTime]: str.slice(0, str.length - 1),
|
|
|
+ [workStatus]: str2.slice(0, str2.length - 1),
|
|
|
+ [composition]: str3.slice(0, str3.length - 1),
|
|
|
+ })
|
|
|
+ console.log(this.data.form)
|
|
|
//校验表单
|
|
|
if (!this.WxValidate.checkForm(params)) {
|
|
|
const error = this.WxValidate.errorList[0]
|
|
@@ -291,7 +706,7 @@ Page({
|
|
|
header: {
|
|
|
'content-type': 'application/x-www-form-urlencoded',
|
|
|
},
|
|
|
- data: params,
|
|
|
+ data: this.data.form,
|
|
|
success: (res) => {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 0) {
|
|
@@ -344,7 +759,7 @@ Page({
|
|
|
assetHouse: {
|
|
|
required: true
|
|
|
},
|
|
|
- assetArea: {
|
|
|
+ assetHouseArea: {
|
|
|
required: true
|
|
|
},
|
|
|
assetHouseLoan: {
|
|
@@ -386,7 +801,7 @@ Page({
|
|
|
hobby: {
|
|
|
required: true
|
|
|
}
|
|
|
- // photo: {
|
|
|
+ // photoUrl: {
|
|
|
// required: true
|
|
|
// }
|
|
|
}
|
|
@@ -415,7 +830,7 @@ Page({
|
|
|
assetHouse: {
|
|
|
required: '请选择是否买房子'
|
|
|
},
|
|
|
- assetArea: {
|
|
|
+ assetHouseArea: {
|
|
|
required: '请选择房子多大面积'
|
|
|
},
|
|
|
assetHouseLoan: {
|
|
@@ -457,7 +872,7 @@ Page({
|
|
|
hobby: {
|
|
|
required: '请填写您的爱好'
|
|
|
}
|
|
|
- // photo: {
|
|
|
+ // photoUrl: {
|
|
|
// required: '请上传您的照片'
|
|
|
// }
|
|
|
}
|
|
@@ -465,145 +880,21 @@ Page({
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
this.initValidate();
|
|
|
- const getOpenid = await tool.openidStatus();
|
|
|
- this.setData({
|
|
|
- openid: getOpenid[0],
|
|
|
- sessionkey: getOpenid[1]
|
|
|
- })
|
|
|
- tool.formDetails('he_body_height').then(result => {
|
|
|
- this.setData({
|
|
|
- heightArr: result[0],
|
|
|
- heightArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_body_weight').then(result => {
|
|
|
- this.setData({
|
|
|
- weightArr: result[0],
|
|
|
- weightArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_education').then(result => {
|
|
|
- this.setData({
|
|
|
- educationArr: result[0],
|
|
|
- educationArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_income').then(result => {
|
|
|
+ tool.openidStatus().then(result => {
|
|
|
this.setData({
|
|
|
- incomeArr: result[0],
|
|
|
- incomeArrValue: result[1]
|
|
|
+ openid: result[0],
|
|
|
+ sessionkey: result[1]
|
|
|
})
|
|
|
- })
|
|
|
- tool.formDetails('he_marriage').then(result => {
|
|
|
- this.setData({
|
|
|
- marriageList: result[0],
|
|
|
- marriageListValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_children').then(result => {
|
|
|
- this.setData({
|
|
|
- childrenArr: result[0],
|
|
|
- childrenArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_house').then(result => {
|
|
|
- this.setData({
|
|
|
- assetHouseArr: result[0],
|
|
|
- assetHouseArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_house_area').then(result => {
|
|
|
- this.setData({
|
|
|
- assetAreaArr: result[0],
|
|
|
- assetAreaArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_house_loan').then(result => {
|
|
|
- this.setData({
|
|
|
- assetHouseLoanArr: result[0],
|
|
|
- assetHouseLoanArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_car').then(result => {
|
|
|
- this.setData({
|
|
|
- assetCarArr: result[0],
|
|
|
- assetCarArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_car_value').then(result => {
|
|
|
- this.setData({
|
|
|
- assetCarValueArr: result[0],
|
|
|
- assetCarValueArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_asset_car_loan').then(result => {
|
|
|
- this.setData({
|
|
|
- assetCarLoanArr: result[0],
|
|
|
- assetCarLoanArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_control_time').then(result => {
|
|
|
- let controlTimeArr = result[0].map((item, index) => {
|
|
|
- return Object.assign({}, {
|
|
|
- 'name': item,
|
|
|
- 'value': item,
|
|
|
- 'checked': false
|
|
|
- })
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- controlTimeArr: controlTimeArr,
|
|
|
- controlTimeArrLabel: result[0],
|
|
|
- controlTimeArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_work_status').then(result => {
|
|
|
- let workStatusArr = result[0].map((item, index) => {
|
|
|
- return Object.assign({}, {
|
|
|
- 'name': item,
|
|
|
- 'value': item,
|
|
|
- 'checked': false
|
|
|
- })
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- workStatusArr: workStatusArr,
|
|
|
- workStatusArrLabel: result[0],
|
|
|
- workStatusArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_company_nature').then(result => {
|
|
|
- this.setData({
|
|
|
- companyNatureArr: result[0],
|
|
|
- companyNatureArrValue: result[1],
|
|
|
- fatherWorkArr: result[0],
|
|
|
- fatherWorkArrValue: result[1],
|
|
|
- motherWorkArr: result[0],
|
|
|
- motherWorkArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_parents').then(result => {
|
|
|
- this.setData({
|
|
|
- parentsArr: result[0],
|
|
|
- parentsArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_parent_assets').then(result => {
|
|
|
- this.setData({
|
|
|
- parentAssetsArr: result[0],
|
|
|
- parentAssetsArrValue: result[1]
|
|
|
- })
|
|
|
- })
|
|
|
- tool.formDetails('he_composition').then(result => {
|
|
|
- let compositionArr = result[0].map((item, index) => {
|
|
|
- return Object.assign({}, {
|
|
|
- 'name': item,
|
|
|
- 'value': item,
|
|
|
- 'checked': false
|
|
|
- })
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- compositionArr: compositionArr,
|
|
|
- compositionArrLabel: result[0],
|
|
|
- compositionArrValue: result[1]
|
|
|
+ // this.getForm();
|
|
|
+ this.getInfos();
|
|
|
+ wx.getUserInfo({
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.setData({
|
|
|
+ rawData: res.rawData,
|
|
|
+ signature: res.signature
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -705,9 +996,9 @@ Page({
|
|
|
},
|
|
|
success: (res) => {
|
|
|
console.log(res.header.Location)
|
|
|
- let photo = 'form.photo'
|
|
|
+ let photoUrl = 'form.photoUrl'
|
|
|
this.setData({
|
|
|
- [photo]: res.header.Location
|
|
|
+ [photoUrl]: res.header.Location
|
|
|
})
|
|
|
// this.tj(params, res.header.Location)
|
|
|
},
|