正在显示
1 个修改的文件
包含
60 行增加
和
20 行删除
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | var app = getApp(); | 2 | var app = getApp(); |
3 | var format = require('../../../../utils/util.js'); | 3 | var format = require('../../../../utils/util.js'); |
4 | var baseUrl = app.globalData.baseUrl; | 4 | var baseUrl = app.globalData.baseUrl; |
5 | -const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | ||
6 | - | 5 | +// const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
6 | +const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | ||
7 | Page({ | 7 | Page({ |
8 | cur_id:null, | 8 | cur_id:null, |
9 | /** | 9 | /** |
@@ -41,7 +41,7 @@ Page({ | @@ -41,7 +41,7 @@ Page({ | ||
41 | label: '证照类型', | 41 | label: '证照类型', |
42 | bindtype: 'cardtype', | 42 | bindtype: 'cardtype', |
43 | placeholder: '请选择证照类型', | 43 | placeholder: '请选择证照类型', |
44 | - values: cardTypeArray8, | 44 | + values: cardTypeArray, |
45 | // values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照','外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'], | 45 | // values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照','外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'], |
46 | // range_key: 'name', | 46 | // range_key: 'name', |
47 | onChange: 'onPickerSelect' | 47 | onChange: 'onPickerSelect' |
@@ -76,6 +76,17 @@ Page({ | @@ -76,6 +76,17 @@ Page({ | ||
76 | placeholder: '请选择国籍', | 76 | placeholder: '请选择国籍', |
77 | onChange: 'onPickerSelect', | 77 | onChange: 'onPickerSelect', |
78 | }, | 78 | }, |
79 | + birthDate: { | ||
80 | + label: '出生日期', | ||
81 | + isrequre: true, | ||
82 | + bindtype: 'birthday', | ||
83 | + placeholder: '出生日期', | ||
84 | + selected: '', | ||
85 | + mode: "date", | ||
86 | + fields: "day", | ||
87 | + end: format.curDateTime(), | ||
88 | + onChange: 'birthdayChange', | ||
89 | + }, | ||
79 | }, | 90 | }, |
80 | 91 | ||
81 | /** | 92 | /** |
@@ -118,7 +129,7 @@ Page({ | @@ -118,7 +129,7 @@ Page({ | ||
118 | countrys.splice(countrys.indexOf('澳门'), 1); | 129 | countrys.splice(countrys.indexOf('澳门'), 1); |
119 | } | 130 | } |
120 | that.countrys = countrys | 131 | that.countrys = countrys |
121 | - if (that.data.cardtypeData.selected && that.data.cardtypeData.selected.indexOf("外国人") != -1) { | 132 | + if (that.data.cardtypeData.selected && that.data.cardtypeData.selected.indexOf("外国") != -1) { |
122 | that.data.countryData.values = countrys | 133 | that.data.countryData.values = countrys |
123 | that.setData({ | 134 | that.setData({ |
124 | countryData: that.data.countryData, | 135 | countryData: that.data.countryData, |
@@ -174,14 +185,24 @@ Page({ | @@ -174,14 +185,24 @@ Page({ | ||
174 | this.data.relativeData.selected = tax_info.family_ties | 185 | this.data.relativeData.selected = tax_info.family_ties |
175 | this.data.genderData.selected = tax_info.gender | 186 | this.data.genderData.selected = tax_info.gender |
176 | this.data.countryData.selected = tax_info.native | 187 | this.data.countryData.selected = tax_info.native |
177 | - // this.data.genderData.disabled = isDisable | 188 | + if (isDisable){//否的话受证照类型控制 |
189 | + this.data.birthDate.disabled = true | ||
190 | + this.data.genderData.disabled = true | ||
191 | + } | ||
178 | this.data.forignerInfo.selected = tax_info.is_overseas_personnel | 192 | this.data.forignerInfo.selected = tax_info.is_overseas_personnel |
193 | + if (tax_info.birth_date == -62135596800 || tax_info.birth_date == 0) { | ||
194 | + this.data.birthDate.selected = '' | ||
195 | + } else { | ||
196 | + this.data.birthDate.selected = tax_info.birth_date_str //format.formatTime_date(tax_info.birth_date) | ||
197 | + } | ||
179 | this.setData({ | 198 | this.setData({ |
180 | isDisable: isDisable, | 199 | isDisable: isDisable, |
181 | relativeData: this.data.relativeData, | 200 | relativeData: this.data.relativeData, |
182 | name: tax_info.name, | 201 | name: tax_info.name, |
183 | cardtypeData: this.data.cardtypeData, | 202 | cardtypeData: this.data.cardtypeData, |
184 | - age: tax_info.age, | 203 | + // age: tax_info.age, |
204 | + long_birth_date: tax_info.birth_date, | ||
205 | + birthDate: this.data.birthDate, | ||
185 | mobile: tax_info.mobile, | 206 | mobile: tax_info.mobile, |
186 | genderData: this.data.genderData, | 207 | genderData: this.data.genderData, |
187 | isIdCard: '居民身份证' == tax_info.id_card_type ? true : false, | 208 | isIdCard: '居民身份证' == tax_info.id_card_type ? true : false, |
@@ -227,7 +248,7 @@ Page({ | @@ -227,7 +248,7 @@ Page({ | ||
227 | var gender_Data = that.data.genderData | 248 | var gender_Data = that.data.genderData |
228 | gender_Data.selected = id_info.gender | 249 | gender_Data.selected = id_info.gender |
229 | 250 | ||
230 | - // that.data.birthDate.selected = birth_day | 251 | + that.data.birthDate.selected = birth_day |
231 | 252 | ||
232 | // if (that.data.name.length > 0 && id_info.name != that.data.name) { | 253 | // if (that.data.name.length > 0 && id_info.name != that.data.name) { |
233 | // that.showtoast("姓名冲突") | 254 | // that.showtoast("姓名冲突") |
@@ -240,11 +261,11 @@ Page({ | @@ -240,11 +261,11 @@ Page({ | ||
240 | that.setData({ | 261 | that.setData({ |
241 | idInfoData: id_info, | 262 | idInfoData: id_info, |
242 | name: id_info.name, | 263 | name: id_info.name, |
243 | - // birthday: birth_day, | 264 | + birthday: birth_day, |
244 | cardtypeData: cardtype_Data, | 265 | cardtypeData: cardtype_Data, |
245 | genderData: gender_Data, | 266 | genderData: gender_Data, |
246 | - // long_birth_date: Date.parse(new Date(birth_day)) / 1000, | ||
247 | - // birthDate: that.data.birthDate, | 267 | + long_birth_date: Date.parse(new Date(birth_day)) / 1000, |
268 | + birthDate: that.data.birthDate, | ||
248 | card_number: id_info.id_card_number | 269 | card_number: id_info.id_card_number |
249 | }) | 270 | }) |
250 | that.dealIdInfo(id_info.id_card_number) | 271 | that.dealIdInfo(id_info.id_card_number) |
@@ -266,9 +287,11 @@ Page({ | @@ -266,9 +287,11 @@ Page({ | ||
266 | if ('居民身份证' == new_type) { | 287 | if ('居民身份证' == new_type) { |
267 | is_idcard = true | 288 | is_idcard = true |
268 | this.data.genderData.disabled = true | 289 | this.data.genderData.disabled = true |
290 | + this.data.birthDate.disabled = true | ||
269 | } else { | 291 | } else { |
270 | is_idcard = false | 292 | is_idcard = false |
271 | this.data.genderData.disabled = false | 293 | this.data.genderData.disabled = false |
294 | + this.data.birthDate.disabled = false | ||
272 | } | 295 | } |
273 | this.data.forignerInfo.selected = '是' | 296 | this.data.forignerInfo.selected = '是' |
274 | if ('居民身份证' == new_type || '中国护照' == new_type) { | 297 | if ('居民身份证' == new_type || '中国护照' == new_type) { |
@@ -289,6 +312,7 @@ Page({ | @@ -289,6 +312,7 @@ Page({ | ||
289 | } | 312 | } |
290 | this.setData({ | 313 | this.setData({ |
291 | isIdCard: is_idcard, | 314 | isIdCard: is_idcard, |
315 | + birthDate: this.data.birthDate, | ||
292 | genderData: this.data.genderData, | 316 | genderData: this.data.genderData, |
293 | countryData: this.data.countryData, | 317 | countryData: this.data.countryData, |
294 | cardtypeData: this.data.cardtypeData, | 318 | cardtypeData: this.data.cardtypeData, |
@@ -298,7 +322,15 @@ Page({ | @@ -298,7 +322,15 @@ Page({ | ||
298 | 322 | ||
299 | }, | 323 | }, |
300 | 324 | ||
301 | - | 325 | + birthdayChange: function (e) { |
326 | + var birth_date = this.data.birthDate; | ||
327 | + birth_date.selected = e.detail.value | ||
328 | + console.log('birthdayChange', Date.parse(new Date(e.detail.value))) | ||
329 | + this.setData({ | ||
330 | + long_birth_date: Date.parse(new Date(e.detail.value)) / 1000, | ||
331 | + birthDate: birth_date | ||
332 | + }) | ||
333 | + }, | ||
302 | // =============普通单列picker选中处理============== | 334 | // =============普通单列picker选中处理============== |
303 | onPickerSelect: function(e) { | 335 | onPickerSelect: function(e) { |
304 | console.log('picker发送选择改变,携带值为', e) | 336 | console.log('picker发送选择改变,携带值为', e) |
@@ -414,18 +446,23 @@ Page({ | @@ -414,18 +446,23 @@ Page({ | ||
414 | return | 446 | return |
415 | } | 447 | } |
416 | } | 448 | } |
417 | - if (!formdata.age) { | ||
418 | - this.showtoast('请填写年龄'); | 449 | + // if (!formdata.age) { |
450 | + // this.showtoast('请填写年龄'); | ||
451 | + // return | ||
452 | + // } | ||
453 | + if (this.data.birthDate.selected.length < 1) { | ||
454 | + this.showtoast('请选择出生日期'); | ||
419 | return | 455 | return |
420 | } else { | 456 | } else { |
457 | + var age = format.getAge(this.data.birthDate.selected) | ||
421 | var host_birth = format.formatTime_date(app.globalData.hostInfo.birth_date) | 458 | var host_birth = format.formatTime_date(app.globalData.hostInfo.birth_date) |
422 | var host_age = format.getAge(host_birth) | 459 | var host_age = format.getAge(host_birth) |
423 | console.log('host_age',host_age,'hostInfo', app.globalData.hostInfo) | 460 | console.log('host_age',host_age,'hostInfo', app.globalData.hostInfo) |
424 | - if ((rel == '子' || rel == '女') && formdata.age > host_age) { | 461 | + if ((rel == '子' || rel == '女') && age > host_age) { |
425 | this.showtoast('子女年龄有误'); | 462 | this.showtoast('子女年龄有误'); |
426 | return | 463 | return |
427 | } | 464 | } |
428 | - if (rel == '父母' && formdata.age < host_age) { | 465 | + if (rel == '父母' && age < host_age) { |
429 | this.showtoast('父母年龄有误'); | 466 | this.showtoast('父母年龄有误'); |
430 | return | 467 | return |
431 | } | 468 | } |
@@ -462,8 +499,8 @@ Page({ | @@ -462,8 +499,8 @@ Page({ | ||
462 | "name": name, | 499 | "name": name, |
463 | "gender": that.data.genderData.selected, | 500 | "gender": that.data.genderData.selected, |
464 | "mobile": formdata.mobile, | 501 | "mobile": formdata.mobile, |
465 | - //"age": formdata.age ? formdata.age : '',//不传 | ||
466 | - "age": formdata.age ? formdata.age : '', | 502 | + // "age": formdata.age ? formdata.age : '', |
503 | + "birth_date": that.data.long_birth_date, | ||
467 | "native": that.data.countryData.selected, | 504 | "native": that.data.countryData.selected, |
468 | "is_overseas_personnel": that.data.forignerInfo.selected, | 505 | "is_overseas_personnel": that.data.forignerInfo.selected, |
469 | }, | 506 | }, |
@@ -499,8 +536,8 @@ Page({ | @@ -499,8 +536,8 @@ Page({ | ||
499 | var cardtype = this.data.cardtypeData.selected; | 536 | var cardtype = this.data.cardtypeData.selected; |
500 | var card_no = formdata.id_card_no ? formdata.id_card_no : this.data.card_number; | 537 | var card_no = formdata.id_card_no ? formdata.id_card_no : this.data.card_number; |
501 | var gender = this.data.genderData.selected; | 538 | var gender = this.data.genderData.selected; |
502 | - //var birth_day = this.data.birthDate.selected; | ||
503 | - if (name == iddata.name && cardtype == '居民身份证' && card_no == iddata.id_card_number && gender == iddata.gender ){// && birth_day == this.data.birthday) { | 539 | + var birth_day = this.data.birthDate.selected; |
540 | + if (name == iddata.name && cardtype == '居民身份证' && card_no == iddata.id_card_number && gender == iddata.gender && birth_day == this.data.birthday) { | ||
504 | return 'active' | 541 | return 'active' |
505 | } else { | 542 | } else { |
506 | return '' | 543 | return '' |
@@ -520,8 +557,11 @@ Page({ | @@ -520,8 +557,11 @@ Page({ | ||
520 | var info = format.analyzeIDCard(idCardNum) | 557 | var info = format.analyzeIDCard(idCardNum) |
521 | console.log('info', info.age, info.sex) | 558 | console.log('info', info.age, info.sex) |
522 | if (info.age) { | 559 | if (info.age) { |
560 | + this.data.birthDate.selected = info.birthDay | ||
523 | this.setData({ | 561 | this.setData({ |
524 | - age: info.age | 562 | + age: info.age, |
563 | + long_birth_date: Date.parse(new Date(info.birthDay)) / 1000, | ||
564 | + birthDate: this.data.birthDate | ||
525 | }) | 565 | }) |
526 | } | 566 | } |
527 | if (info.sex) { | 567 | if (info.sex) { |
请
注册
或
登录
后发表评论