diff --git a/src/views/ebiz/sale/js/verification.js b/src/views/ebiz/sale/js/verification.js index 5b9cde5de..ed059ab9a 100644 --- a/src/views/ebiz/sale/js/verification.js +++ b/src/views/ebiz/sale/js/verification.js @@ -52,16 +52,16 @@ function getBirthById(idNo) { } function getSexById(idNo) { - if(idNo.length == 15){ - // 获取性别 - if (idNo.charAt(13) >= '0' && idNo.charAt(13) <= '9') { - if (parseInt(idNo.charAt(13)) % 2 == 0) { - return '1' - } else { - return '0' - } - } - } + // if(idNo.length == 15){ + // // 获取性别 + // if (idNo.charAt(13) >= '0' && idNo.charAt(13) <= '9') { + // if (parseInt(idNo.charAt(13)) % 2 == 0) { + // return '1' + // } else { + // return '0' + // } + // } + // } if(idNo.length == 18) { // 获取性别 if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') { @@ -109,19 +109,19 @@ export function idNoCheck8(userInfo,type) { } } } - if(userInfo.idNo.length == 15) { - // 获取生日 - let year = '19' + userInfo.idNo.substr(7, 2) - let month = userInfo.idNo.substr(9, 2) - let day = userInfo.idNo.substr(11, 2) - let thisBirthday = year + '-' + month + '-' + day - if(thisBirthday != userInfo.birthday) { - console.log('12321321321',thisBirthday) - return { - text: '出生日期必须与证件号码中的生日一致' - } - } - } + // if(userInfo.idNo.length == 15) { + // // 获取生日 + // let year = '19' + userInfo.idNo.substr(7, 2) + // let month = userInfo.idNo.substr(9, 2) + // let day = userInfo.idNo.substr(11, 2) + // let thisBirthday = year + '-' + month + '-' + day + // if(thisBirthday != userInfo.birthday) { + // console.log('12321321321',thisBirthday) + // return { + // text: '出生日期必须与证件号码中的生日一致' + // } + // } + // } if(userInfo.idNo.length == 18) { // 获取生日 let year = userInfo.idNo.substr(6, 4) @@ -134,14 +134,15 @@ export function idNoCheck8(userInfo,type) { } } } - let thisSex = getSexById(userInfo.idNo) - if(thisSex != userInfo.sex) { - console.log('sexxxxxx',thisSex) - console.log('sexxxxxx',userInfo.sex) - return { - text: '性别必须与证件号码中的一致' + if(userInfo.idNo.length == 18){ + let thisSex = getSexById(userInfo.idNo) + if(thisSex != userInfo.sex) { + return { + text: '性别必须与证件号码中的一致' + } } } + if (userInfo.nativeplace == '1' || userInfo.nativeplace == '2' || userInfo.nativeplace == '3' || userInfo.nativeplace == '4') { return { text: '外国人永久居留身份证不能选择中国国籍'