正在显示
4 个修改的文件
包含
34 行增加
和
12 行删除
| ... | ... | @@ -231,7 +231,12 @@ Page({ |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | }, |
| 234 | - | |
| 234 | + bindinputmobile: function (e) { | |
| 235 | + console.log('bindinputmobile', e) | |
| 236 | + this.setData({ | |
| 237 | + mobile: e.detail.value | |
| 238 | + }) | |
| 239 | + }, | |
| 235 | 240 | |
| 236 | 241 | // =============其他数据选中处理============== |
| 237 | 242 | |
| ... | ... | @@ -271,6 +276,10 @@ Page({ |
| 271 | 276 | this.showtoast('请输入正确姓名'); |
| 272 | 277 | return |
| 273 | 278 | } |
| 279 | + if (formdata.mobile.length > 0 && !format.isMobile(formdata.mobile)) { | |
| 280 | + this.showtoast('手机号码有误'); | |
| 281 | + return | |
| 282 | + } | |
| 274 | 283 | var new_card_num = '' |
| 275 | 284 | if (this.data.isIdCard) { |
| 276 | 285 | if (this.data.card_number.length > 0) { |
| ... | ... | @@ -313,6 +322,7 @@ Page({ |
| 313 | 322 | "id_card_no": formdata.id_card_no ? formdata.id_card_no : that.data.card_number, |
| 314 | 323 | "name": formdata.name, |
| 315 | 324 | "gender": that.data.genderData.selected, |
| 325 | + "mobile": formdata.mobile, | |
| 316 | 326 | //"age": formdata.age ? formdata.age : '',//不传 |
| 317 | 327 | "native": "中国", |
| 318 | 328 | "is_overseas_personnel": "否", | ... | ... |
| ... | ... | @@ -53,7 +53,11 @@ |
| 53 | 53 | <text class='text_777_30 float_left' style='line-height: 90rpx'>国籍</text> |
| 54 | 54 | <text class='text_black_30 float_right' style='line-height: 90rpx' >中国</text> |
| 55 | 55 | </view> |
| 56 | - | |
| 56 | + <view class="divide_line_30"></view> | |
| 57 | + <view class='item_body'> | |
| 58 | + <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>手机号码</text> | |
| 59 | + <input class='input_wrap float_right' placeholder="请输入手机号" value='{{mobile}}' name='mobile' type='number' maxlength='11' bindblur='bindinputmobile' type='number'></input> | |
| 60 | + </view> | |
| 57 | 61 | <view class="divide_line_30"></view> |
| 58 | 62 | <view class='item_body'> |
| 59 | 63 | <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>是否境外人员</text> | ... | ... |
| ... | ... | @@ -868,10 +868,16 @@ Page({ |
| 868 | 868 | // else if (this.data.mobile.length < 1) { |
| 869 | 869 | // this.showtoast('有必填项未填写'); |
| 870 | 870 | // return |
| 871 | - // } else if (this.data.mobile.length > 0 && !regMobile.test(this.data.mobile)) { | |
| 872 | - // this.showtoast('手机号码有误'); | |
| 873 | - // return | |
| 874 | - // } else if (this.data.investInfo.selected.length < 1) { | |
| 871 | + // } else | |
| 872 | + if (this.data.mobile.length > 0 && !regMobile.test(this.data.mobile)) { | |
| 873 | + this.showtoast('手机号码有误'); | |
| 874 | + return | |
| 875 | + } | |
| 876 | + if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)) { | |
| 877 | + this.showtoast('请输入正确邮箱'); | |
| 878 | + return | |
| 879 | + } | |
| 880 | + //else if (this.data.investInfo.selected.length < 1) { | |
| 875 | 881 | // this.showtoast('有必填项未填写'); |
| 876 | 882 | // return |
| 877 | 883 | // } else if (this.data.specificIndustryInfo.selected.length < 1) { |
| ... | ... | @@ -880,11 +886,8 @@ Page({ |
| 880 | 886 | // } else if (this.data.employeeInfo.selected.length < 1) { |
| 881 | 887 | // this.showtoast('有必填项未填写'); |
| 882 | 888 | // return |
| 883 | - // } | |
| 884 | - // else if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)) { | |
| 885 | - // this.showtoast('请输入正确邮箱'); | |
| 886 | - // return | |
| 887 | - // } | |
| 889 | + // } else | |
| 890 | + | |
| 888 | 891 | // else if (this.data.company_equity_total && this.data.company_equity_total.length > 0 && !regMoney.test(this.data.company_equity_total)) { |
| 889 | 892 | // this.showtoast('请输入正确金额'); |
| 890 | 893 | // return | ... | ... |
| ... | ... | @@ -135,6 +135,10 @@ function analyzeIDCard(IDCard){ |
| 135 | 135 | //返回性别和年龄 |
| 136 | 136 | return sexAndAge; |
| 137 | 137 | } |
| 138 | +function isMobile(mobile) { | |
| 139 | + var regMobile = /^(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/; | |
| 140 | + return regMobile.test(mobile) | |
| 141 | +} | |
| 138 | 142 | |
| 139 | 143 | module.exports = { |
| 140 | 144 | formatTime: formatTime, |
| ... | ... | @@ -146,5 +150,6 @@ module.exports = { |
| 146 | 150 | dayFormString: dayFormString, |
| 147 | 151 | isIDCardNum: isIDCardNum, |
| 148 | 152 | curDateTime: curDateTime, |
| 149 | - analyzeIDCard: analyzeIDCard | |
| 153 | + analyzeIDCard: analyzeIDCard, | |
| 154 | + isMobile: isMobile | |
| 150 | 155 | } | ... | ... |
请
注册
或
登录
后发表评论