作者 朱振飞

Merge branch 'master' of http://114.215.101.231:8099/liuxiaoyan/baoxian into Branch_zhu

# Conflicts:
#	pages/index/addListDetail/addListDetail.js
... ... @@ -21,9 +21,8 @@ Page({
name: ['受益人1', '受益人2'],
unit: ''
}],
// 已选择的受益人
beneficiaryList:[],
beneficiaryindex: -1,
tempfavoree: [],// 已选择的受益人
beneficiaryList:[], beneficiaryindex: -1,
beneficiary_name: '',
imgs: [],
main_risk: [],
... ... @@ -40,8 +39,13 @@ Page({
project_time:'',
time: 1
}],
main_array:[]
main_array: [],
warranty_one: [],
warranty_two: [],
guarantee_name: '',
long_money: [],
time_name: '',
type_money: '',
},
//投保人
... ... @@ -88,14 +92,14 @@ Page({
let that = this;
let type = e.currentTarget.dataset.type;
let index = e.currentTarget.dataset.xulie;
let tempProjectlist = Object.assign(this.data.projectlist, {}) ;
let tempProjectlist = Object.assign(this.data.projectlist, {});
// 已经添加的附加险
let rist_list = Object.assign(this.data.risk_list,{});
let rist_list = Object.assign(this.data.risk_list, {});
let tempRist = rist_list[index].projectlist;
// 已经添加的主险
let tempMain_list = Object.assign(this.data.main_array, {})
if(type=='zhuxian'){
if (tempMain_list.length>0) {
if (type == 'zhuxian') {
if (tempMain_list.length > 0) {
for (let i in tempProjectlist) {
for (let j in tempMain_list) {
if (tempProjectlist[i].id == tempMain_list[j].id) {
... ... @@ -104,17 +108,17 @@ Page({
}
}
}
}else{
if (tempRist.length){
} else {
if (tempRist.length) {
for (let i in tempProjectlist) {
for (let j in tempRist){
for (let j in tempRist) {
if (tempProjectlist[i].id == tempRist[j].id) {
tempProjectlist[i] = tempRist[j]
}
}
}
}
}
wx.setNavigationBarTitle({
title: '选择保障项目',
... ... @@ -147,7 +151,7 @@ Page({
this.setData({
projectlist: res.data.data.def
})
console.log(this.data.projectlist)
// console.log(this.data.projectlist)
}
})
},
... ... @@ -173,12 +177,10 @@ Page({
//保障项目金额
popupNum(e) {
// var main_risk = this.data.main_risk
var index = e.currentTarget.dataset.index;
var projectlist = this.data.projectlist;
if (projectlist[index].choose_status) {
projectlist[index].num = e.detail.value
// main_risk[index].num = projectlist[index].num
}
console.log(main_risk)
this.setData({
... ... @@ -191,10 +193,10 @@ Page({
var index = e.currentTarget.dataset.index;
var projectlist = this.data.projectlist;
projectlist[index].choose_status = !projectlist[index].choose_status;
console.log(projectlist)
// console.log(projectlist)
this.setData({
projectlist: projectlist
})
})
},
//确认选择的推荐方案
... ... @@ -203,11 +205,12 @@ Page({
let type = this.data.addType;
var that = this
var main_array = []
var projectlist = Object.assign(this.data.projectlist,{})
var projectlist = Object.assign(this.data.projectlist, {})
for (var i = 0; i < projectlist.length; i++) {
if (projectlist[i].choose_status) {
main_array.push(projectlist[i])
}
if (projectlist[i].choose_status) {
main_array.push(projectlist[i])
}
}
if (main_array != '') {
... ... @@ -215,18 +218,21 @@ Page({
title: '添加成功',
icon: 'none'
})
if(type=='fujiaxian'){
if (type == 'fujiaxian') {
let tempRist = that.data.risk_list;
tempRist[index]['projectlist'] = main_array;
that.setData({
risk_list: tempRist,
})
}else{
} else {
that.setData({
main_array: main_array,
})
}
console.log(this.data.main_array)
// var temp = main_array
// for (var i = 0; i < main_array.length; i++) {
// for (var j = 0; j < main_array[i].title.length; j++) {
... ... @@ -251,10 +257,35 @@ Page({
}, 1000)
},
//主线保障期
tempMain() {
// var main_array = this.data.main_array
// var warranty_one = this.data.warranty_one
// var temp = {}
// var len = main_array.length
// for (var i = 0; i < main_array.length; i++) {
// if (main_array[i].choose_status) {
// temp.num = main_array[i].beneficiary_name
// temp.title = main_array[i].name
// warranty_one.push(temp)
// }
// var hash = {};
// var temrecommend = warranty_one.reduce(function (item, next) {
// hash[next.name] ? '' : hash[next.name] = true && item.push(next);
// return item
// }, [])
// console.log(temrecommend)
// this.setData({
// warranty_one: temrecommend
// })
// }
},
//选择受益人姓名
beneficiarySelect(e) {
// console.log(e)
var index = e.currentTarget.dataset.mindex
var beneficiary_list = Object.assign(this.data.beneficiary_list,{});
// 获取当前已选择的收益人
let tempBenefice = Object.assign(this.data.beneficiaryList,{})
... ... @@ -288,11 +319,14 @@ Page({
// console.log(tempRangArry)
this.setData({
beneficiary_list: beneficiary_list,
beneficiaryList: tempBenefice
})
},
//添加收益比例
addUnit(e) {
// console.log(e)
... ... @@ -327,8 +361,35 @@ Page({
this.setData({
beneficiary_list: list
})
console.log(this.data.beneficiary_list)
},
//重组添加受益人
tempBeneficiary() {
var beneficiary_list = this.data.beneficiary_list
var tempfavoree = this.data.tempfavoree
var temp = {}
var len = beneficiary_list.length
for (var i = 0; i < beneficiary_list.length; i++) {
if (beneficiary_list[i].unit != '') {
temp.name = beneficiary_list[i].beneficiary_name
temp.unit = beneficiary_list[i].unit
tempfavoree.push(temp)
}
var hash = {};
var temrecommend = tempfavoree.reduce(function(item, next) {
hash[next.name] ? '' : hash[next.name] = true && item.push(next);
return item
}, [])
// console.log(temrecommend)
this.setData({
tempfavoree: temrecommend
})
}
},
// 删除受益人
//删除收益人
deletebenefict(e){
let index = e.currentTarget.dataset.index;
let tempbenefict = Object.assign(this.data.beneficiary_list, {});
... ... @@ -343,15 +404,15 @@ Page({
beneficiary_list: tempbenefict
})
},
//添加附加险
addRisk(){
var risk_list = Object.assign(this.data.risk_list,{});
var len=risk_list.length
//添加附加险
addRisk() {
var risk_list = Object.assign(this.data.risk_list, {});
var len = risk_list.length
risk_list[len] = {
name: '',
projectlist: [],
project_time: ''
project_time: '',
time:''
}
this.setData({
risk_list: risk_list
... ... @@ -372,7 +433,7 @@ Page({
wx.chooseImage({
count: 6,
sizeType: ['original', 'compressed'],
success: function(res) {
success: function (res) {
let successUp = 0; //成功个数
let failUp = 0; //失败个数
let i = 0; //第几个
... ... @@ -384,7 +445,7 @@ Page({
})
that.uploadAllfile(tempFilePaths, successUp, failUp, i, length)
},
fail: function(res) {}
fail: function (res) { }
})
},
... ... @@ -400,7 +461,7 @@ Page({
'strtime': strtime,
'token': app.strTime(strtime)
},
success: function(res) {
success: function (res) {
wx.hideNavigationBarLoading()
wx.hideLoading()
if (res.statusCode == '200') {
... ... @@ -431,7 +492,7 @@ Page({
})
}
},
fail: function(res) {
fail: function (res) {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
... ... @@ -493,7 +554,7 @@ Page({
selectUnit4(e) {
var unit = e.currentTarget.dataset.unit;
let index = e.currentTarget.dataset.index;
let risk_list = Object.assign(this.data.risk_list,{});
let risk_list = Object.assign(this.data.risk_list, {});
risk_list[index].time = unit
this.setData({
risk_list: risk_list
... ... @@ -715,56 +776,56 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
this.ensureProjectList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -152,10 +152,10 @@
</view>
<view class='list_input_box'>
<view class='list_input'>
<input type='text' placeholder='请填写' name='beneficiary' value='{{listdetail.favoree}}'></input>
<input type='number' placeholder='请填写' name='year_money' value='{{year_money}}'></input>
</view>
<view class='list_input'>
<input class='income_input' type='text' placeholder='请填写' name='beneficiary' value='元/年' disabled='true'></input>
<input class='income_input' type='text' placeholder='请填写' value='元/年' disabled='true'></input>
</view>
</view>
</view>
... ... @@ -183,12 +183,12 @@
<view class='list_title'>保障期</view>
<view class='list_input_box'>
<view class='list_input'>
<input type='text' placeholder='请输入' name='beneficiary' value='{{listdetail.favoree}}'></input>
<input type='text' placeholder='请输入' name='beneficiary' value='{{listdetail.favoree}}' bindinput='warrantyTwo'></input>
</view>
<view class='list_label_box'>
<view class="list_label_item {{unit==1?'list_label_active':''}}" bindtap='selectUnit' data-unit='1'>年</view>
<view class="list_label_item {{unit==2?'list_label_active':''}}" bindtap='selectUnit' data-unit='2'>岁 </view>
<view class="list_label_item {{unit==3?'list_label_active':''}}" bindtap='selectUnit' data-unit='3'>终身</view>
<view class="list_label_item {{unit=='年'?'list_label_active':''}}" bindtap='selectUnit' data-unit='年'>年</view>
<view class="list_label_item {{unit=='岁'?'list_label_active':''}}" bindtap='selectUnit' data-unit='岁'>岁 </view>
<view class="list_label_item {{unit=='终身'?'list_label_active':''}}" bindtap='selectUnit' data-unit='终身'>终身</view>
</view>
</view>
</view>
... ... @@ -196,21 +196,21 @@
<view class='list_title'>缴费时长</view>
<view class='list_input_box'>
<view class='list_input'>
<input type='text' placeholder='请输入' name='beneficiary' value='{{listdetail.favoree}}'></input>
<input type='text' placeholder='请输入' name='beneficiary' value='{{}}' bindinput='burningTime'></input>
</view>
<view class='list_label_box'>
<view class="list_label_item {{unit2==4?'list_label_active':''}}" bindtap='selectUnit2' data-unit='4'>年</view>
<view class="list_label_item {{unit2==5?'list_label_active':''}}" bindtap='selectUnit2' data-unit='5'>岁 </view>
<view class="list_label_item {{unit2==6?'list_label_active':''}}" bindtap='selectUnit2' data-unit='6'>终身</view>
<view class="list_label_item {{unit2=='年'?'list_label_active':''}}" bindtap='selectUnit2' data-unit='年'>年</view>
<view class="list_label_item {{unit2=='岁'?'list_label_active':''}}" bindtap='selectUnit2' data-unit='岁'>岁 </view>
<view class="list_label_item {{unit2=='终身'?'list_label_active':''}}" bindtap='selectUnit2' data-unit='终身'>终身</view>
</view>
</view>
</view>
<view class='item_list'>
<view class='list_title'>缴费方式</view>
<view class='list_label_box'>
<view class="list_label_item {{unit3==7?'list_label_active':''}}" bindtap='selectUnit3' data-unit='7'>年交</view>
<view class="list_label_item {{unit3==8?'list_label_active':''}}" bindtap='selectUnit3' data-unit='8'>趸交(一次付清)</view>
<view class="list_label_item {{unit3==9?'list_label_active':''}}" bindtap='selectUnit3' data-unit='9'>年交</view>
<view class="list_label_item {{unit3=='年交'?'list_label_active':''}}" bindtap='selectUnit3' data-unit='年交'>年交</view>
<view class="list_label_item {{unit3=='趸交'?'list_label_active':''}}" bindtap='selectUnit3' data-unit='趸交'>趸交(一次付清)</view>
<view class="list_label_item {{unit3=='月交'?'list_label_active':''}}" bindtap='selectUnit3' data-unit='月交'>月交</view>
</view>
</view>
<view class='item_list'>
... ... @@ -222,7 +222,7 @@
</block>
<block wx:else> -->
<view class='list_input'>
<input type='text' placeholder='请填写' name='Renew_bank' value='{{nullNum}}'></input>
<input type='text' placeholder='请填写' name='bank' value='{{bank}}'></input>
</view>
<!-- </block> -->
</view>
... ... @@ -235,7 +235,7 @@
</block>
<block wx:else> -->
<view class='list_input'>
<input type='text' placeholder='请填写' name='renew_num' value='{{nullNum}}'></input>
<input type='text' placeholder='请填写' name='bank_num' value='{{bank_num}}'></input>
</view>
<!-- </block> -->
</view>
... ... @@ -251,11 +251,14 @@
</view>
</block>
<block wx:else> -->
<view class='list_input'>
<!-- <view class='list_input'>
<picker class='picker' mode="date" bindchange='impletionTime' value='{{impletion_time}}'>
<input placeholder='请选择' value='{{impletion_time}}' disabled='true'></input>
</picker>
<text class='iconfont icon-riqi'></text>
</view> -->
<view class='list_input'>
<input type='text' placeholder='自动计算' name='impletion_time' value='{{impletion_time}}'></input>
</view>
<!-- </block> -->
</view>
... ... @@ -270,7 +273,7 @@
<block wx:else> -->
<view class='list_input'>
<picker class='picker' range='{{period_time}}' value='{{period_index}}' bindchange='periodTime'>
<input placeholder='请选择' value='{{period_time[period_index]}}' disabled='true'></input>
<input placeholder='自动计算' value='{{period_time[period_index]}}' disabled='true'></input>
</picker>
<!-- <text class='iconfont icon-riqi'></text> -->
</view>
... ...
... ... @@ -13,7 +13,7 @@
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wxac365079a43a66bb",
"projectname": "%E5%AE%B6%E5%BA%AD%E4%BF%9D%E9%99%A9",
"projectname": "%E5%AE%B6%E5%BA%AD%E4%BF%9D%E9%99%A92",
"debugOptions": {
"hidedInDevtools": []
},
... ...