正在显示
2 个修改的文件
包含
21 行增加
和
1 行删除
| ... | ... | @@ -152,6 +152,26 @@ Page({ |
| 152 | 152 | } |
| 153 | 153 | }, |
| 154 | 154 | |
| 155 | + bindinput:function(e){ | |
| 156 | + console.log("bindinput",e.detail.value) | |
| 157 | + var idCardNo = e.detail.value | |
| 158 | + if (idCardNo.length == 18) { | |
| 159 | + if (!format.isIDCardNum(idCardNo)) { | |
| 160 | + wx.showToast({ | |
| 161 | + image: "../../../../images/warn.png", | |
| 162 | + title: '身份证格式有误' | |
| 163 | + }) | |
| 164 | + return; | |
| 165 | + } | |
| 166 | + var info = format.analyzeIDCard(idCardNo) | |
| 167 | + console.log('info', info.age, info.sex, info.birthDay, (Date.parse(new Date(info.birthDay)) / 1000)) | |
| 168 | + this.setData({ | |
| 169 | + birthday: info.birthDay, | |
| 170 | + birthday_datelong: (Date.parse(new Date(info.birthDay)) / 1000), | |
| 171 | + }) | |
| 172 | + } | |
| 173 | + }, | |
| 174 | + | |
| 155 | 175 | /** |
| 156 | 176 | * Lifecycle function--Called when page hide |
| 157 | 177 | */ | ... | ... |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照号码</text> |
| 22 | 22 | <view> |
| 23 | 23 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no"></image> |
| 24 | - <input class='input_wrap01 float_right' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type='idcard' value='{{id_card_no}}'></input> | |
| 24 | + <input class='input_wrap01 float_right' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type='idcard' value='{{id_card_no}}' bindinput="bindinput"></input> | |
| 25 | 25 | </view> |
| 26 | 26 | </view> |
| 27 | 27 | <view class="divide_line"></view> | ... | ... |
请
注册
或
登录
后发表评论