正在显示
18 个修改的文件
包含
300 行增加
和
96 行删除
images/8KB.png
已删除
100644 → 0
4.5 KB
images/icon_logout.png
0 → 100644
4.3 KB
| ... | ... | @@ -157,10 +157,20 @@ Page({ |
| 157 | 157 | if (this.data.cardtype.length < 1) { |
| 158 | 158 | this.showToast("请选择证照类型") |
| 159 | 159 | return; |
| 160 | - } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) { | |
| 160 | + } | |
| 161 | + if (!formdata.id_card_no || formdata.id_card_no.length < 1) { | |
| 161 | 162 | this.showToast("请输入证件号码") |
| 162 | 163 | return; |
| 163 | - } else if (this.data.cardtype == '居民身份证' && !format.isIDCardNum(formdata.id_card_no)) { | |
| 164 | + } | |
| 165 | + if (this.data.cardtype == '居民身份证' && !format.isIDCardNum(formdata.id_card_no)) { | |
| 166 | + this.showToast("证件号码有误") | |
| 167 | + return; | |
| 168 | + } | |
| 169 | + if (this.data.cardtype == '中国护照' && formdata.id_card_no.length!=9) { | |
| 170 | + this.showToast("证件号码有误") | |
| 171 | + return; | |
| 172 | + } | |
| 173 | + if ((this.data.cardtype.indexOf('港澳') != -1 || this.data.cardtype.indexOf('台湾') != -1) &&! /^\d{18}$/.test(formdata.id_card_no)) { | |
| 164 | 174 | this.showToast("证件号码有误") |
| 165 | 175 | return; |
| 166 | 176 | } | ... | ... |
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | <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> |
| 29 | 29 | </view> |
| 30 | 30 | <view wx:else> |
| 31 | - <input class='input_wrap01 float_right' placeholder='请输入证件号码' placeholder-class='text_999_30' name='id_card_no' maxlength='24' value='{{id_card_no}}' bindinput="bindinput"></input> | |
| 31 | + <input class='input_wrap01 float_right' placeholder='请输入证件号码' placeholder-class='text_999_30' name='id_card_no' maxlength='20' value='{{id_card_no}}' bindinput="bindinput"></input> | |
| 32 | 32 | </view> |
| 33 | 33 | </view> |
| 34 | 34 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> | ... | ... |
| 1 | 1 | // pages/main/addtionalreduce/addextrainfo/addextrainfo.js |
| 2 | 2 | var format = require('../../../../utils/util.js'); |
| 3 | 3 | // var countryInfo = require('../../../../utils/country.js'); |
| 4 | +const reg_18_Number = /^[0-9]{18}$/; | |
| 5 | +const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; | |
| 4 | 6 | const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| 5 | 7 | var OSSInit; |
| 6 | 8 | var app = getApp(); |
| ... | ... | @@ -1437,6 +1439,7 @@ Page({ |
| 1437 | 1439 | // return bank_name |
| 1438 | 1440 | // }, |
| 1439 | 1441 | |
| 1442 | + | |
| 1440 | 1443 | formSubmit: function(e) { |
| 1441 | 1444 | console.log("formSubmit", e); |
| 1442 | 1445 | var formdata = e.detail.value |
| ... | ... | @@ -1454,7 +1457,15 @@ Page({ |
| 1454 | 1457 | return |
| 1455 | 1458 | } |
| 1456 | 1459 | if (this.data.isIdCard_child && !format.isIDCardNum(formdata.children_id_card_no)) { |
| 1457 | - this.showToast('身份证格式有误') | |
| 1460 | + this.showToast('子女证照号码有误') | |
| 1461 | + return | |
| 1462 | + } | |
| 1463 | + if (this.data.childrencardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.children_id_card_no)) { | |
| 1464 | + this.showToast('子女证照号码有误'); | |
| 1465 | + return | |
| 1466 | + } | |
| 1467 | + if (this.data.childrencardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.children_id_card_no)) { | |
| 1468 | + this.showToast('子女证照号码有误'); | |
| 1458 | 1469 | return |
| 1459 | 1470 | } |
| 1460 | 1471 | if (format.getAge(this.data.commonbirthDate.selected) < 3) { |
| ... | ... | @@ -1537,9 +1548,18 @@ Page({ |
| 1537 | 1548 | this.showToast('请填写配偶证照号码') |
| 1538 | 1549 | return |
| 1539 | 1550 | } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) { |
| 1540 | - this.showToast('配偶身份证格式有误') | |
| 1551 | + this.showToast('配偶证照号码有误') | |
| 1541 | 1552 | return |
| 1542 | - }else if (this.data.loverbirthDate.selected.length < 1) { | |
| 1553 | + } | |
| 1554 | + if (this.data.lovercardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.spouse_id_card_no)) { | |
| 1555 | + this.showToast('配偶证照号码有误'); | |
| 1556 | + return | |
| 1557 | + } | |
| 1558 | + if (this.data.lovercardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.spouse_id_card_no)) { | |
| 1559 | + this.showToast('配偶证照号码有误'); | |
| 1560 | + return | |
| 1561 | + } | |
| 1562 | + if (this.data.loverbirthDate.selected.length < 1) { | |
| 1543 | 1563 | this.showToast('请选择配偶出生日期') |
| 1544 | 1564 | return |
| 1545 | 1565 | } |
| ... | ... | @@ -1658,6 +1678,14 @@ Page({ |
| 1658 | 1678 | this.showToast('被赡养人身份证格式有误') |
| 1659 | 1679 | return |
| 1660 | 1680 | } |
| 1681 | + if (this.data.oldercardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.id_card_no)) { | |
| 1682 | + this.showToast('被赡养人证照号码有误'); | |
| 1683 | + return | |
| 1684 | + } | |
| 1685 | + if (this.data.oldercardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.id_card_no)) { | |
| 1686 | + this.showToast('被赡养人证照号码有误'); | |
| 1687 | + return | |
| 1688 | + } | |
| 1661 | 1689 | if (this.data.olderbirthDate.selected.length < 1) { |
| 1662 | 1690 | this.showToast('请选择出生日期') |
| 1663 | 1691 | return |
| ... | ... | @@ -1737,7 +1765,6 @@ Page({ |
| 1737 | 1765 | break; |
| 1738 | 1766 | case 'house_fund': |
| 1739 | 1767 | subUrl = 'persontax/v1/house-funds' |
| 1740 | - console.log('TITLE', this.data.title) | |
| 1741 | 1768 | |
| 1742 | 1769 | if (this.data.house_type == "house_fund_loan") { |
| 1743 | 1770 | newdata.type = 'loan' |
| ... | ... | @@ -1840,9 +1867,17 @@ Page({ |
| 1840 | 1867 | // this.showToast('请填写证照号码') |
| 1841 | 1868 | // return |
| 1842 | 1869 | } else if (this.data.isIdCard_owner && !format.isIDCardNum(formdata.owner_id_card_no)) { |
| 1843 | - this.showToast('身份证格式有误') | |
| 1870 | + this.showToast('证照号码有误') | |
| 1844 | 1871 | return |
| 1845 | 1872 | } |
| 1873 | + if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.owner_id_card_no)) { | |
| 1874 | + this.showToast('证照号码有误'); | |
| 1875 | + return | |
| 1876 | + } | |
| 1877 | + if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.owner_id_card_no)) { | |
| 1878 | + this.showToast('证照号码有误'); | |
| 1879 | + return | |
| 1880 | + } | |
| 1846 | 1881 | newdata.owner_id_card_type = this.data.cardtypeData.selected |
| 1847 | 1882 | } |
| 1848 | 1883 | // if (this.data.rentLocateInfo.address_value[0].length < 1) { |
| ... | ... | @@ -1900,7 +1935,16 @@ Page({ |
| 1900 | 1935 | } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) { |
| 1901 | 1936 | this.showToast('配偶身份证格式有误') |
| 1902 | 1937 | return |
| 1903 | - } else if (this.data.loverbirthDate.selected.length < 1) { | |
| 1938 | + } | |
| 1939 | + if (this.data.lovercardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.spouse_id_card_no)) { | |
| 1940 | + this.showToast('证照号码有误'); | |
| 1941 | + return | |
| 1942 | + } | |
| 1943 | + if (this.data.lovercardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.spouse_id_card_no)) { | |
| 1944 | + this.showToast('证照号码有误'); | |
| 1945 | + return | |
| 1946 | + } | |
| 1947 | + if (this.data.loverbirthDate.selected.length < 1) { | |
| 1904 | 1948 | this.showToast('请选择配偶出生日期') |
| 1905 | 1949 | return |
| 1906 | 1950 | } | ... | ... |
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | <text class='text_777_30 float_left' style='line-height: 90rpx'>子女证照号码</text> |
| 14 | 14 | <view wx:if="{{isIdCard}}"> |
| 15 | 15 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no" hidden='{{!isIdCard_child}}'></image> |
| 16 | - <input class='input_wrap' style='color:#000;' placeholder='请输入证照号码' placeholder-class='text_999_30' name='children_id_card_no' maxlength='18' value='{{children_id_card_no}}' bindinput="idChange" bindblur="idDone" id='children_id_card_no_input'></input> | |
| 16 | + <input class='input_wrap' style='color:#000;' placeholder='请输入证照号码' placeholder-class='text_999_30' name='children_id_card_no' maxlength='20' value='{{children_id_card_no}}' bindinput="idChange" bindblur="idDone" id='children_id_card_no_input'></input> | |
| 17 | 17 | </view> |
| 18 | 18 | <!-- <view wx:else> |
| 19 | 19 | <input class='input_wrap' placeholder='请输入证照号码' placeholder-class='text_999_30' name='children_id_card_no' maxlength='18' type='idcard' value='{{children_id_card_no}}'></input> |
| ... | ... | @@ -142,7 +142,7 @@ |
| 142 | 142 | <text class='text_777_30 float_left'>被赡养人证照号码</text> |
| 143 | 143 | <view> |
| 144 | 144 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="older_id_card_no" hidden='{{!isIdCard_older}}'></image> |
| 145 | - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证照号码' maxlength='18' name='id_card_no' value='{{id_card_no}}' bindinput="idChange" bindblur="idDone" id="older_id_card_no_input"></input> | |
| 145 | + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证照号码' maxlength='20' name='id_card_no' value='{{id_card_no}}' bindinput="idChange" bindblur="idDone" id="older_id_card_no_input"></input> | |
| 146 | 146 | </view> |
| 147 | 147 | </view> |
| 148 | 148 | <view class='divide_line_30'></view> |
| ... | ... | @@ -313,7 +313,7 @@ |
| 313 | 313 | <text class='text_777_30 float_left head_in'>证照号码</text> |
| 314 | 314 | <view> |
| 315 | 315 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no" hidden='{{!isIdCard_owner}}'></image> |
| 316 | - <input class='input_wrap' placeholder-class='text_999_30 float_right' style=' line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证照号码' maxlength='18' name='owner_id_card_no' value='{{owner_id_card_no}}' bindinput="idChange" bindblur="idDone" id='owner_id_card_no_input'></input> | |
| 316 | + <input class='input_wrap' placeholder-class='text_999_30 float_right' style=' line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证照号码' maxlength='20' name='owner_id_card_no' value='{{owner_id_card_no}}' bindinput="idChange" bindblur="idDone" id='owner_id_card_no_input'></input> | |
| 317 | 317 | </view> |
| 318 | 318 | </view> |
| 319 | 319 | </view> |
| ... | ... | @@ -372,7 +372,7 @@ |
| 372 | 372 | <text class='text_777_30 float_left head_in'>配偶证照号码</text> |
| 373 | 373 | <view> |
| 374 | 374 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden='{{!isIdCard_lover}}' id="spouse_id_card_no"></image><!-- hidden='{{hasGetLover || !isIdCard_lover}}' --> |
| 375 | - <input class='input_wrap' style='color:#000;' placeholder='请输入证照号码' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='18' value='{{spouse_id_card_no}}' bindinput="idChange" bindblur="idDone" id='spouse_id_card_no_input'></input><!-- disabled='{{hasGetLover}}' --> | |
| 375 | + <input class='input_wrap' style='color:#000;' placeholder='请输入证照号码' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='20' value='{{spouse_id_card_no}}' bindinput="idChange" bindblur="idDone" id='spouse_id_card_no_input'></input><!-- disabled='{{hasGetLover}}' --> | |
| 376 | 376 | </view> |
| 377 | 377 | </view> |
| 378 | 378 | <view class='divide_line_30'></view> | ... | ... |
| ... | ... | @@ -58,8 +58,9 @@ Page({ |
| 58 | 58 | selectdata: options.select_data ? JSON.parse(options.select_data) : {} |
| 59 | 59 | }) |
| 60 | 60 | if (options.type == '1' && options.select_data && JSON.parse(options.select_data)) { |
| 61 | - this.handleData(JSON.parse(options.select_data)) | |
| 61 | + this.handleData(JSON.parse(options.select_data), JSON.parse(options.complete_data)) | |
| 62 | 62 | } |
| 63 | + // | |
| 63 | 64 | }, |
| 64 | 65 | |
| 65 | 66 | /** |
| ... | ... | @@ -76,7 +77,7 @@ Page({ |
| 76 | 77 | |
| 77 | 78 | }, |
| 78 | 79 | |
| 79 | - handleData: function(data) { | |
| 80 | + handleData: function(data,completedata) { | |
| 80 | 81 | var selectarray = data.addition_items; |
| 81 | 82 | console.log("handleData", data) |
| 82 | 83 | var selectIndex = this.data.selectIndex; |
| ... | ... | @@ -88,19 +89,19 @@ Page({ |
| 88 | 89 | for (var i = 0; i < selectarray.length; i++) { |
| 89 | 90 | if (selectarray[i].addition_category == 'children_education') { //子女教育 |
| 90 | 91 | selectIndex[0].sureid = true |
| 91 | - selectIndex[0].disable_change = true | |
| 92 | + selectIndex[0].disable_change = completedata.indexOf('children_education')!=-1?true:false | |
| 92 | 93 | } |
| 93 | 94 | if (selectarray[i].addition_category == 'continuing_education') { //继续教育 |
| 94 | 95 | selectIndex[1].sureid = true |
| 95 | - selectIndex[1].disable_change = true | |
| 96 | + selectIndex[1].disable_change = completedata.indexOf('continuing_education') != -1 ? true : false | |
| 96 | 97 | } |
| 97 | 98 | if (selectarray[i].addition_category == 'support_duty') { //赡养老人 |
| 98 | 99 | selectIndex[2].sureid = true |
| 99 | - selectIndex[2].disable_change = true | |
| 100 | + selectIndex[2].disable_change = completedata.indexOf('support_duty') != -1 ? true : false | |
| 100 | 101 | } |
| 101 | 102 | if (selectarray[i].addition_category == 'house_fund_rent') { //住房(租房) |
| 102 | 103 | selectIndex[3].sureid = true |
| 103 | - selectIndex[3].disable_change = true | |
| 104 | + selectIndex[3].disable_change = completedata.indexOf('house_fund_rent') != -1 ? true : false | |
| 104 | 105 | this.setData({ |
| 105 | 106 | flag_housing01: false, |
| 106 | 107 | flag_housing02: true, |
| ... | ... | @@ -108,7 +109,7 @@ Page({ |
| 108 | 109 | } |
| 109 | 110 | if (selectarray[i].addition_category == 'house_fund_loan') { //住房(租房) |
| 110 | 111 | selectIndex[3].sureid = true |
| 111 | - selectIndex[3].disable_change = true | |
| 112 | + selectIndex[3].disable_change = completedata.indexOf('house_fund_loan') != -1 ? true : false | |
| 112 | 113 | this.setData({ |
| 113 | 114 | flag_housing01: true, |
| 114 | 115 | flag_housing02: false, | ... | ... |
| ... | ... | @@ -11,6 +11,7 @@ Page({ |
| 11 | 11 | is_declared: false, |
| 12 | 12 | hascompleted:false, |
| 13 | 13 | additionlist: [], |
| 14 | + complete_item:[], | |
| 14 | 15 | declareStatus: { |
| 15 | 16 | "to_declare ": "待申报", |
| 16 | 17 | "declaring": "申报中", |
| ... | ... | @@ -53,7 +54,7 @@ Page({ |
| 53 | 54 | console.log("goupdate", e); |
| 54 | 55 | var newdata = this.data.additionlist[e.currentTarget.id] |
| 55 | 56 | wx.navigateTo({ |
| 56 | - url: 'godeclare/godeclare?legal_entity_id=' + newdata.legal_entity_id + "&legal_entity=" + newdata.legal_entity + "&select_data=" + JSON.stringify(newdata) + "&type=1", | |
| 57 | + url: 'godeclare/godeclare?legal_entity_id=' + newdata.legal_entity_id + "&legal_entity=" + newdata.legal_entity + "&select_data=" + JSON.stringify(newdata) + "&complete_data=" + JSON.stringify(this.data.complete_item) + "&type=1", | |
| 57 | 58 | }) |
| 58 | 59 | }, |
| 59 | 60 | |
| ... | ... | @@ -109,6 +110,7 @@ Page({ |
| 109 | 110 | if (res && res.data) { |
| 110 | 111 | console.log("res", res) |
| 111 | 112 | that.setData({ |
| 113 | + complete_item: res.data.complete_item, | |
| 112 | 114 | additionlist: that.handleData(res.data.items) |
| 113 | 115 | }) |
| 114 | 116 | } | ... | ... |
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <!-- <view wx:if="{{item.status=='to_declare'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> --> |
| 10 | 10 | 立即申报 |
| 11 | 11 | </view> |
| 12 | - <view wx:elif="{{item.addition_items&&item.addition_items.length>0&&item.addition_items.length<4}}" class='view_godeclare_wrap' bindtap='goupdate' id='{{idx01}}'> | |
| 12 | + <view wx:elif="{{complete_item.length<4}}" class='view_godeclare_wrap' bindtap='goupdate' id='{{idx01}}'> | |
| 13 | 13 | 查看并调整 |
| 14 | 14 | </view> |
| 15 | 15 | </view> | ... | ... |
| ... | ... | @@ -120,6 +120,26 @@ Page({ |
| 120 | 120 | }) |
| 121 | 121 | }, |
| 122 | 122 | |
| 123 | + loginout:function(){ | |
| 124 | + wx.showModal({ | |
| 125 | + title: '退出登录', | |
| 126 | + content: '确认要退出登录吗?', | |
| 127 | + confirmText: '确定', | |
| 128 | + showCancel: true, | |
| 129 | + cancelText:"取消", | |
| 130 | + confirmColor: '#357aeb', | |
| 131 | + success(res) { | |
| 132 | + console.log("loginout", res) | |
| 133 | + if (res.confirm) { | |
| 134 | + wx.reLaunch({ | |
| 135 | + // url: '../../login/login' | |
| 136 | + url: '../../getPhone/getPhone' | |
| 137 | + }) | |
| 138 | + } | |
| 139 | + } | |
| 140 | + }) | |
| 141 | + }, | |
| 142 | + | |
| 123 | 143 | /** |
| 124 | 144 | * 生命周期函数--监听页面隐藏 |
| 125 | 145 | */ | ... | ... |
| ... | ... | @@ -55,9 +55,13 @@ |
| 55 | 55 | </view> |
| 56 | 56 | <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image> |
| 57 | 57 | </view> --> |
| 58 | + | |
| 59 | + <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> --> | |
| 58 | 60 | </view> |
| 59 | 61 | </scroll-view> |
| 60 | - | |
| 62 | + | |
| 61 | 63 | <image class='chat-img' bindtap='gochat' src='/images/icon_chat.png'></image> |
| 62 | 64 | |
| 65 | + <image class='logout-img' bindtap='loginout' src='/images/icon_logout.png'></image> | |
| 66 | + | |
| 63 | 67 | </view> | ... | ... |
| ... | ... | @@ -60,8 +60,16 @@ text_wrap_sub_999 { |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | .chat-img { |
| 63 | - width: 96rpx; | |
| 64 | - height: 96rpx; | |
| 63 | + width: 80rpx; | |
| 64 | + height: 80rpx; | |
| 65 | + position: fixed; | |
| 66 | + right: 40rpx; | |
| 67 | + bottom: 140rpx; | |
| 68 | +} | |
| 69 | + | |
| 70 | +.logout-img { | |
| 71 | + width: 80rpx; | |
| 72 | + height: 80rpx; | |
| 65 | 73 | position: fixed; |
| 66 | 74 | right: 40rpx; |
| 67 | 75 | bottom: 40rpx; | ... | ... |
| ... | ... | @@ -2,6 +2,8 @@ |
| 2 | 2 | var app = getApp(); |
| 3 | 3 | var format = require('../../../../utils/util.js'); |
| 4 | 4 | var baseUrl = app.globalData.baseUrl; |
| 5 | +const reg_18_Number = /^[0-9]{18}$/; | |
| 6 | +const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; | |
| 5 | 7 | // const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| 6 | 8 | const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| 7 | 9 | Page({ |
| ... | ... | @@ -418,7 +420,13 @@ Page({ |
| 418 | 420 | if (this.data.card_number.length < 1) { |
| 419 | 421 | this.showtoast('请填写证照号码'); |
| 420 | 422 | return |
| 421 | - } else if (this.data.isIdCard && this.data.card_number.length > 0 && !format.isIDCardNum(this.data.card_number)) { | |
| 423 | + } else if (this.data.isIdCard && !format.isIDCardNum(this.data.card_number)) { | |
| 424 | + this.showtoast('证照号码有误'); | |
| 425 | + return | |
| 426 | + } else if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(this.data.card_number)) { | |
| 427 | + this.showtoast('证照号码有误'); | |
| 428 | + return | |
| 429 | + } else if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(this.data.card_number)) { | |
| 422 | 430 | this.showtoast('证照号码有误'); |
| 423 | 431 | return |
| 424 | 432 | } |
| ... | ... | @@ -519,12 +527,12 @@ Page({ |
| 519 | 527 | success: function(res) { |
| 520 | 528 | console.log(res) |
| 521 | 529 | wx.hideLoading() |
| 522 | - if (res.statusCode == 200) { | |
| 530 | + if (res.statusCode < 300) { | |
| 523 | 531 | wx.navigateBack({ |
| 524 | 532 | delta: 1 |
| 525 | 533 | }) |
| 526 | 534 | } else { |
| 527 | - that.showtoast(res.data.message) | |
| 535 | + that.showtoast(res.data.message ? res.data.message : '请求出错') | |
| 528 | 536 | } |
| 529 | 537 | }, |
| 530 | 538 | fail(res) { |
| ... | ... | @@ -577,55 +585,106 @@ Page({ |
| 577 | 585 | // }) |
| 578 | 586 | // } |
| 579 | 587 | }, |
| 580 | - | |
| 588 | + | |
| 581 | 589 | idChange: function (e) { |
| 582 | - console.log('idCardNoChange', e.detail.value) | |
| 583 | 590 | var idCardNo = e.detail.value |
| 584 | 591 | this.setData({ |
| 585 | 592 | card_number: idCardNo |
| 586 | 593 | }) |
| 587 | - if (!this.data.isIdCard) { | |
| 588 | - return; | |
| 589 | - } | |
| 590 | - if (e.detail.value.length == 18){ | |
| 591 | - if (!format.isIDCardNum(idCardNo)) { | |
| 592 | - wx.showToast({ | |
| 593 | - image: "../../../../images/warn.png", | |
| 594 | - title: '身份证格式有误' | |
| 595 | - }) | |
| 594 | + if (e.detail.value.length == 18) { | |
| 595 | + if (this.data.isIdCard && !format.isIDCardNum(idCardNo)) { | |
| 596 | + this.showtoast('证照号码有误'); | |
| 596 | 597 | return; |
| 597 | 598 | } |
| 598 | - this.dealIdInfo(idCardNo) | |
| 599 | + if (this.data.isIdCard) { | |
| 600 | + this.dealIdInfo(idCardNo) | |
| 601 | + return; | |
| 602 | + } | |
| 603 | + if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(idCardNo)) { | |
| 604 | + this.showtoast('证照号码有误'); | |
| 605 | + return | |
| 606 | + } | |
| 599 | 607 | } |
| 608 | + if (e.detail.value.length == 9) { | |
| 609 | + if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(idCardNo)) { | |
| 610 | + this.showtoast('证照号码有误'); | |
| 611 | + return | |
| 612 | + } | |
| 613 | + } | |
| 614 | + | |
| 600 | 615 | }, |
| 601 | 616 | idDone: function (e) { |
| 602 | 617 | var idCardNo = e.detail.value |
| 603 | 618 | this.setData({ |
| 604 | 619 | card_number: idCardNo |
| 605 | 620 | }) |
| 606 | - if (!this.data.isIdCard) { | |
| 607 | - return; | |
| 608 | - } | |
| 609 | 621 | if (!idCardNo.length) { |
| 610 | - wx.showToast({ | |
| 611 | - image: "../../../../images/warn.png", | |
| 612 | - title: '请输入身份证号' | |
| 613 | - }) | |
| 622 | + this.showtoast('请输入证照号码'); | |
| 614 | 623 | return; |
| 615 | 624 | } |
| 616 | - if (!format.isIDCardNum(idCardNo)) { | |
| 617 | - wx.showToast({ | |
| 618 | - image: "../../../../images/warn.png", | |
| 619 | - title: '身份证格式有误' | |
| 620 | - }) | |
| 625 | + if (this.data.isIdCard && !format.isIDCardNum(idCardNo)) { | |
| 626 | + this.showtoast('证照号码有误'); | |
| 621 | 627 | return; |
| 622 | 628 | } |
| 629 | + if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(idCardNo)) { | |
| 630 | + this.showtoast('证照号码有误'); | |
| 631 | + return | |
| 632 | + } | |
| 633 | + if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(idCardNo)) { | |
| 634 | + this.showtoast('证照号码有误'); | |
| 635 | + return | |
| 636 | + } | |
| 623 | 637 | }, |
| 624 | - | |
| 625 | - /** | |
| 626 | - * 生命周期函数--监听页面隐藏 | |
| 627 | - */ | |
| 628 | - onHide: function() { | |
| 638 | + deleteTap: function () { | |
| 639 | + var that = this | |
| 640 | + wx.showModal({ | |
| 641 | + title: '提示', | |
| 642 | + content: '确认要删除吗?', | |
| 643 | + success(res) { | |
| 644 | + if (res.confirm) { | |
| 645 | + that.delete() | |
| 646 | + } else if (res.cancel) { | |
| 647 | + } | |
| 648 | + } | |
| 649 | + }) | |
| 650 | + }, | |
| 651 | + delete: function() { | |
| 652 | + if (!this.cur_id || this.cur_id.length<1) { | |
| 653 | + wx.navigateBack({ | |
| 654 | + delta: 1 | |
| 655 | + }) | |
| 656 | + return | |
| 657 | + } | |
| 658 | + console.log('delete') | |
| 659 | + var that = this | |
| 660 | + var Authorization = app.globalData.Authorization; | |
| 661 | + var url = baseUrl + 'persontax/v1/personal-taxes/' + this.cur_id, method = "DELETE" | |
| 662 | + wx.showLoading({ | |
| 663 | + title: '', | |
| 664 | + }) | |
| 665 | + wx.request({ | |
| 666 | + url: url, | |
| 667 | + method: method, | |
| 668 | + header: { | |
| 669 | + 'content-type': 'application/json', // 默认值 | |
| 670 | + "Authorization": Authorization | |
| 671 | + }, | |
| 672 | + success: function (res) { | |
| 673 | + console.log(res) | |
| 674 | + wx.hideLoading() | |
| 675 | + if (res.statusCode < 300) { | |
| 676 | + wx.navigateBack({ | |
| 677 | + delta: 1 | |
| 678 | + }) | |
| 679 | + } else { | |
| 680 | + that.showtoast(res.data.message ? res.data.message : '请求出错') | |
| 681 | + } | |
| 682 | + }, | |
| 683 | + fail(res) { | |
| 684 | + console.log(res) | |
| 685 | + wx.hideLoading() | |
| 686 | + } | |
| 687 | + }) | |
| 629 | 688 | |
| 630 | 689 | }, |
| 631 | 690 | ... | ... |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <input class='input_wrap' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}' type='idcard' ></input> |
| 28 | 28 | </view> |
| 29 | 29 | <view wx:else> |
| 30 | - <input class='input_wrap' placeholder='请输入证照号码' placeholder-class='text_999_30' name='id_card_no' maxlength='30' value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}'></input> | |
| 30 | + <input class='input_wrap' placeholder='请输入证照号码' placeholder-class='text_999_30' name='id_card_no' maxlength='20' value='{{card_number}}' bindblur="idDone" bindinput="idChange" disabled='{{isDisable}}'></input> | |
| 31 | 31 | </view> |
| 32 | 32 | </view> |
| 33 | 33 | <view class="divide_line_30"></view> |
| ... | ... | @@ -63,9 +63,10 @@ |
| 63 | 63 | </view> |
| 64 | 64 | </view> |
| 65 | 65 | </view> |
| 66 | - | |
| 67 | - <view class="btn_bottom"> | |
| 68 | - <button class="btn_bottom" formType="submit"> 保存</button> | |
| 66 | + | |
| 67 | + <view class="btn_left" bindtap='deleteTap'>删除</view> | |
| 68 | + <view class="btn_bottom_wrap"> | |
| 69 | + <button class="btn_right" formType="submit">保存</button> | |
| 69 | 70 | </view> |
| 70 | 71 | </form> |
| 71 | 72 | </view> | ... | ... |
| ... | ... | @@ -127,4 +127,43 @@ input[disabled]{ |
| 127 | 127 | height: 40rpx; |
| 128 | 128 | float: right; |
| 129 | 129 | margin-top:24rpx; |
| 130 | +} | |
| 131 | + | |
| 132 | +.btn_left{ | |
| 133 | + width: 40%; | |
| 134 | + z-index: 10000; | |
| 135 | + height: 82rpx; | |
| 136 | + text-align: center; | |
| 137 | + position: fixed; | |
| 138 | + color: #666; | |
| 139 | + bottom: 0; | |
| 140 | + line-height: 82rpx; | |
| 141 | + background: #fff; | |
| 142 | + border: 1rpx solid #f5f5f5; | |
| 143 | + | |
| 144 | +} | |
| 145 | +.btn_bottom_wrap{ | |
| 146 | + width: 60%; | |
| 147 | + z-index: 10000; | |
| 148 | + height: 84rpx; | |
| 149 | + text-align: center; | |
| 150 | + position: fixed; | |
| 151 | + background: #357aeb; | |
| 152 | + /* border: 1rpx solid #357aeb; */ | |
| 153 | + bottom: 0; | |
| 154 | + line-height: 84rpx; | |
| 155 | + right: 0; | |
| 156 | +} | |
| 157 | +.btn_right{ | |
| 158 | + width: 60%; | |
| 159 | + z-index: 10000; | |
| 160 | + height: 84rpx; | |
| 161 | + background: #357aeb; | |
| 162 | + text-align: center; | |
| 163 | + position: fixed; | |
| 164 | + color: #fff; | |
| 165 | + bottom: 0; | |
| 166 | + right: 0; | |
| 167 | + line-height: 84rpx; | |
| 168 | + border-color: #357aeb; | |
| 130 | 169 | } |
| \ No newline at end of file | ... | ... |
| 1 | 1 | var format = require('../../../../utils/util.js'); |
| 2 | 2 | var app = getApp(); |
| 3 | 3 | var baseUrl = app.globalData.baseUrl; |
| 4 | +const reg_18_Number = /^[0-9]{18}$/; | |
| 5 | +const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; | |
| 4 | 6 | // var countryInfo = require('../../../../utils/country.js'); |
| 5 | 7 | // const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| 6 | 8 | const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; |
| ... | ... | @@ -1077,41 +1079,48 @@ Page({ |
| 1077 | 1079 | this.setData({ |
| 1078 | 1080 | card_number: idCardNo |
| 1079 | 1081 | }) |
| 1080 | - if (!this.data.isIdCard) { | |
| 1081 | - return; | |
| 1082 | - } | |
| 1083 | 1082 | if (!idCardNo.length) { |
| 1084 | - wx.showToast({ | |
| 1085 | - image: "../../../../images/warn.png", | |
| 1086 | - title: '请输入身份证号' | |
| 1087 | - }) | |
| 1083 | + this.showtoast('请输入证照号码'); | |
| 1088 | 1084 | return; |
| 1089 | 1085 | } |
| 1090 | - if (!format.isIDCardNum(idCardNo)) { | |
| 1091 | - wx.showToast({ | |
| 1092 | - image: "../../../../images/warn.png", | |
| 1093 | - title: '身份证格式有误' | |
| 1094 | - }) | |
| 1086 | + if (this.data.isIdCard && !format.isIDCardNum(idCardNo)) { | |
| 1087 | + this.showtoast('证照号码有误'); | |
| 1095 | 1088 | return; |
| 1096 | 1089 | } |
| 1090 | + if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(idCardNo)) { | |
| 1091 | + this.showtoast('证照号码有误'); | |
| 1092 | + return | |
| 1093 | + } | |
| 1094 | + if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(idCardNo)) { | |
| 1095 | + this.showtoast('证照号码有误'); | |
| 1096 | + return | |
| 1097 | + } | |
| 1098 | + | |
| 1097 | 1099 | }, |
| 1098 | 1100 | bindinputcardnum: function(e) { |
| 1099 | 1101 | var idCardNo = e.detail.value |
| 1100 | 1102 | this.setData({ |
| 1101 | 1103 | card_number: idCardNo |
| 1102 | 1104 | }) |
| 1103 | - if (!this.data.isIdCard) { | |
| 1104 | - return; | |
| 1105 | - } | |
| 1106 | 1105 | if (e.detail.value.length == 18) { |
| 1107 | - if (!format.isIDCardNum(idCardNo)) { | |
| 1108 | - wx.showToast({ | |
| 1109 | - image: "../../../../images/warn.png", | |
| 1110 | - title: '身份证格式有误' | |
| 1111 | - }) | |
| 1106 | + if (this.data.isIdCard && !format.isIDCardNum(idCardNo)) { | |
| 1107 | + this.showtoast('证照号码有误'); | |
| 1112 | 1108 | return; |
| 1109 | + } | |
| 1110 | + if (this.data.isIdCard){ | |
| 1111 | + this.dealIdInfo(idCardNo) | |
| 1112 | + return; | |
| 1113 | + } | |
| 1114 | + if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(idCardNo)) { | |
| 1115 | + this.showtoast('证照号码有误'); | |
| 1116 | + return | |
| 1117 | + } | |
| 1118 | + } | |
| 1119 | + if (e.detail.value.length == 9){ | |
| 1120 | + if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(idCardNo)) { | |
| 1121 | + this.showtoast('证照号码有误'); | |
| 1122 | + return | |
| 1113 | 1123 | } |
| 1114 | - this.dealIdInfo(idCardNo) | |
| 1115 | 1124 | } |
| 1116 | 1125 | }, |
| 1117 | 1126 | //根据身份证号码,获取相关信息 |
| ... | ... | @@ -1166,7 +1175,13 @@ Page({ |
| 1166 | 1175 | if (this.data.card_number.length < 1) { |
| 1167 | 1176 | this.showtoast('请填写证照号码'); |
| 1168 | 1177 | return |
| 1169 | - } else if (this.data.isIdCard && this.data.card_number.length > 0 && !format.isIDCardNum(this.data.card_number)) { | |
| 1178 | + } else if (this.data.isIdCard && !format.isIDCardNum(this.data.card_number)) { | |
| 1179 | + this.showtoast('证照号码有误'); | |
| 1180 | + return | |
| 1181 | + } else if (this.data.cardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(this.data.card_number)) { | |
| 1182 | + this.showtoast('证照号码有误'); | |
| 1183 | + return | |
| 1184 | + } else if (this.data.cardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(this.data.card_number)) { | |
| 1170 | 1185 | this.showtoast('证照号码有误'); |
| 1171 | 1186 | return |
| 1172 | 1187 | } |
| ... | ... | @@ -1208,7 +1223,13 @@ Page({ |
| 1208 | 1223 | if (this.data.hasOtherCard && !formdata.other_card_number.length) { |
| 1209 | 1224 | this.showtoast('请输入其他证照号码'); |
| 1210 | 1225 | return |
| 1211 | - } | |
| 1226 | + } else if (this.data.otherCardtypeData.selected.indexOf('居住证') > -1 && !reg_18_Number.test(formdata.other_card_number)) { | |
| 1227 | + this.showtoast('其他证照号码有误'); | |
| 1228 | + return | |
| 1229 | + } else if (this.data.otherCardtypeData.selected.indexOf('中国护照') > -1 && !reg_9_n_a.test(formdata.other_card_number)) { | |
| 1230 | + this.showtoast('其他证照号码有误'); | |
| 1231 | + return | |
| 1232 | + } | |
| 1212 | 1233 | if (this.data.hasOtherCard && !this.data.birthCountryData.selected) { |
| 1213 | 1234 | this.showtoast('请选择出生国家'); |
| 1214 | 1235 | return |
| ... | ... | @@ -1399,19 +1420,14 @@ Page({ |
| 1399 | 1420 | }, |
| 1400 | 1421 | success: function(res) { |
| 1401 | 1422 | console.log(res) |
| 1402 | - if (res.statusCode == 200) { | |
| 1423 | + if (res.statusCode < 300) { | |
| 1403 | 1424 | wx.navigateBack({ |
| 1404 | 1425 | delta:1 |
| 1405 | 1426 | }) |
| 1406 | - // ({ | |
| 1407 | - // url: '../home/home', | |
| 1408 | - // }) | |
| 1409 | - } else if (res.data.code == 400){ | |
| 1410 | - if (res.data.errors.email){ | |
| 1411 | - that.showtoast('邮箱格式有误') | |
| 1412 | - }else{ | |
| 1413 | - that.showtoast(res.data.message) | |
| 1414 | - } | |
| 1427 | + } else if (res.data.code == 400 && res.data.errors.email){ | |
| 1428 | + that.showtoast('邮箱格式有误') | |
| 1429 | + } else { | |
| 1430 | + that.showtoast(res.data.message ? res.data.message : '请求出错') | |
| 1415 | 1431 | } |
| 1416 | 1432 | }, |
| 1417 | 1433 | fail(res) { | ... | ... |
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | <text class='text_777_30 float_left' style='line-height: 90rpx'>证照号码</text> |
| 30 | 30 | <view> |
| 31 | 31 | <image wx:if="{{isIdCard}}" class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden="{{taxInfo.certification_status=='active' && taxInfo.id_card_no.length>0}}"></image> |
| 32 | - <input class='input_wrap' disabled="{{taxInfo.certification_status=='active' && taxInfo.id_card_no.length>0}}" placeholder="请输入证照号码" value="{{card_number}}" name='id_card_no' maxlength='30' bindblur='idcardblur' bindinput = 'bindinputcardnum'></input> | |
| 32 | + <input class='input_wrap' disabled="{{taxInfo.certification_status=='active' && taxInfo.id_card_no.length>0}}" placeholder="请输入证照号码" value="{{card_number}}" name='id_card_no' maxlength='20' bindblur='idcardblur' bindinput = 'bindinputcardnum'></input> | |
| 33 | 33 | <!-- <input class='input_wrap' hidden="{{taxInfo.certification_status=='active'}}" placeholder="请输入证照号码" value='{{card_number}}' name='id_card_no' maxlength='18' bindblur='idcardblur' bindinput = 'bindinputcardnum'></input> |
| 34 | 34 | <input class='input_wrap' hidden="{{taxInfo.certification_status!='active'}}" placeholder="{{card_number?card_number:'身份证号获取失败'}}" name='id_card_no' disabled='true'></input> --> |
| 35 | 35 | <view class="divide_line_30"></view> |
| ... | ... | @@ -79,7 +79,7 @@ |
| 79 | 79 | <text class='red_star_right_10'>*</text> |
| 80 | 80 | <text class='text_777_30 float_left' style='line-height: 90rpx'>其他证照号码</text> |
| 81 | 81 | <view> |
| 82 | - <input class='input_wrap' placeholder="请输入证照号码" value="{{other_card_number}}" name='other_card_number' maxlength='30'></input> | |
| 82 | + <input class='input_wrap' placeholder="请输入证照号码" value="{{other_card_number}}" name='other_card_number' maxlength='20'></input> | |
| 83 | 83 | </view> |
| 84 | 84 | </view> |
| 85 | 85 | <view class="divide_line_30"></view> | ... | ... |
请
注册
或
登录
后发表评论