提交 02449dab66b6e2300d1f3bd1dda6e99c4e003b2c

作者 pangy
2 个父辈 aa0eb179 ccab6c88

Merge branch '机器人' into 海峡

# Conflicts:
#	app.js

14.6 KB | 宽: | 高:

3.7 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
@@ -157,10 +157,20 @@ Page({ @@ -157,10 +157,20 @@ Page({
157 if (this.data.cardtype.length < 1) { 157 if (this.data.cardtype.length < 1) {
158 this.showToast("请选择证照类型") 158 this.showToast("请选择证照类型")
159 return; 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 this.showToast("请输入证件号码") 162 this.showToast("请输入证件号码")
162 return; 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 this.showToast("证件号码有误") 174 this.showToast("证件号码有误")
165 return; 175 return;
166 } 176 }
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
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> 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 </view> 29 </view>
30 <view wx:else> 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 </view> 32 </view>
33 </view> 33 </view>
34 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> 34 <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view>
1 // pages/main/addtionalreduce/addextrainfo/addextrainfo.js 1 // pages/main/addtionalreduce/addextrainfo/addextrainfo.js
2 var format = require('../../../../utils/util.js'); 2 var format = require('../../../../utils/util.js');
3 // var countryInfo = require('../../../../utils/country.js'); 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 const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; 6 const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
5 var OSSInit; 7 var OSSInit;
6 var app = getApp(); 8 var app = getApp();
@@ -1437,6 +1439,7 @@ Page({ @@ -1437,6 +1439,7 @@ Page({
1437 // return bank_name 1439 // return bank_name
1438 // }, 1440 // },
1439 1441
  1442 +
1440 formSubmit: function(e) { 1443 formSubmit: function(e) {
1441 console.log("formSubmit", e); 1444 console.log("formSubmit", e);
1442 var formdata = e.detail.value 1445 var formdata = e.detail.value
@@ -1454,7 +1457,15 @@ Page({ @@ -1454,7 +1457,15 @@ Page({
1454 return 1457 return
1455 } 1458 }
1456 if (this.data.isIdCard_child && !format.isIDCardNum(formdata.children_id_card_no)) { 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 return 1469 return
1459 } 1470 }
1460 if (format.getAge(this.data.commonbirthDate.selected) < 3) { 1471 if (format.getAge(this.data.commonbirthDate.selected) < 3) {
@@ -1537,9 +1548,18 @@ Page({ @@ -1537,9 +1548,18 @@ Page({
1537 this.showToast('请填写配偶证照号码') 1548 this.showToast('请填写配偶证照号码')
1538 return 1549 return
1539 } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) { 1550 } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) {
1540 - this.showToast('配偶身份证格式有误') 1551 + this.showToast('配偶证照号码有误')
1541 return 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 this.showToast('请选择配偶出生日期') 1563 this.showToast('请选择配偶出生日期')
1544 return 1564 return
1545 } 1565 }
@@ -1658,6 +1678,14 @@ Page({ @@ -1658,6 +1678,14 @@ Page({
1658 this.showToast('被赡养人身份证格式有误') 1678 this.showToast('被赡养人身份证格式有误')
1659 return 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 if (this.data.olderbirthDate.selected.length < 1) { 1689 if (this.data.olderbirthDate.selected.length < 1) {
1662 this.showToast('请选择出生日期') 1690 this.showToast('请选择出生日期')
1663 return 1691 return
@@ -1737,7 +1765,6 @@ Page({ @@ -1737,7 +1765,6 @@ Page({
1737 break; 1765 break;
1738 case 'house_fund': 1766 case 'house_fund':
1739 subUrl = 'persontax/v1/house-funds' 1767 subUrl = 'persontax/v1/house-funds'
1740 - console.log('TITLE', this.data.title)  
1741 1768
1742 if (this.data.house_type == "house_fund_loan") { 1769 if (this.data.house_type == "house_fund_loan") {
1743 newdata.type = 'loan' 1770 newdata.type = 'loan'
@@ -1840,9 +1867,17 @@ Page({ @@ -1840,9 +1867,17 @@ Page({
1840 // this.showToast('请填写证照号码') 1867 // this.showToast('请填写证照号码')
1841 // return 1868 // return
1842 } else if (this.data.isIdCard_owner && !format.isIDCardNum(formdata.owner_id_card_no)) { 1869 } else if (this.data.isIdCard_owner && !format.isIDCardNum(formdata.owner_id_card_no)) {
1843 - this.showToast('身份证格式有误') 1870 + this.showToast('证照号码有误')
1844 return 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 newdata.owner_id_card_type = this.data.cardtypeData.selected 1881 newdata.owner_id_card_type = this.data.cardtypeData.selected
1847 } 1882 }
1848 // if (this.data.rentLocateInfo.address_value[0].length < 1) { 1883 // if (this.data.rentLocateInfo.address_value[0].length < 1) {
@@ -1900,7 +1935,16 @@ Page({ @@ -1900,7 +1935,16 @@ Page({
1900 } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) { 1935 } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) {
1901 this.showToast('配偶身份证格式有误') 1936 this.showToast('配偶身份证格式有误')
1902 return 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 this.showToast('请选择配偶出生日期') 1948 this.showToast('请选择配偶出生日期')
1905 return 1949 return
1906 } 1950 }
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <text class='text_777_30 float_left' style='line-height: 90rpx'>子女证照号码</text> 13 <text class='text_777_30 float_left' style='line-height: 90rpx'>子女证照号码</text>
14 <view wx:if="{{isIdCard}}"> 14 <view wx:if="{{isIdCard}}">
15 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no" hidden='{{!isIdCard_child}}'></image> 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 </view> 17 </view>
18 <!-- <view wx:else> 18 <!-- <view wx:else>
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> 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,7 +142,7 @@
142 <text class='text_777_30 float_left'>被赡养人证照号码</text> 142 <text class='text_777_30 float_left'>被赡养人证照号码</text>
143 <view> 143 <view>
144 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="older_id_card_no" hidden='{{!isIdCard_older}}'></image> 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 </view> 146 </view>
147 </view> 147 </view>
148 <view class='divide_line_30'></view> 148 <view class='divide_line_30'></view>
@@ -313,7 +313,7 @@ @@ -313,7 +313,7 @@
313 <text class='text_777_30 float_left head_in'>证照号码</text> 313 <text class='text_777_30 float_left head_in'>证照号码</text>
314 <view> 314 <view>
315 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no" hidden='{{!isIdCard_owner}}'></image> 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 </view> 317 </view>
318 </view> 318 </view>
319 </view> 319 </view>
@@ -372,7 +372,7 @@ @@ -372,7 +372,7 @@
372 <text class='text_777_30 float_left head_in'>配偶证照号码</text> 372 <text class='text_777_30 float_left head_in'>配偶证照号码</text>
373 <view> 373 <view>
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}}' --> 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 </view> 376 </view>
377 </view> 377 </view>
378 <view class='divide_line_30'></view> 378 <view class='divide_line_30'></view>
@@ -58,8 +58,9 @@ Page({ @@ -58,8 +58,9 @@ Page({
58 selectdata: options.select_data ? JSON.parse(options.select_data) : {} 58 selectdata: options.select_data ? JSON.parse(options.select_data) : {}
59 }) 59 })
60 if (options.type == '1' && options.select_data && JSON.parse(options.select_data)) { 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,7 +77,7 @@ Page({
76 77
77 }, 78 },
78 79
79 - handleData: function(data) { 80 + handleData: function(data,completedata) {
80 var selectarray = data.addition_items; 81 var selectarray = data.addition_items;
81 console.log("handleData", data) 82 console.log("handleData", data)
82 var selectIndex = this.data.selectIndex; 83 var selectIndex = this.data.selectIndex;
@@ -88,19 +89,19 @@ Page({ @@ -88,19 +89,19 @@ Page({
88 for (var i = 0; i < selectarray.length; i++) { 89 for (var i = 0; i < selectarray.length; i++) {
89 if (selectarray[i].addition_category == 'children_education') { //子女教育 90 if (selectarray[i].addition_category == 'children_education') { //子女教育
90 selectIndex[0].sureid = true 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 if (selectarray[i].addition_category == 'continuing_education') { //继续教育 94 if (selectarray[i].addition_category == 'continuing_education') { //继续教育
94 selectIndex[1].sureid = true 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 if (selectarray[i].addition_category == 'support_duty') { //赡养老人 98 if (selectarray[i].addition_category == 'support_duty') { //赡养老人
98 selectIndex[2].sureid = true 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 if (selectarray[i].addition_category == 'house_fund_rent') { //住房(租房) 102 if (selectarray[i].addition_category == 'house_fund_rent') { //住房(租房)
102 selectIndex[3].sureid = true 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 this.setData({ 105 this.setData({
105 flag_housing01: false, 106 flag_housing01: false,
106 flag_housing02: true, 107 flag_housing02: true,
@@ -108,7 +109,7 @@ Page({ @@ -108,7 +109,7 @@ Page({
108 } 109 }
109 if (selectarray[i].addition_category == 'house_fund_loan') { //住房(租房) 110 if (selectarray[i].addition_category == 'house_fund_loan') { //住房(租房)
110 selectIndex[3].sureid = true 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 this.setData({ 113 this.setData({
113 flag_housing01: true, 114 flag_housing01: true,
114 flag_housing02: false, 115 flag_housing02: false,
@@ -11,6 +11,7 @@ Page({ @@ -11,6 +11,7 @@ Page({
11 is_declared: false, 11 is_declared: false,
12 hascompleted:false, 12 hascompleted:false,
13 additionlist: [], 13 additionlist: [],
  14 + complete_item:[],
14 declareStatus: { 15 declareStatus: {
15 "to_declare ": "待申报", 16 "to_declare ": "待申报",
16 "declaring": "申报中", 17 "declaring": "申报中",
@@ -53,7 +54,7 @@ Page({ @@ -53,7 +54,7 @@ Page({
53 console.log("goupdate", e); 54 console.log("goupdate", e);
54 var newdata = this.data.additionlist[e.currentTarget.id] 55 var newdata = this.data.additionlist[e.currentTarget.id]
55 wx.navigateTo({ 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,6 +110,7 @@ Page({
109 if (res && res.data) { 110 if (res && res.data) {
110 console.log("res", res) 111 console.log("res", res)
111 that.setData({ 112 that.setData({
  113 + complete_item: res.data.complete_item,
112 additionlist: that.handleData(res.data.items) 114 additionlist: that.handleData(res.data.items)
113 }) 115 })
114 } 116 }
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <!-- <view wx:if="{{item.status=='to_declare'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> --> 9 <!-- <view wx:if="{{item.status=='to_declare'}}" class='view_godeclare_wrap' bindtap='godeclare' id='{{idx01}}'> -->
10 立即申报 10 立即申报
11 </view> 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 </view> 14 </view>
15 </view> 15 </view>
@@ -120,6 +120,26 @@ Page({ @@ -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,9 +55,13 @@
55 </view> 55 </view>
56 <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image> 56 <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image>
57 </view> --> 57 </view> -->
  58 +
  59 + <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> -->
58 </view> 60 </view>
59 </scroll-view> 61 </scroll-view>
60 - 62 +
61 <image class='chat-img' bindtap='gochat' src='/images/icon_chat.png'></image> 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 </view> 67 </view>
@@ -60,8 +60,16 @@ text_wrap_sub_999 { @@ -60,8 +60,16 @@ text_wrap_sub_999 {
60 } 60 }
61 61
62 .chat-img { 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 position: fixed; 73 position: fixed;
66 right: 40rpx; 74 right: 40rpx;
67 bottom: 40rpx; 75 bottom: 40rpx;
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 var app = getApp(); 2 var app = getApp();
3 var format = require('../../../../utils/util.js'); 3 var format = require('../../../../utils/util.js');
4 var baseUrl = app.globalData.baseUrl; 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 // const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; 7 // const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
6 const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; 8 const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
7 Page({ 9 Page({
@@ -418,7 +420,13 @@ Page({ @@ -418,7 +420,13 @@ Page({
418 if (this.data.card_number.length < 1) { 420 if (this.data.card_number.length < 1) {
419 this.showtoast('请填写证照号码'); 421 this.showtoast('请填写证照号码');
420 return 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 this.showtoast('证照号码有误'); 430 this.showtoast('证照号码有误');
423 return 431 return
424 } 432 }
@@ -519,12 +527,12 @@ Page({ @@ -519,12 +527,12 @@ Page({
519 success: function(res) { 527 success: function(res) {
520 console.log(res) 528 console.log(res)
521 wx.hideLoading() 529 wx.hideLoading()
522 - if (res.statusCode == 200) { 530 + if (res.statusCode < 300) {
523 wx.navigateBack({ 531 wx.navigateBack({
524 delta: 1 532 delta: 1
525 }) 533 })
526 } else { 534 } else {
527 - that.showtoast(res.data.message) 535 + that.showtoast(res.data.message ? res.data.message : '请求出错')
528 } 536 }
529 }, 537 },
530 fail(res) { 538 fail(res) {
@@ -577,55 +585,106 @@ Page({ @@ -577,55 +585,106 @@ Page({
577 // }) 585 // })
578 // } 586 // }
579 }, 587 },
580 - 588 +
581 idChange: function (e) { 589 idChange: function (e) {
582 - console.log('idCardNoChange', e.detail.value)  
583 var idCardNo = e.detail.value 590 var idCardNo = e.detail.value
584 this.setData({ 591 this.setData({
585 card_number: idCardNo 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 return; 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 idDone: function (e) { 616 idDone: function (e) {
602 var idCardNo = e.detail.value 617 var idCardNo = e.detail.value
603 this.setData({ 618 this.setData({
604 card_number: idCardNo 619 card_number: idCardNo
605 }) 620 })
606 - if (!this.data.isIdCard) {  
607 - return;  
608 - }  
609 if (!idCardNo.length) { 621 if (!idCardNo.length) {
610 - wx.showToast({  
611 - image: "../../../../images/warn.png",  
612 - title: '请输入身份证号'  
613 - }) 622 + this.showtoast('请输入证照号码');
614 return; 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 return; 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,7 +27,7 @@
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> 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 </view> 28 </view>
29 <view wx:else> 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 </view> 31 </view>
32 </view> 32 </view>
33 <view class="divide_line_30"></view> 33 <view class="divide_line_30"></view>
@@ -63,9 +63,10 @@ @@ -63,9 +63,10 @@
63 </view> 63 </view>
64 </view> 64 </view>
65 </view> 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 </view> 70 </view>
70 </form> 71 </form>
71 </view> 72 </view>
@@ -127,4 +127,43 @@ input[disabled]{ @@ -127,4 +127,43 @@ input[disabled]{
127 height: 40rpx; 127 height: 40rpx;
128 float: right; 128 float: right;
129 margin-top:24rpx; 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 }
1 var format = require('../../../../utils/util.js'); 1 var format = require('../../../../utils/util.js');
2 var app = getApp(); 2 var app = getApp();
3 var baseUrl = app.globalData.baseUrl; 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 // var countryInfo = require('../../../../utils/country.js'); 6 // var countryInfo = require('../../../../utils/country.js');
5 // const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; 7 // const cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
6 const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; 8 const cardTypeArray8 = ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
@@ -1077,41 +1079,48 @@ Page({ @@ -1077,41 +1079,48 @@ Page({
1077 this.setData({ 1079 this.setData({
1078 card_number: idCardNo 1080 card_number: idCardNo
1079 }) 1081 })
1080 - if (!this.data.isIdCard) {  
1081 - return;  
1082 - }  
1083 if (!idCardNo.length) { 1082 if (!idCardNo.length) {
1084 - wx.showToast({  
1085 - image: "../../../../images/warn.png",  
1086 - title: '请输入身份证号'  
1087 - }) 1083 + this.showtoast('请输入证照号码');
1088 return; 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 return; 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 bindinputcardnum: function(e) { 1100 bindinputcardnum: function(e) {
1099 var idCardNo = e.detail.value 1101 var idCardNo = e.detail.value
1100 this.setData({ 1102 this.setData({
1101 card_number: idCardNo 1103 card_number: idCardNo
1102 }) 1104 })
1103 - if (!this.data.isIdCard) {  
1104 - return;  
1105 - }  
1106 if (e.detail.value.length == 18) { 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 return; 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,7 +1175,13 @@ Page({
1166 if (this.data.card_number.length < 1) { 1175 if (this.data.card_number.length < 1) {
1167 this.showtoast('请填写证照号码'); 1176 this.showtoast('请填写证照号码');
1168 return 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 this.showtoast('证照号码有误'); 1185 this.showtoast('证照号码有误');
1171 return 1186 return
1172 } 1187 }
@@ -1208,7 +1223,13 @@ Page({ @@ -1208,7 +1223,13 @@ Page({
1208 if (this.data.hasOtherCard && !formdata.other_card_number.length) { 1223 if (this.data.hasOtherCard && !formdata.other_card_number.length) {
1209 this.showtoast('请输入其他证照号码'); 1224 this.showtoast('请输入其他证照号码');
1210 return 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 if (this.data.hasOtherCard && !this.data.birthCountryData.selected) { 1233 if (this.data.hasOtherCard && !this.data.birthCountryData.selected) {
1213 this.showtoast('请选择出生国家'); 1234 this.showtoast('请选择出生国家');
1214 return 1235 return
@@ -1399,19 +1420,14 @@ Page({ @@ -1399,19 +1420,14 @@ Page({
1399 }, 1420 },
1400 success: function(res) { 1421 success: function(res) {
1401 console.log(res) 1422 console.log(res)
1402 - if (res.statusCode == 200) { 1423 + if (res.statusCode < 300) {
1403 wx.navigateBack({ 1424 wx.navigateBack({
1404 delta:1 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 fail(res) { 1433 fail(res) {
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <text class='text_777_30 float_left' style='line-height: 90rpx'>证照号码</text> 29 <text class='text_777_30 float_left' style='line-height: 90rpx'>证照号码</text>
30 <view> 30 <view>
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> 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 <!-- <input class='input_wrap' hidden="{{taxInfo.certification_status=='active'}}" placeholder="请输入证照号码" value='{{card_number}}' name='id_card_no' maxlength='18' bindblur='idcardblur' bindinput = 'bindinputcardnum'></input> 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 <input class='input_wrap' hidden="{{taxInfo.certification_status!='active'}}" placeholder="{{card_number?card_number:'身份证号获取失败'}}" name='id_card_no' disabled='true'></input> --> 34 <input class='input_wrap' hidden="{{taxInfo.certification_status!='active'}}" placeholder="{{card_number?card_number:'身份证号获取失败'}}" name='id_card_no' disabled='true'></input> -->
35 <view class="divide_line_30"></view> 35 <view class="divide_line_30"></view>
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 <text class='red_star_right_10'>*</text> 79 <text class='red_star_right_10'>*</text>
80 <text class='text_777_30 float_left' style='line-height: 90rpx'>其他证照号码</text> 80 <text class='text_777_30 float_left' style='line-height: 90rpx'>其他证照号码</text>
81 <view> 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 </view> 83 </view>
84 </view> 84 </view>
85 <view class="divide_line_30"></view> 85 <view class="divide_line_30"></view>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "ignore": [] 4 "ignore": []
5 }, 5 },
6 "setting": { 6 "setting": {
7 - "urlCheck": false, 7 + "urlCheck": true,
8 "es6": true, 8 "es6": true,
9 "postcss": true, 9 "postcss": true,
10 "minified": true, 10 "minified": true,
注册登录 后发表评论