正在显示
1 个修改的文件
包含
18 行增加
和
2 行删除
| ... | ... | @@ -3,6 +3,7 @@ var app = getApp(); |
| 3 | 3 | var baseUrl = app.globalData.baseUrl; |
| 4 | 4 | const reg_18_Number = /^[0-9]{18}$/; |
| 5 | 5 | const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; |
| 6 | +const reg_15_n_a = /^([a-zA-z]|[0-9]){15}$/; | |
| 6 | 7 | // var countryInfo = require('../../../../utils/country.js'); |
| 7 | 8 | const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| 8 | 9 | // const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| ... | ... | @@ -1120,7 +1121,10 @@ Page({ |
| 1120 | 1121 | this.showtoast('证照号码有误'); |
| 1121 | 1122 | return |
| 1122 | 1123 | } |
| 1123 | - | |
| 1124 | + if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(idCardNo)) { | |
| 1125 | + this.showtoast('证照号码有误'); | |
| 1126 | + return | |
| 1127 | + } | |
| 1124 | 1128 | }, |
| 1125 | 1129 | bindinputcardnum: function(e) { |
| 1126 | 1130 | var idCardNo = e.detail.value |
| ... | ... | @@ -1147,6 +1151,12 @@ Page({ |
| 1147 | 1151 | return |
| 1148 | 1152 | } |
| 1149 | 1153 | } |
| 1154 | + if (e.detail.value.length == 15) { | |
| 1155 | + if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(idCardNo)) { | |
| 1156 | + this.showtoast('证照号码有误'); | |
| 1157 | + return | |
| 1158 | + } | |
| 1159 | + } | |
| 1150 | 1160 | }, |
| 1151 | 1161 | //根据身份证号码,获取相关信息 |
| 1152 | 1162 | dealIdInfo: function (idCardNum) { |
| ... | ... | @@ -1206,6 +1216,9 @@ Page({ |
| 1206 | 1216 | } else if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(this.data.card_number)) { |
| 1207 | 1217 | this.showtoast('证照号码有误'); |
| 1208 | 1218 | return |
| 1219 | + } else if (this.data.cardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(this.data.card_number)) { | |
| 1220 | + this.showtoast('证照号码有误'); | |
| 1221 | + return | |
| 1209 | 1222 | } else if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(this.data.card_number)) { |
| 1210 | 1223 | this.showtoast('证照号码有误'); |
| 1211 | 1224 | return |
| ... | ... | @@ -1258,7 +1271,10 @@ Page({ |
| 1258 | 1271 | } else if (this.data.otherCardtypeData.selected.indexOf('护照') > -1 && !reg_9_n_a.test(formdata.other_card_number)) { |
| 1259 | 1272 | this.showtoast('其他证照号码有误'); |
| 1260 | 1273 | return |
| 1261 | - } | |
| 1274 | + } else if (this.data.otherCardtypeData.selected.indexOf('永久居留') > -1 && !reg_15_n_a.test(formdata.other_card_number)) { | |
| 1275 | + this.showtoast('证照号码有误'); | |
| 1276 | + return | |
| 1277 | + } | |
| 1262 | 1278 | if (this.data.hasOtherCard && !this.data.birthCountryData.selected) { |
| 1263 | 1279 | this.showtoast('请选择出生国家'); |
| 1264 | 1280 | return | ... | ... |
请
注册
或
登录
后发表评论