...
|
...
|
@@ -21,6 +21,8 @@ Page({ |
|
|
name: ['受益人1', '受益人2'],
|
|
|
unit: ''
|
|
|
}],
|
|
|
// 已选择的受益人
|
|
|
beneficiaryList:[],
|
|
|
beneficiaryindex: -1,
|
|
|
beneficiary_name: '',
|
|
|
imgs: [],
|
...
|
...
|
@@ -35,7 +37,8 @@ Page({ |
|
|
risk_list:[{
|
|
|
name:'',
|
|
|
projectlist:[],
|
|
|
project_time:''
|
|
|
project_time:'',
|
|
|
time: 1
|
|
|
}],
|
|
|
main_array:[]
|
|
|
|
...
|
...
|
@@ -252,22 +255,41 @@ Page({ |
|
|
beneficiarySelect(e) {
|
|
|
// console.log(e)
|
|
|
var index = e.currentTarget.dataset.mindex
|
|
|
var beneficiary_list = this.data.beneficiary_list;
|
|
|
for (var i = 0; i < beneficiary_list.length; i++) {
|
|
|
for (var j = 0; j < beneficiary_list[i].name.length; j++) {
|
|
|
var beneficiary_name = beneficiary_list[i].name[e.detail.value]
|
|
|
beneficiary_list[index].beneficiary_name = beneficiary_name
|
|
|
// console.log(beneficiary_list)
|
|
|
}
|
|
|
var beneficiary_list = Object.assign(this.data.beneficiary_list,{});
|
|
|
// 获取当前已选择的收益人
|
|
|
let tempBenefice = Object.assign(this.data.beneficiaryList,{})
|
|
|
// 当前选择的收益人
|
|
|
let nowPerson = beneficiary_list[index].name[e.detail.value];
|
|
|
// 判断受益人是否已经添加
|
|
|
const add = tempBenefice.every((tempBenefice)=>{
|
|
|
return tempBenefice != nowPerson
|
|
|
})
|
|
|
console.log()
|
|
|
if(add){
|
|
|
beneficiary_list[index].beneficiary_name = nowPerson;
|
|
|
tempBenefice.push(nowPerson)
|
|
|
}else{
|
|
|
wx.showToast({
|
|
|
title: '请不要重复添加受益人',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
// for (var i = 0; i < beneficiary_list.length; i++) {
|
|
|
// for (var j = 0; j < beneficiary_list[i].name.length; j++) {
|
|
|
// var beneficiary_name =
|
|
|
|
|
|
// beneficiary_list[index].beneficiary_name = beneficiary_list[i].name[e.detail.value]
|
|
|
// // console.log(beneficiary_list)
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// let tempRangArry = this.data.rang_beneficiary;
|
|
|
// tempRangArry[index] = beneficiary_list[index].name[e.detail.value]
|
|
|
// console.log(tempRangArry)
|
|
|
|
|
|
this.setData({
|
|
|
beneficiaryindex: e.detail.value,
|
|
|
beneficiary_list: beneficiary_list
|
|
|
beneficiary_list: beneficiary_list,
|
|
|
beneficiaryList: tempBenefice
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -306,6 +328,21 @@ Page({ |
|
|
beneficiary_list: list
|
|
|
})
|
|
|
},
|
|
|
// 删除受益人
|
|
|
deletebenefict(e){
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let tempbenefict = Object.assign(this.data.beneficiary_list, {});
|
|
|
let beneficiaryList = Object.assign(this.data.beneficiaryList,{});
|
|
|
// 获取当前选项的受益人
|
|
|
let person = tempbenefict[index].beneficiary_name;
|
|
|
tempbenefict.splice(index, 1);
|
|
|
if (person) beneficiaryList.splice(beneficiaryList.indexOf(person),1)
|
|
|
|
|
|
this.setData({
|
|
|
beneficiaryList: beneficiaryList,
|
|
|
beneficiary_list: tempbenefict
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//添加附加险
|
|
|
addRisk(){
|
...
|
...
|
@@ -320,10 +357,15 @@ Page({ |
|
|
risk_list: risk_list
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除附加险
|
|
|
deleteRisk(e) {
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
risk_list.splice(index, 1);
|
|
|
this.setData({
|
|
|
risk_list: risk_list
|
|
|
})
|
|
|
},
|
|
|
//上传图片
|
|
|
uploadImage() {
|
|
|
let that = this;
|
...
|
...
|
@@ -449,14 +491,15 @@ Page({ |
|
|
},
|
|
|
|
|
|
selectUnit4(e) {
|
|
|
var unit = e.currentTarget.dataset.unit
|
|
|
var unit = e.currentTarget.dataset.unit;
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let risk_list = Object.assign(this.data.risk_list,{});
|
|
|
risk_list[index].time = unit
|
|
|
this.setData({
|
|
|
unit4: unit
|
|
|
risk_list: risk_list
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 保单验证&&上传保单
|
|
|
listVerify(e) {
|
|
|
// this.insureItem()
|
...
|
...
|
|