|
@@ -1,29 +1,30 @@
|
|
-// pages/personInfoDetail/personInfoDetail.js
|
|
|
|
|
|
+import WxValidate from '../../utils/WxValidate.js'
|
|
Page({
|
|
Page({
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 页面的初始数据
|
|
|
|
- */
|
|
|
|
data: {
|
|
data: {
|
|
form: {
|
|
form: {
|
|
height: '',
|
|
height: '',
|
|
weight: '',
|
|
weight: '',
|
|
education: '',
|
|
education: '',
|
|
- wages: '',
|
|
|
|
- maritalstatus: '',
|
|
|
|
- ischild: '',
|
|
|
|
- house: '',
|
|
|
|
- car: '',
|
|
|
|
- freetime: '',
|
|
|
|
- worktime: '',
|
|
|
|
- workplace:'',
|
|
|
|
- workspacedetails:'',
|
|
|
|
- parentsstatus:'',
|
|
|
|
- dadworkplace:'',
|
|
|
|
- momworkplace:'',
|
|
|
|
- otherchild:'',
|
|
|
|
- figure:'',
|
|
|
|
- hobby:''
|
|
|
|
|
|
+ income: '',
|
|
|
|
+ marriage: '',
|
|
|
|
+ children: '',
|
|
|
|
+ assetHouse: '',
|
|
|
|
+ assetArea: '',
|
|
|
|
+ assetHouseLoan: '',
|
|
|
|
+ assetCar: '',
|
|
|
|
+ assetCarValue: '',
|
|
|
|
+ assetCarLoan: '',
|
|
|
|
+ isCommen: '',
|
|
|
|
+ controlTime: '',
|
|
|
|
+ workStatus: '',
|
|
|
|
+ companyNature: '',
|
|
|
|
+ company: '',
|
|
|
|
+ parents: '',
|
|
|
|
+ fatherWork: '',
|
|
|
|
+ motherWork: '',
|
|
|
|
+ composition: '',
|
|
|
|
+ motionState: '',
|
|
|
|
+ hobby: ''
|
|
},
|
|
},
|
|
heightArr: [
|
|
heightArr: [
|
|
'150以下',
|
|
'150以下',
|
|
@@ -40,8 +41,8 @@ Page({
|
|
"50kg以下", "50-60", "60-70", "70-80", "80-90", "90-100", "100以上"
|
|
"50kg以下", "50-60", "60-70", "70-80", "80-90", "90-100", "100以上"
|
|
],
|
|
],
|
|
educationArr: ["初中", "中专", "高中", "大专", "本科", "硕士", "博士"],
|
|
educationArr: ["初中", "中专", "高中", "大专", "本科", "硕士", "博士"],
|
|
- wagesArr: ["2000-5000", "5000-10000", "10000-20000", "20000以上"],
|
|
|
|
- maritalstatusList: [{
|
|
|
|
|
|
+ incomeArr: ["2000-5000", "5000-10000", "10000-20000", "20000以上"],
|
|
|
|
+ marriageList: [{
|
|
name: '未婚',
|
|
name: '未婚',
|
|
value: '未婚',
|
|
value: '未婚',
|
|
checked: true
|
|
checked: true
|
|
@@ -52,7 +53,7 @@ Page({
|
|
checked: false
|
|
checked: false
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- ischildArr: [{
|
|
|
|
|
|
+ childrenArr: [{
|
|
name: '无',
|
|
name: '无',
|
|
value: '无',
|
|
value: '无',
|
|
checked: true
|
|
checked: true
|
|
@@ -73,18 +74,14 @@ Page({
|
|
}
|
|
}
|
|
],
|
|
],
|
|
deposit: '',
|
|
deposit: '',
|
|
- housemultiArray: [
|
|
|
|
- ['租房', '购房'],
|
|
|
|
- ['80平以下', '80—120平', '120平以上'],
|
|
|
|
- ['有贷款', '无贷款'],
|
|
|
|
- ['与父母同住', '不与一起住']
|
|
|
|
- ],
|
|
|
|
- carmultiArray: [
|
|
|
|
- ['有车', '无车'],
|
|
|
|
- ['10万以下', '10-20万', '20-30万', '30-40万', '40-50万', '50-60万', '60-70万', '70-80万', '80-90万', '90-100万', '100万以上'],
|
|
|
|
- ['有贷款', '无贷款']
|
|
|
|
- ],
|
|
|
|
- freetimeArr: [{
|
|
|
|
|
|
+ assetHouseArr: ['租房', '购房'],
|
|
|
|
+ assetAreaArr: ['80平以下', '80-120平', '120平以上'],
|
|
|
|
+ assetHouseLoanArr: ['有', '没有'],
|
|
|
|
+ assetCarArr: ['有', '没有'],
|
|
|
|
+ assetCarValueArr: ['10万以下', '10-20万', '20-30万', '30-40万', '40-50万', '50-60万', '60-70万', '70-80万', '80-90万', '90-100万', '100万以上'],
|
|
|
|
+ assetCarLoanArr: ['有贷款', '无贷款'],
|
|
|
|
+ isCommenArr: ['一起', '没有'],
|
|
|
|
+ controlTimeArr: [{
|
|
name: '不限',
|
|
name: '不限',
|
|
value: '不限',
|
|
value: '不限',
|
|
checked: true
|
|
checked: true
|
|
@@ -104,7 +101,7 @@ Page({
|
|
}
|
|
}
|
|
],
|
|
],
|
|
// 工作时间自由、朝九晚五、偶尔加班、经常加班、偶尔出差、经常出差、常有应酬
|
|
// 工作时间自由、朝九晚五、偶尔加班、经常加班、偶尔出差、经常出差、常有应酬
|
|
- worktimeArr: [{
|
|
|
|
|
|
+ workStatusArr: [{
|
|
name: '工作时间自由',
|
|
name: '工作时间自由',
|
|
value: '工作时间自由',
|
|
value: '工作时间自由',
|
|
checked: true
|
|
checked: true
|
|
@@ -136,33 +133,34 @@ Page({
|
|
checked: false
|
|
checked: false
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- workplaceArr: ['政府机关','事业单位','外企企业','世界500强','上市公司','国有企业','私营企业','个体'],
|
|
|
|
- parentsstatusArr:[['爹妈比我都健康','世事无常'],['曾相爱','一直相爱']],
|
|
|
|
- dadworkplaceArr:['退休','政府机关','事业单位','外企企业','世界500强','上市公司','国有企业','私营企业','个体'],
|
|
|
|
- momworkplaceArr:['退休','政府机关','事业单位','外企企业','世界500强','上市公司','国有企业','私营企业','个体'],
|
|
|
|
- otherchildArr:[{
|
|
|
|
- name: '没有唯我独尊',
|
|
|
|
- value: '没有唯我独尊',
|
|
|
|
- checked: false
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '有姐姐',
|
|
|
|
- value: '偶有姐姐',
|
|
|
|
- checked: false
|
|
|
|
- }, {
|
|
|
|
- name: '有哥哥',
|
|
|
|
- value: '有哥哥',
|
|
|
|
- checked: false
|
|
|
|
- }, {
|
|
|
|
- name: '有弟弟',
|
|
|
|
- value: '有弟弟',
|
|
|
|
- checked: false
|
|
|
|
- }, {
|
|
|
|
- name: '有妹妹',
|
|
|
|
- value: '有妹妹',
|
|
|
|
- checked: false
|
|
|
|
- }],
|
|
|
|
- figureArr:['龟息养生从不运动','三天打鱼偶尔运动','动如脱兔成天运动']
|
|
|
|
|
|
+ workplaceArr: ['政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
|
|
|
|
+ parentsArr: ['爹妈比我都健康,一直很恩爱', '爹妈比我都健康,离婚了', '世事无常'],
|
|
|
|
+ dadworkplaceArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
|
|
|
|
+ momworkplaceArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
|
|
|
|
+ otherchildArr: [{
|
|
|
|
+ name: '没有唯我独尊',
|
|
|
|
+ value: '没有唯我独尊',
|
|
|
|
+ checked: false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '有姐姐',
|
|
|
|
+ value: '偶有姐姐',
|
|
|
|
+ checked: false
|
|
|
|
+ }, {
|
|
|
|
+ name: '有哥哥',
|
|
|
|
+ value: '有哥哥',
|
|
|
|
+ checked: false
|
|
|
|
+ }, {
|
|
|
|
+ name: '有弟弟',
|
|
|
|
+ value: '有弟弟',
|
|
|
|
+ checked: false
|
|
|
|
+ }, {
|
|
|
|
+ name: '有妹妹',
|
|
|
|
+ value: '有妹妹',
|
|
|
|
+ checked: false
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ figureArr: ['龟息养生从不运动', '三天打鱼偶尔运动', '动如脱兔成天运动']
|
|
},
|
|
},
|
|
heightPicker(e) {
|
|
heightPicker(e) {
|
|
let height = 'form.height'
|
|
let height = 'form.height'
|
|
@@ -182,17 +180,17 @@ Page({
|
|
[education]: this.data.educationArr[e.detail.value]
|
|
[education]: this.data.educationArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- wagesPicker(e) {
|
|
|
|
- let wages = 'form.wages'
|
|
|
|
|
|
+ incomePicker(e) {
|
|
|
|
+ let income = 'form.income'
|
|
this.setData({
|
|
this.setData({
|
|
- [wages]: this.data.wagesArr[e.detail.value]
|
|
|
|
|
|
+ [income]: this.data.incomeArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- maritalstatusChange: function (e) {
|
|
|
|
|
|
+ marriageChange: function (e) {
|
|
console.log(e.detail.value)
|
|
console.log(e.detail.value)
|
|
- const items = this.data.maritalstatusList
|
|
|
|
- let checked = 'maritalstatusList[0].checked';
|
|
|
|
- let checked1 = 'maritalstatusList[1].checked'
|
|
|
|
|
|
+ const items = this.data.marriageList
|
|
|
|
+ let checked = 'marriageList[0].checked';
|
|
|
|
+ let checked1 = 'marriageList[1].checked'
|
|
this.setData({
|
|
this.setData({
|
|
[checked]: false,
|
|
[checked]: false,
|
|
[checked1]: false
|
|
[checked1]: false
|
|
@@ -204,16 +202,16 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- maritalstatusList: this.data.maritalstatusList
|
|
|
|
|
|
+ marriageList: this.data.marriageList
|
|
})
|
|
})
|
|
- let maritalstatus = 'form.maritalstatus'
|
|
|
|
|
|
+ let marriage = 'form.marriage'
|
|
this.setData({
|
|
this.setData({
|
|
- [maritalstatus]: e.detail.value
|
|
|
|
|
|
+ [marriage]: e.detail.value
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- ischildChange: function (e) {
|
|
|
|
|
|
+ childrenChange: function (e) {
|
|
console.log(e.detail.value)
|
|
console.log(e.detail.value)
|
|
- const items = this.data.ischildArr;
|
|
|
|
|
|
+ const items = this.data.childrenArr;
|
|
const values = e.detail.value;
|
|
const values = e.detail.value;
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
items[i].checked = false
|
|
items[i].checked = false
|
|
@@ -225,55 +223,64 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- ischildArr: this.data.ischildArr
|
|
|
|
|
|
+ childrenArr: this.data.childrenArr
|
|
})
|
|
})
|
|
- let ischild = 'form.ischild'
|
|
|
|
|
|
+ let children = 'form.children'
|
|
this.setData({
|
|
this.setData({
|
|
- [ischild]: e.detail.value
|
|
|
|
|
|
+ [children]: e.detail.value
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- housePickerChange(e) {
|
|
|
|
|
|
+ assetHousePickerChange(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ let assetHouse = 'form.assetHouse'
|
|
this.setData({
|
|
this.setData({
|
|
- housemultiIndex: e.detail.value
|
|
|
|
|
|
+ [assetHouse]: this.data.assetHouseArr[e.detail.value]
|
|
})
|
|
})
|
|
- let house = 'form.house'
|
|
|
|
|
|
+ },
|
|
|
|
+ assetAreaPickerChange(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ let assetArea = 'form.assetArea'
|
|
this.setData({
|
|
this.setData({
|
|
- [house]: [this.data.housemultiArray[0][e.detail.value[0]], this.data.housemultiArray[1][e.detail.value[1]], this.data.housemultiArray[2][e.detail.value[2]], this.data.housemultiArray[3][e.detail.value[3]]]
|
|
|
|
|
|
+ [assetArea]: this.data.assetAreaArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- carPickerChange(e) {
|
|
|
|
- let car = 'form.car'
|
|
|
|
|
|
+ assetHouseLoanPickerChange(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ let assetHouseLoan = 'form.assetHouseLoan'
|
|
this.setData({
|
|
this.setData({
|
|
- [car]: [this.data.carmultiArray[0][e.detail.value[0]], this.data.carmultiArray[1][e.detail.value[1]], this.data.carmultiArray[2][e.detail.value[2]]]
|
|
|
|
|
|
+ [assetHouseLoan]: this.data.assetHouseLoanArr[e.detail.value]
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ assetCarPickerChange(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ let assetCar = 'form.assetCar'
|
|
this.setData({
|
|
this.setData({
|
|
- carmultiIndex: e.detail.value
|
|
|
|
|
|
+ [assetCar]: this.data.assetCarArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- carPickerColumnChange(e) {
|
|
|
|
|
|
+ assetCarValuePickerChange(e) {
|
|
console.log(e)
|
|
console.log(e)
|
|
- if (e.detail.column == 0 && e.detail.value == 1) {
|
|
|
|
- this.setData({
|
|
|
|
- carmultiArray: [
|
|
|
|
- ['有车', '无车'],
|
|
|
|
- [],
|
|
|
|
- []
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.setData({
|
|
|
|
- carmultiArray: [
|
|
|
|
- ['有车', '无车'],
|
|
|
|
- ['10万以下', '10-20万', '20-30万', '30-40万', '40-50万', '50-60万', '60-70万', '70-80万', '80-90万', '90-100万', '100万以上'],
|
|
|
|
- ['有贷款', '无贷款']
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ let assetCarValue = 'form.assetCarValue'
|
|
|
|
+ this.setData({
|
|
|
|
+ [assetCarValue]: this.data.assetCarValueArr[e.detail.value]
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ assetCarLoanPickerChange(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ let assetCarLoan = 'form.assetCarLoan'
|
|
|
|
+ this.setData({
|
|
|
|
+ [assetCarLoan]: this.data.assetCarLoanArr[e.detail.value]
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ isCommenChange(e) {
|
|
|
|
+ let isCommen = 'form.isCommen'
|
|
|
|
+ this.setData({
|
|
|
|
+ [isCommen]: this.data.isCommenArr[e.detail.value]
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- freetimeChange(e) {
|
|
|
|
|
|
+ controlTimeChange(e) {
|
|
console.log(e.detail.value)
|
|
console.log(e.detail.value)
|
|
- const items = this.data.freetimeArr;
|
|
|
|
|
|
+ const items = this.data.controlTimeArr;
|
|
const values = e.detail.value;
|
|
const values = e.detail.value;
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
items[i].checked = false
|
|
items[i].checked = false
|
|
@@ -285,16 +292,16 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- freetimeArr: this.data.freetimeArr
|
|
|
|
|
|
+ controlTimeArr: this.data.controlTimeArr
|
|
})
|
|
})
|
|
- let freetime = 'form.freetime'
|
|
|
|
|
|
+ let controlTime = 'form.controlTime'
|
|
this.setData({
|
|
this.setData({
|
|
- [freetime]: e.detail.value
|
|
|
|
|
|
+ [controlTime]: e.detail.value
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- worktimeChange(e) {
|
|
|
|
|
|
+ workStatusChange(e) {
|
|
console.log(e.detail.value)
|
|
console.log(e.detail.value)
|
|
- const items = this.data.worktimeArr;
|
|
|
|
|
|
+ const items = this.data.workStatusArr;
|
|
const values = e.detail.value;
|
|
const values = e.detail.value;
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
items[i].checked = false
|
|
items[i].checked = false
|
|
@@ -306,90 +313,35 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- worktimeArr: this.data.worktimeArr
|
|
|
|
|
|
+ workStatusArr: this.data.workStatusArr
|
|
})
|
|
})
|
|
- let worktime = 'form. worktime'
|
|
|
|
|
|
+ let workStatus = 'form. workStatus'
|
|
this.setData({
|
|
this.setData({
|
|
- [worktime]: e.detail.value
|
|
|
|
|
|
+ [workStatus]: e.detail.value
|
|
})
|
|
})
|
|
},
|
|
},
|
|
workplacePicker: function (e) {
|
|
workplacePicker: function (e) {
|
|
- let workplace = 'form.workplace'
|
|
|
|
|
|
+ let companyNature = 'form.companyNature'
|
|
this.setData({
|
|
this.setData({
|
|
- [workplace]: this.data.workplaceArr[e.detail.value]
|
|
|
|
- })
|
|
|
|
- // console.log(e.detail.value)
|
|
|
|
- // const items = this.data.workplaceArr
|
|
|
|
- // let checked = 'workplaceArr[0].checked';
|
|
|
|
- // let checked1 = 'workplaceArr[1].checked';
|
|
|
|
- // let checked2 = 'workplaceArr[2].checked';
|
|
|
|
- // let checked3 = 'workplaceArr[3].checked';
|
|
|
|
- // let checked4 = 'workplaceArr[4].checked';
|
|
|
|
- // let checked5 = 'workplaceArr[5].checked';
|
|
|
|
- // let checked6 = 'workplaceArr[6].checked';
|
|
|
|
- // let checked7 = 'workplaceArr[7].checked';
|
|
|
|
- // this.setData({
|
|
|
|
- // [checked]: false,
|
|
|
|
- // [checked1]: false,
|
|
|
|
- // [checked2]: false,
|
|
|
|
- // [checked3]: false,
|
|
|
|
- // [checked4]: false,
|
|
|
|
- // [checked5]: false,
|
|
|
|
- // [checked6]: false,
|
|
|
|
- // [checked7]: false
|
|
|
|
- // })
|
|
|
|
- // for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
|
|
|
- // if (items[i].value == e.detail.value) {
|
|
|
|
- // items[i].checked = true;
|
|
|
|
- // break
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // this.setData({
|
|
|
|
- // workplaceArr: this.data.workplaceArr
|
|
|
|
- // })
|
|
|
|
- // let workplace = 'form.workplace'
|
|
|
|
- // this.setData({
|
|
|
|
- // [workplace]: e.detail.value
|
|
|
|
- // })
|
|
|
|
- },
|
|
|
|
- parentsstatusChange(e) {
|
|
|
|
- let parentsstatus = 'form.parentsstatus'
|
|
|
|
- this.setData({
|
|
|
|
- [parentsstatus]: [this.data.parentsstatusArr[0][e.detail.value[0]], this.data.parentsstatusArr[1][e.detail.value[1]]]
|
|
|
|
|
|
+ [companyNature]: this.data.workplaceArr[e.detail.value]
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ parentsPicker(e) {
|
|
|
|
+ let parents = 'form.parents'
|
|
this.setData({
|
|
this.setData({
|
|
- parentsstatusmultiIndex: e.detail.value
|
|
|
|
|
|
+ [parents]: this.data.parentsArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- parentsstatusColumnChange(e) {
|
|
|
|
- console.log(e)
|
|
|
|
- if (e.detail.column == 0 && e.detail.value == 1) {
|
|
|
|
- this.setData({
|
|
|
|
- parentsstatusArr: [
|
|
|
|
- ['爹妈比我都健康','世事无常'],
|
|
|
|
- []
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.setData({
|
|
|
|
- parentsstatusArr: [
|
|
|
|
- ['爹妈比我都健康','世事无常'],
|
|
|
|
- ['曾相爱','一直相爱']
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
dadworkplacePicker: function (e) {
|
|
dadworkplacePicker: function (e) {
|
|
- let dadworkplace = 'form.dadworkplace'
|
|
|
|
|
|
+ let fatherWork = 'form.fatherWork'
|
|
this.setData({
|
|
this.setData({
|
|
- [dadworkplace]: this.data.dadworkplaceArr[e.detail.value]
|
|
|
|
|
|
+ [fatherWork]: this.data.dadworkplaceArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
momworkplacePicker: function (e) {
|
|
momworkplacePicker: function (e) {
|
|
- let momworkplace = 'form.momworkplace'
|
|
|
|
|
|
+ let motherWork = 'form.motherWork'
|
|
this.setData({
|
|
this.setData({
|
|
- [momworkplace]: this.data.momworkplaceArr[e.detail.value]
|
|
|
|
|
|
+ [motherWork]: this.data.momworkplaceArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
otherchildChange: function (e) {
|
|
otherchildChange: function (e) {
|
|
@@ -408,29 +360,208 @@ Page({
|
|
this.setData({
|
|
this.setData({
|
|
otherchildArr: this.data.otherchildArr
|
|
otherchildArr: this.data.otherchildArr
|
|
})
|
|
})
|
|
- let otherchild = 'form.otherchild'
|
|
|
|
|
|
+ let composition = 'form.composition'
|
|
this.setData({
|
|
this.setData({
|
|
- [otherchild]: e.detail.value
|
|
|
|
|
|
+ [composition]: e.detail.value
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
figurePicker(e) {
|
|
figurePicker(e) {
|
|
- let figure = 'form.figure'
|
|
|
|
|
|
+ let motionState = 'form.motionState'
|
|
this.setData({
|
|
this.setData({
|
|
- [figure]: this.data.figureArr[e.detail.value]
|
|
|
|
|
|
+ [motionState]: this.data.figureArr[e.detail.value]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
formSubmit(e) {
|
|
formSubmit(e) {
|
|
- console.log(e.detail.value)
|
|
|
|
|
|
+ const params = e.detail.value
|
|
|
|
+ //校验表单
|
|
|
|
+ if (!this.WxValidate.checkForm(params)) {
|
|
|
|
+ const error = this.WxValidate.errorList[0]
|
|
|
|
+ this.showModal(error)
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: '/pages/targetInfo/targetInfo',
|
|
url: '/pages/targetInfo/targetInfo',
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- /**
|
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
|
- */
|
|
|
|
|
|
+ //报错
|
|
|
|
+ showModal(error) {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ content: error.msg,
|
|
|
|
+ showCancel: false,
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //验证函数
|
|
|
|
+ initValidate() {
|
|
|
|
+ const rules = {
|
|
|
|
+ height: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ weight: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ education: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ income: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ marriage: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ children: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetHouse: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetArea: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetHouseLoan: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetCar: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetCarValue: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ assetCarLoan: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ isCommen: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ controlTime: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ workStatus: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ companyNature: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ company: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ parents: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ // fatherWork: {
|
|
|
|
+ // required: true
|
|
|
|
+ // },
|
|
|
|
+ // motherWork: {
|
|
|
|
+ // required: true
|
|
|
|
+ // },
|
|
|
|
+ composition: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ motionState: {
|
|
|
|
+ required: true
|
|
|
|
+ },
|
|
|
|
+ hobby: {
|
|
|
|
+ required: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const messages = {
|
|
|
|
+ // name: {
|
|
|
|
+ // required: '请填写姓名',
|
|
|
|
+ // minlength: '请输入正确的名称',
|
|
|
|
+ // maxlength: '请输入正确的名称'
|
|
|
|
+ // },
|
|
|
|
+ // sex: {
|
|
|
|
+ // required: '请选择性别'
|
|
|
|
+ // },
|
|
|
|
+ // age: {
|
|
|
|
+ // required: '请填写年龄'
|
|
|
|
+ // },
|
|
|
|
+ // nativePlace: {
|
|
|
|
+ // required: '请填写户籍地址'
|
|
|
|
+ // },
|
|
|
|
+ // nation: {
|
|
|
|
+ // required: '请选择民族'
|
|
|
|
+ // },
|
|
|
|
+ // birthday: {
|
|
|
|
+ // required: '请填写生日'
|
|
|
|
+ // },
|
|
|
|
+ // constellation: {
|
|
|
|
+ // required: '请选择星座'
|
|
|
|
+ // }
|
|
|
|
+ height: {
|
|
|
|
+ required: '请选择身高'
|
|
|
|
+ },
|
|
|
|
+ weight: {
|
|
|
|
+ required: '请选择体重'
|
|
|
|
+ },
|
|
|
|
+ education: {
|
|
|
|
+ required: '请选择教育程度'
|
|
|
|
+ },
|
|
|
|
+ income: {
|
|
|
|
+ required: '请选择收入'
|
|
|
|
+ },
|
|
|
|
+ marriage: {
|
|
|
|
+ required: '请选择婚姻状态'
|
|
|
|
+ },
|
|
|
|
+ children: {
|
|
|
|
+ required: '请选择有没有孩子'
|
|
|
|
+ },
|
|
|
|
+ assetHouse: {
|
|
|
|
+ required: '请选择是否买房子'
|
|
|
|
+ },
|
|
|
|
+ assetArea: {
|
|
|
|
+ required: '请选择房子多大面积'
|
|
|
|
+ },
|
|
|
|
+ assetHouseLoan: {
|
|
|
|
+ required: '请选择房子贷款了没'
|
|
|
|
+ },
|
|
|
|
+ assetCar: {
|
|
|
|
+ required: '请选择车子情况'
|
|
|
|
+ },
|
|
|
|
+ assetCarValue: {
|
|
|
|
+ required: '请选择车子的价值'
|
|
|
|
+ },
|
|
|
|
+ assetCarLoan: {
|
|
|
|
+ required: '请选择车子贷款了没'
|
|
|
|
+ },
|
|
|
|
+ isCommen: {
|
|
|
|
+ required: '请选择是否与父母同住'
|
|
|
|
+ },
|
|
|
|
+ controlTime: {
|
|
|
|
+ required: '请选择您的空闲时间'
|
|
|
|
+ },
|
|
|
|
+ workStatus: {
|
|
|
|
+ required: '请选择您的工作状态'
|
|
|
|
+ },
|
|
|
|
+ companyNature: {
|
|
|
|
+ required: '请选择您的单位性质'
|
|
|
|
+ },
|
|
|
|
+ company: {
|
|
|
|
+ required: '请输入您的单位具体名称'
|
|
|
|
+ },
|
|
|
|
+ parents: {
|
|
|
|
+ required: '请选择您的父母情况'
|
|
|
|
+ },
|
|
|
|
+ // fatherWork: {
|
|
|
|
+ // required:
|
|
|
|
+ // },
|
|
|
|
+ // motherWork: {
|
|
|
|
+ // required:
|
|
|
|
+ // },
|
|
|
|
+ composition: {
|
|
|
|
+ required: '请选择有没有兄弟姐妹'
|
|
|
|
+ },
|
|
|
|
+ motionState: {
|
|
|
|
+ required: '请选择您是否喜欢运动'
|
|
|
|
+ },
|
|
|
|
+ hobby: {
|
|
|
|
+ required: '请填写您的爱好'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.WxValidate = new WxValidate(rules, messages)
|
|
|
|
+ },
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
-
|
|
|
|
|
|
+ this.initValidate()
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|