提交 6e7986137630d297347886626ac4a90d76ea38c1

作者 pangy
1 个父辈 36876cfd

关系与年龄

@@ -277,6 +277,16 @@ Page({ @@ -277,6 +277,16 @@ Page({
277 this.showtoast('证照号码有误'); 277 this.showtoast('证照号码有误');
278 return 278 return
279 } 279 }
  280 + var rel = this.data.relativeData.selected
  281 + var hostInfo = format.analyzeIDCard(app.globalData.hostInfo.id_card_no)
  282 + if ((rel == '子' || rel =='女') && formdata.age > hostInfo.age) {
  283 + this.showtoast('子女年龄有误');
  284 + return
  285 + }
  286 + if (rel == '父母' && formdata.age < hostInfo.age) {
  287 + this.showtoast('父母年龄有误');
  288 + return
  289 + }
280 var name = formdata.person_name.length ? formdata.person_name : this.data.name 290 var name = formdata.person_name.length ? formdata.person_name : this.data.name
281 if (name.length < 1 ) { 291 if (name.length < 1 ) {
282 this.showtoast('姓名未填写'); 292 this.showtoast('姓名未填写');
@@ -290,19 +300,17 @@ Page({ @@ -290,19 +300,17 @@ Page({
290 return 300 return
291 } 301 }
292 if (this.data.genderData.selected == '男') { 302 if (this.data.genderData.selected == '男') {
293 - var rel = this.data.relativeData.selected  
294 if (rel == '女'){ 303 if (rel == '女'){
295 this.showtoast('关系和性别冲突'); 304 this.showtoast('关系和性别冲突');
296 return 305 return
297 } 306 }
298 }else{ 307 }else{
299 - var rel = this.data.relativeData.selected  
300 if (rel == '子') { 308 if (rel == '子') {
301 this.showtoast('关系和性别冲突'); 309 this.showtoast('关系和性别冲突');
302 return 310 return
303 } 311 }
304 - }  
305 - if (this.data.genderData.selected == app.globalData.hostInfo.gender) { 312 + }
  313 + if (rel == '配偶' && this.data.genderData.selected == app.globalData.hostInfo.gender) {
306 this.showtoast('关系和性别冲突'); 314 this.showtoast('关系和性别冲突');
307 return 315 return
308 } 316 }
注册登录 后发表评论