提交 8e15c1ad7aff231a55c10dbb8e13de21d2c8e2f5

作者 pangy
2 个父辈 056ad94a 3f1d5331

merge

... ... @@ -254,23 +254,23 @@ Page({
254 254 console.log("formdata", formdata);
255 255 console.log('idnum', this.data.card_number.length < 1 && !format.isIDCardNum(formdata.id_card_no))
256 256 if (formdata.name.length < 1) {
257   - this.showtoast('有必填项未填写');
  257 + this.showtoast('姓名未填写');
258 258 return
259 259 } else if (!regname.test(formdata.name)) {
260 260 this.showtoast('请输入正确姓名');
261 261 return
262 262 } else if (this.data.relativeData.selected.length < 1) {
263   - this.showtoast('有必填项未填写');
  263 + this.showtoast('请选择关系');
264 264 return
265 265 }
266 266 else if (this.data.isIdCard && (this.data.card_number.length < 1 && formdata.id_card_no.length < 1)) {
267   - this.showtoast('有必填项未填写');
  267 + this.showtoast('请填写证照号码');
268 268 return
269 269 } else if (this.data.isIdCard && !format.isIDCardNum(formdata.id_card_no)) {
270 270 this.showtoast('证照号码有误');
271 271 return
272 272 } else if (!this.data.isIdCard && (!formdata.id_card_no || formdata.id_card_no.length < 1)) {
273   - this.showtoast('有必填项未填写');
  273 + this.showtoast('请填写证照号码');
274 274 return
275 275 }
276 276 else if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)) {
... ...
... ... @@ -804,13 +804,37 @@ Page({
804 804 })
805 805 },
806 806
  807 + idcardblur: function (e) {
  808 + var idCardNo = e.detail.value
  809 + if (!format.isIDCardNum(idCardNo)) {
  810 + wx.showToast({
  811 + image: "../../../../images/warn.png",
  812 + title: '身份证格式有误'
  813 + })
  814 + return;
  815 + }
  816 + this.dealIdInfo(idCardNo)
  817 + },
807 818 bindinputcardnum: function(e) {
808   - console.log('bindinputcardnum', e)
  819 + var idCardNo = e.detail.value
  820 + if (e.detail.value.length == 18) {
  821 + if (!format.isIDCardNum(idCardNo)) {
  822 + wx.showToast({
  823 + image: "../../../../images/warn.png",
  824 + title: '身份证格式有误'
  825 + })
  826 + return;
  827 + }
  828 + this.dealIdInfo(idCardNo)
  829 + }
  830 + },
  831 + //根据身份证号码,获取相关信息
  832 + dealIdInfo: function (idCardNum) {
  833 + var info = format.analyzeIDCard(idCardNum)
809 834 this.setData({
810   - card_number: e.detail.value
  835 + card_number: idCardNum
811 836 })
812 837 },
813   -
814 838 personalmoney:function(e){
815 839 console.log('personalmoney', e)
816 840 this.setData({
... ... @@ -836,13 +860,13 @@ Page({
836 860 console.log("formdata", formdata)
837 861 console.log("card_number", this.data.card_number)
838 862 if (this.data.name.length < 1) {
839   - this.showtoast('有必填项未填写');
  863 + this.showtoast('请输入姓名');
840 864 return
841 865 } else if (this.data.name.length > 0 && !regname.test(this.data.name)) {
842 866 this.showtoast('请输入正确姓名');
843 867 return
844 868 } else if (!this.data.isself && this.data.relativeData.selected.length < 1) {
845   - this.showtoast('有必填项未填写');
  869 + this.showtoast('请选择关系');
846 870 return
847 871 }
848 872 // else if (this.data.personstatusData.selected.length < 1) {
... ... @@ -853,7 +877,7 @@ Page({
853 877 this.showtoast('有必填项未填写');
854 878 return
855 879 } else if (this.data.card_number.length < 1) {
856   - this.showtoast('有必填项未填写');
  880 + this.showtoast('请输入身份证号码');
857 881 return
858 882 } else if (this.data.isIdCard && this.data.card_number.length > 0 && !format.isIDCardNum(this.data.card_number)) {
859 883 this.showtoast('证照号码有误');
... ...
... ... @@ -95,19 +95,12 @@
95 95 <view class='item_body'>
96 96 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
97 97 <text class='text_black_30 float_left' style='line-height: 90rpx'>证照号码</text>
98   - <view wx:if="{{isIdCard}}">
99   - <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden="{{taxInfo.certification_status=='active'}}"></image>
  98 + <view>
  99 + <image wx:if="{{isIdCard}}" class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden="{{taxInfo.certification_status=='active'}}"></image>
100 100 <!-- <text class='text_333_28 float_right'>{{card_number}}</text> -->
101 101 <!-- <input class='input_wrap float_right' placeholder="{{taxInfo.certification_status=='active'&&card_number?card_number:'请输入证照号码'}}" placeholder-class='text_999_28' name='id_card_no' maxlength='24' disabled="{{taxInfo.certification_status=='active'}}"></input> -->
102   - <input class='input_wrap float_right' hidden="{{taxInfo.certification_status=='active'}}" placeholder="请输入证照号码" value='{{card_number}}' name='id_card_no' disabled="{{taxInfo.certification_status=='active'}}" maxlength='24' bindblur='bindinputcardnum'></input>
103   - <input hidden="{{taxInfo.certification_status!='active'}}" class='input_wrap float_right' placeholder="{{taxInfo.certification_status=='active'||card_number?card_number:'请输入证照号码'}}" name='id_card_no' disabled="{{taxInfo.certification_status=='active'}}"
104   - maxlength='24' bindblur='bindinputcardnum'></input>
105   -
106   - </view>
107   - <view wx:else>
108   - <input class='input_wrap float_right' hidden="{{taxInfo.certification_status=='active'}}" placeholder="请输入证照号码" value='{{card_number}}' name='id_card_no' disabled="{{taxInfo.certification_status=='active'}}" maxlength='24' bindblur='bindinputcardnum'></input>
109   - <input hidden="{{taxInfo.certification_status!='active'}}" class='input_wrap float_right' placeholder="{{taxInfo.certification_status=='active'||card_number?card_number:'请输入证照号码'}}" name='id_card_no' disabled="{{taxInfo.certification_status=='active'}}"
110   - bindblur='bindinputcardnum' maxlength='24'></input>
  102 + <input class='input_wrap float_right' hidden="{{taxInfo.certification_status=='active'}}" placeholder="请输入证照号码" value='{{card_number}}' name='id_card_no' maxlength='18' bindblur='idcardblur' bindinput = 'bindinputcardnum'></input>
  103 + <input class='input_wrap float_right' hidden="{{taxInfo.certification_status!='active'}}" placeholder="{{card_number?card_number:'身份证号获取失败'}}" name='id_card_no' disabled='true'></input>
111 104 </view>
112 105 </view>
113 106
... ...
注册登录 后发表评论