提交 4f070f36b038d371fbde9ab5cd857cf9aaf953a9

作者 pangy
1 个父辈 f03c1edd

是否有配偶 逻辑

@@ -34,6 +34,7 @@ Page({ @@ -34,6 +34,7 @@ Page({
34 legal_entity_id: "", 34 legal_entity_id: "",
35 legal_entity: "", 35 legal_entity: "",
36 data: { 36 data: {
  37 + hasLover:false,
37 house_type: "", 38 house_type: "",
38 deduction_amount: '', 39 deduction_amount: '',
39 lable: 0, 40 lable: 0,
@@ -44,6 +45,17 @@ Page({ @@ -44,6 +45,17 @@ Page({
44 rentAddress_haschanged: false, 45 rentAddress_haschanged: false,
45 extrainfo_arr: ["请上传子女出生证明、学籍信息凭证、学费凭证、本人结婚证和分摊协议", "请上传学历学籍凭证", "请上传出生证明或关系证明、独生子女证、分摊协议、其他法定赡养人赡养证明", "请上传诊断书和医疗费用收据", "请上传首套房证明、还款证明、不动产登记证、结婚证和夫妻约定抵扣协议"], 46 extrainfo_arr: ["请上传子女出生证明、学籍信息凭证、学费凭证、本人结婚证和分摊协议", "请上传学历学籍凭证", "请上传出生证明或关系证明、独生子女证、分摊协议、其他法定赡养人赡养证明", "请上传诊断书和医疗费用收据", "请上传首套房证明、还款证明、不动产登记证、结婚证和夫妻约定抵扣协议"],
46 cur_index: '', 47 cur_index: '',
  48 +
  49 + hasLoverData: {
  50 + label: '是否有配偶',
  51 + isrequre: true,
  52 + bindtype: 'hasLover',
  53 + selected: '',
  54 + isblack: 'true',
  55 + placeholder: '请选择',
  56 + values: ['是', '否'],
  57 + onChange: 'onPickerSelect'
  58 + },
47 lovercardtypeData: { 59 lovercardtypeData: {
48 label: '配偶证照类型', 60 label: '配偶证照类型',
49 bindtype: 'lovercardtype', 61 bindtype: 'lovercardtype',
@@ -982,8 +994,12 @@ Page({ @@ -982,8 +994,12 @@ Page({
982 this.showToast('请选择就读学校') 994 this.showToast('请选择就读学校')
983 return 995 return
984 } 996 }
  997 + if (this.data.hasLoverData.selected.length < 1) {
  998 + this.showToast('请选择是否有配偶')
  999 + return
  1000 + }
985 1001
986 - if (formdata.spouse_name || formdata.spouse_id_card_no || this.data.loverbirthDate.selected) { 1002 + if (this.data.hasLover) {
987 if (!formdata.spouse_name || formdata.spouse_name.length < 1) { 1003 if (!formdata.spouse_name || formdata.spouse_name.length < 1) {
988 this.showToast('请填写配偶姓名') 1004 this.showToast('请填写配偶姓名')
989 return 1005 return
@@ -1249,7 +1265,11 @@ Page({ @@ -1249,7 +1265,11 @@ Page({
1249 console.log('request_working_address', request_working_address) 1265 console.log('request_working_address', request_working_address)
1250 newdata.nation = "中国" 1266 newdata.nation = "中国"
1251 } 1267 }
1252 - if (formdata.spouse_name || formdata.spouse_id_card_no || this.data.loverbirthDate.selected) { 1268 + if (this.data.hasLoverData.selected.length < 1) {
  1269 + this.showToast('请选择是否有配偶')
  1270 + return
  1271 + }
  1272 + if (this.data.hasLover) {
1253 if (!formdata.spouse_name || formdata.spouse_name.length < 1) { 1273 if (!formdata.spouse_name || formdata.spouse_name.length < 1) {
1254 this.showToast('请填写配偶姓名') 1274 this.showToast('请填写配偶姓名')
1255 return 1275 return
@@ -1396,6 +1416,15 @@ Page({ @@ -1396,6 +1416,15 @@ Page({
1396 onPickerSelect: function(e) { 1416 onPickerSelect: function(e) {
1397 console.log('picker发送选择改变,携带值为', e) 1417 console.log('picker发送选择改变,携带值为', e)
1398 switch (e.currentTarget.id) { 1418 switch (e.currentTarget.id) {
  1419 + case 'hasLover':
  1420 + var hasLoverData = this.data.hasLoverData
  1421 + hasLoverData.selected = hasLoverData.values[e.detail.value]
  1422 + var hasLover = e.detail.value == '0'
  1423 + this.setData({
  1424 + hasLoverData: hasLoverData,
  1425 + hasLover: hasLover
  1426 + })
  1427 + break;
1399 case 'lovercardtype': 1428 case 'lovercardtype':
1400 var lover_cardtypeData = this.data.lovercardtypeData 1429 var lover_cardtypeData = this.data.lovercardtypeData
1401 lover_cardtypeData.selected = lover_cardtypeData.values[e.detail.value] 1430 lover_cardtypeData.selected = lover_cardtypeData.values[e.detail.value]
@@ -313,12 +313,15 @@ @@ -313,12 +313,15 @@
313 <view style='padding:0 30rpx;'> 313 <view style='padding:0 30rpx;'>
314 314
315 <view wx:if="{{cur_index=='children_education' || cur_index=='house_fund'}}"> 315 <view wx:if="{{cur_index=='children_education' || cur_index=='house_fund'}}">
  316 + <template is="picker_cell_normal" data="{{...hasLoverData}}" />
  317 + <view class='divide_line_f5f5f5'></view>
  318 + </view>
  319 + <view wx:if="{{hasLover}}">
316 <view style='height:90rpx'> 320 <view style='height:90rpx'>
317 <text class='text_black_30 float_left'>配偶姓名</text> 321 <text class='text_black_30 float_left'>配偶姓名</text>
318 <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}'></input> 322 <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}'></input>
319 </view> 323 </view>
320 <view class='divide_line_f5f5f5'></view> 324 <view class='divide_line_f5f5f5'></view>
321 -  
322 <template is="picker_cell_normal" data="{{...lovercardtypeData}}" /> 325 <template is="picker_cell_normal" data="{{...lovercardtypeData}}" />
323 <view class='divide_line_f5f5f5'></view> 326 <view class='divide_line_f5f5f5'></view>
324 <view style='height:90rpx'> 327 <view style='height:90rpx'>
注册登录 后发表评论