|
@@ -261,8 +261,8 @@ Page({
|
|
|
let motionState = 'form.motionState'
|
|
|
this.setData({
|
|
|
motionStateLabel: this.data.motionStateArr[e.detail.value],
|
|
|
- [motionState]:this.data.motionStateArrValue[e.detail.value]
|
|
|
-
|
|
|
+ [motionState]: this.data.motionStateArrValue[e.detail.value]
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
hobbyChange(e) {
|
|
@@ -300,36 +300,50 @@ Page({
|
|
|
},
|
|
|
// 获取手机号
|
|
|
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, '我是解析的手号');
|
|
|
- let phone = 'form.phone'
|
|
|
- if (res.data.phoneNumber) {
|
|
|
- this.setData({
|
|
|
- [phone]: res.data.phoneNumber
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.setData({
|
|
|
- [phone]: 0
|
|
|
+ tool.isLogin().then(res => {
|
|
|
+ console.log(res)
|
|
|
+ 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: res.signature,
|
|
|
+ rawData: res.rawData,
|
|
|
+ encryptedData: e.detail.encryptedData,
|
|
|
+ iv: e.detail.iv
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, '我是解析的手号');
|
|
|
+ let phone = 'form.phone'
|
|
|
+ if (res.data.phoneNumber) {
|
|
|
+ this.setData({
|
|
|
+ [phone]: res.data.phoneNumber
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ [phone]: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ wx.showModal({
|
|
|
+ title: '您还未登录',
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/personal/personal',
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
getInfos() {
|
|
|
wx.showLoading();
|
|
@@ -368,7 +382,7 @@ Page({
|
|
|
heightArr: result[0],
|
|
|
heightArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.height) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.height) {
|
|
|
this.setData({
|
|
@@ -384,7 +398,7 @@ Page({
|
|
|
weightArr: result[0],
|
|
|
weightArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.weight) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.weight) {
|
|
|
this.setData({
|
|
@@ -400,7 +414,7 @@ Page({
|
|
|
educationArr: result[0],
|
|
|
educationArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.education) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.education) {
|
|
|
this.setData({
|
|
@@ -416,7 +430,7 @@ Page({
|
|
|
incomeArr: result[0],
|
|
|
incomeArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.income) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.income) {
|
|
|
this.setData({
|
|
@@ -432,7 +446,7 @@ Page({
|
|
|
marriageList: result[0],
|
|
|
marriageListValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.marriage) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.marriage) {
|
|
|
this.setData({
|
|
@@ -448,7 +462,7 @@ Page({
|
|
|
childrenArr: result[0],
|
|
|
childrenArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.children) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.children) {
|
|
|
this.setData({
|
|
@@ -464,7 +478,7 @@ Page({
|
|
|
assetHouseArr: result[0],
|
|
|
assetHouseArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetHouse) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetHouse) {
|
|
|
this.setData({
|
|
@@ -481,7 +495,7 @@ Page({
|
|
|
assetAreaArr: result[0],
|
|
|
assetAreaArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetHouseArea) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetHouseArea) {
|
|
|
this.setData({
|
|
@@ -498,7 +512,7 @@ Page({
|
|
|
assetHouseLoanArr: result[0],
|
|
|
assetHouseLoanArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetHouseLoan) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetHouseLoan) {
|
|
|
this.setData({
|
|
@@ -514,7 +528,7 @@ Page({
|
|
|
assetCarArr: result[0],
|
|
|
assetCarArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetCar) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetCar) {
|
|
|
this.setData({
|
|
@@ -531,7 +545,7 @@ Page({
|
|
|
assetCarValueArr: result[0],
|
|
|
assetCarValueArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetCarValue) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetCarValue) {
|
|
|
this.setData({
|
|
@@ -547,7 +561,7 @@ Page({
|
|
|
assetCarLoanArr: result[0],
|
|
|
assetCarLoanArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.assetCarLoan) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.assetCarLoan) {
|
|
|
this.setData({
|
|
@@ -566,7 +580,7 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- if (res.data.info.controlTime) {
|
|
|
+ if (res.data.code == 0 && res.data.info.controlTime) {
|
|
|
let resControlTime = res.data.info.controlTime.split(",");
|
|
|
let resControlTimeIndexArr = [];
|
|
|
for (let i = 0; i < resControlTime.length; i++) {
|
|
@@ -594,6 +608,7 @@ Page({
|
|
|
controlTimeArrLabel: result[0],
|
|
|
controlTimeArrValue: result[1],
|
|
|
})
|
|
|
+ console.log(this.data.controlTimeArr, '1111111111111')
|
|
|
})
|
|
|
tool.formDetails('he_work_status').then(result => {
|
|
|
let workStatusArr = result[0].map((item, index) => {
|
|
@@ -603,7 +618,7 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- if (res.data.info.workStatus) {
|
|
|
+ if (res.data.code == 0 && res.data.info.workStatus) {
|
|
|
let resWorkStatus = res.data.info.workStatus.split(",");
|
|
|
let resWorkStatusIndexArr = [];
|
|
|
for (let i = 0; i < resWorkStatus.length; i++) {
|
|
@@ -633,7 +648,7 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
tool.formDetails('he_company_nature').then(result => {
|
|
|
- if (res.data.info.companyNature) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.companyNature) {
|
|
|
this.setData({
|
|
@@ -643,7 +658,7 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (res.data.info.fatherWork) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.fatherWork) {
|
|
|
this.setData({
|
|
@@ -653,7 +668,7 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (res.data.info.matherWork) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.matherWork) {
|
|
|
this.setData({
|
|
@@ -672,7 +687,7 @@ Page({
|
|
|
matherWorkArrValue: result[1]
|
|
|
})
|
|
|
})
|
|
|
- if (res.data.info) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
this.setData({
|
|
|
[phone]: res.data.info.tel,
|
|
|
[company]: res.data.info.company,
|
|
@@ -686,7 +701,7 @@ Page({
|
|
|
parentsArr: result[0],
|
|
|
parentsArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.parents) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.parents) {
|
|
|
this.setData({
|
|
@@ -702,7 +717,7 @@ Page({
|
|
|
parentAssetsArr: result[0],
|
|
|
parentAssetsArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.parentAssets) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.parentAssets) {
|
|
|
this.setData({
|
|
@@ -721,7 +736,7 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- if (res.data.info.composition) {
|
|
|
+ if (res.data.code == 0 && res.data.info.composition) {
|
|
|
let resComposition = res.data.info.composition.split(",");
|
|
|
let resCompositionIndexArr = [];
|
|
|
for (let i = 0; i < resComposition.length; i++) {
|
|
@@ -757,7 +772,7 @@ Page({
|
|
|
motionStateArr: result[0],
|
|
|
motionStateArrValue: result[1]
|
|
|
})
|
|
|
- if (res.data.info.motionState) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
for (let i = 0; i < result[0].length; i++) {
|
|
|
if (result[1][i] == res.data.info.motionState) {
|
|
|
console.log(i)
|
|
@@ -777,7 +792,7 @@ Page({
|
|
|
'checked': false
|
|
|
})
|
|
|
})
|
|
|
- if (res.data.info.hobby) {
|
|
|
+ if (res.data.code == 0 && res.data.info.hobby) {
|
|
|
let reshobby = res.data.info.hobby.split(",");
|
|
|
let reshobbyIndexArr = [];
|
|
|
for (let i = 0; i < reshobby.length; i++) {
|
|
@@ -806,46 +821,6 @@ Page({
|
|
|
hobbyArrValue: result[1]
|
|
|
})
|
|
|
})
|
|
|
- // tool.formDetails('he_hobby').then(result=>{
|
|
|
- // console.log(result)
|
|
|
- // let hobbyArr = result[0].map((item, index) => {
|
|
|
- // return Object.assign({}, {
|
|
|
- // 'name': item,
|
|
|
- // 'value': item,
|
|
|
- // 'checked': false
|
|
|
- // })
|
|
|
- // })
|
|
|
- // if (res.data.info.hobby) {
|
|
|
- // let resHobby = res.data.info.hobby.split(",");
|
|
|
- // let resHobbyIndexArr = [];
|
|
|
- // for (let i = 0; i < resHobby.length; i++) {
|
|
|
- // for (let j = 0; j < result[1].length; j++) {
|
|
|
- // if (resHobby[i] == result[1][j]) {
|
|
|
- // resHobbyIndexArr.push(i)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // let resHobbyLabel = [];
|
|
|
- // for (let i = 0; i < resHobbyIndexArr.length; i++) {
|
|
|
- // resHobbyLabel.push(result[0][resHobbyIndexArr[i]])
|
|
|
- // }
|
|
|
- // for (let i = 0; i < resHobbyLabel.length; i++) {
|
|
|
- // if (resHobbyLabel[i] == hobbyArr[i].value) {
|
|
|
- // hobbyArr[i].checked = true;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.setData({
|
|
|
- // [hobby]: resHobbyLabel
|
|
|
- // })
|
|
|
- // }
|
|
|
- // this.setData({
|
|
|
- // hobbyArr: hobbyArr,
|
|
|
- // HobbyLabel: result[0],
|
|
|
- // HobbyValue: result[1]
|
|
|
- // })
|
|
|
- // console.log(result[0])
|
|
|
- // console.log(this.data.HobbyLabel)
|
|
|
- // })
|
|
|
},
|
|
|
complete: () => {
|
|
|
wx.hideLoading()
|
|
@@ -926,11 +901,17 @@ Page({
|
|
|
wx.showModal({
|
|
|
title: '上传成功',
|
|
|
showCancel: false,
|
|
|
- success(res) {
|
|
|
+ success:(res)=> {
|
|
|
if (res.confirm) {
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/InfoType/InfoType',
|
|
|
- })
|
|
|
+ if(this.data.targetStatus){
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/targetInfo/targetInfo',
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -1098,48 +1079,19 @@ Page({
|
|
|
openid: result[0],
|
|
|
sessionkey: result[1]
|
|
|
})
|
|
|
- // this.getForm();
|
|
|
this.getInfos();
|
|
|
- wx.getSetting({
|
|
|
- success: res => {
|
|
|
- console.log(res)
|
|
|
- if (res.authSetting['scope.userInfo']) {
|
|
|
- // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
- wx.getUserInfo({
|
|
|
- success: res => {
|
|
|
- this.setData({
|
|
|
- rawData: res.rawData,
|
|
|
- signature: res.signature
|
|
|
- })
|
|
|
- if (this.userInfoReadyCallback) {
|
|
|
- this.userInfoReadyCallback(res)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- // wx.showModal({
|
|
|
- // title: '您还未登录',
|
|
|
- // showCancel: false,
|
|
|
- // success(res) {
|
|
|
- // if (res.confirm) {
|
|
|
- // wx.redirectTo({
|
|
|
- // url: '/pages/personal/personal',
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- }
|
|
|
- }
|
|
|
+ tool.isFinishTargetInfo().then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.setData({
|
|
|
+ targetStatus: true
|
|
|
+ })
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err)
|
|
|
+ this.setData({
|
|
|
+ targetStatus: false
|
|
|
+ })
|
|
|
})
|
|
|
- // wx.getUserInfo({
|
|
|
- // success: (res) => {
|
|
|
- // console.log(res)
|
|
|
- // this.setData({
|
|
|
- // rawData: res.rawData,
|
|
|
- // signature: res.signature
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
+ // this.getTargetInfostatus();
|
|
|
})
|
|
|
},
|
|
|
// 上传头像
|