提交 bfa7b542574405962a781ec72e4c57d9c0fcfc99

作者 pangy
1 个父辈 21168da3

初步完成

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 cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'];
4 var OSSInit; 5 var OSSInit;
5 var app = getApp(); 6 var app = getApp();
6 var baseUrl = app.globalData.baseUrl; 7 var baseUrl = app.globalData.baseUrl;
@@ -68,9 +69,7 @@ Page({ @@ -68,9 +69,7 @@ Page({
68 // selected: '居民身份证', 69 // selected: '居民身份证',
69 disabled: true, 70 disabled: true,
70 placeholder: '请选择证照类型', 71 placeholder: '请选择证照类型',
71 - values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照',  
72 - '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'  
73 - ], 72 + values: cardTypeArray,
74 onChange: 'onPickerSelect' 73 onChange: 'onPickerSelect'
75 }, 74 },
76 loverbirthDate: { 75 loverbirthDate: {
@@ -121,12 +120,10 @@ Page({ @@ -121,12 +120,10 @@ Page({
121 isrequre: true, 120 isrequre: true,
122 bindtype: 'childrencardtype', 121 bindtype: 'childrencardtype',
123 selected: '居民身份证', 122 selected: '居民身份证',
124 - disabled: true, 123 + // disabled: true,
125 isblack: 'true', 124 isblack: 'true',
126 placeholder: '请选择证照类型', 125 placeholder: '请选择证照类型',
127 - values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照',  
128 - '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'  
129 - ], 126 + values: cardTypeArray,
130 onChange: 'onPickerSelect' 127 onChange: 'onPickerSelect'
131 }, 128 },
132 commonbirthDate: { 129 commonbirthDate: {
@@ -226,14 +223,12 @@ Page({ @@ -226,14 +223,12 @@ Page({
226 oldercardtypeData: { 223 oldercardtypeData: {
227 label: '被赡养人证照类型', 224 label: '被赡养人证照类型',
228 isrequre: true, 225 isrequre: true,
229 - disabled: true, 226 + // disabled: true,
230 bindtype: 'oldercardtype', 227 bindtype: 'oldercardtype',
231 selected: '居民身份证', 228 selected: '居民身份证',
232 isblack: 'true', 229 isblack: 'true',
233 placeholder: '请选择被赡养人证照类型', 230 placeholder: '请选择被赡养人证照类型',
234 - values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照',  
235 - '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'  
236 - ], 231 + values: cardTypeArray,
237 onChange: 'onPickerSelect' 232 onChange: 'onPickerSelect'
238 }, 233 },
239 cardtypeData: { 234 cardtypeData: {
@@ -510,12 +505,28 @@ Page({ @@ -510,12 +505,28 @@ Page({
510 label: '国籍', 505 label: '国籍',
511 bindtype: 'country', 506 bindtype: 'country',
512 isrequre: true, 507 isrequre: true,
513 - disabled: true, 508 + // disabled: true,
514 selected: '中国', 509 selected: '中国',
515 // range_key:'name', 510 // range_key:'name',
516 placeholder: '请选择国籍', 511 placeholder: '请选择国籍',
517 onChange: 'onPickerSelect', 512 onChange: 'onPickerSelect',
518 }, 513 },
  514 + loverCountryData: {
  515 + label: '国籍',
  516 + bindtype: 'lover_country',
  517 + // isrequre: true,
  518 + selected: '中国',
  519 + placeholder: '请选择国籍',
  520 + onChange: 'onPickerSelect',
  521 + },
  522 + olderCountryData: {
  523 + label: '被赡养人国籍',
  524 + bindtype: 'older_country',
  525 + isrequre: true,
  526 + selected: '中国',
  527 + placeholder: '请选择国籍',
  528 + onChange: 'onPickerSelect',
  529 + },
519 // bankInfo: { 530 // bankInfo: {
520 // label: '公积金贷款银行', 531 // label: '公积金贷款银行',
521 // bindtype: 'bank', 532 // bindtype: 'bank',
@@ -729,7 +740,9 @@ Page({ @@ -729,7 +740,9 @@ Page({
729 that.data.loverbirthDate.selected = format.formatTime_date(data.birth_date) 740 that.data.loverbirthDate.selected = format.formatTime_date(data.birth_date)
730 that.data.loverbirthDate.datelong = data.birth_date 741 that.data.loverbirthDate.datelong = data.birth_date
731 setData.loverbirthDate = that.data.loverbirthDate 742 setData.loverbirthDate = that.data.loverbirthDate
732 - setData.lover_country = data.native 743 + that.data.loverCountryData.selected = data.native
  744 + that.data.loverCountryData.disabled = true
  745 + setData.loverCountryData = that.data.loverCountryData
733 that.setData(setData) 746 that.setData(setData)
734 } 747 }
735 }, 748 },
@@ -787,6 +800,7 @@ Page({ @@ -787,6 +800,7 @@ Page({
787 that.data.schoolCountryData.values = res.data 800 that.data.schoolCountryData.values = res.data
788 that.countrys = countrys 801 that.countrys = countrys
789 that.setData({ 802 that.setData({
  803 + ///////////////////////////需对照addinfo完善
790 // countryData: that.data.countryData, 804 // countryData: that.data.countryData,
791 schoolCountryData: that.data.schoolCountryData 805 schoolCountryData: that.data.schoolCountryData
792 }) 806 })
@@ -802,8 +816,9 @@ Page({ @@ -802,8 +816,9 @@ Page({
802 console.log('data===', data) 816 console.log('data===', data)
803 switch (this.data.cur_index + '') { 817 switch (this.data.cur_index + '') {
804 case 'children_education': 818 case 'children_education':
  819 + this.dealCardType(data.children_id_card_type, 'childrencardtype')//为防止干扰其他字段,需要先执行
805 var setData = {} 820 var setData = {}
806 - this.data.countryData.selected = data.native 821 + this.data.countryData.selected = data.children_nation
807 setData.countryData = this.data.countryData 822 setData.countryData = this.data.countryData
808 if (data.relationship && data.relationship.length) { 823 if (data.relationship && data.relationship.length) {
809 this.data.taxperson_relativeData.selected = data.relationship 824 this.data.taxperson_relativeData.selected = data.relationship
@@ -837,7 +852,7 @@ Page({ @@ -837,7 +852,7 @@ Page({
837 setData.deduction_amount = data.deduction_amount 852 setData.deduction_amount = data.deduction_amount
838 if (data.children_id_card_no && data.children_id_card_no.length) { 853 if (data.children_id_card_no && data.children_id_card_no.length) {
839 setData.children_id_card_no = data.children_id_card_no 854 setData.children_id_card_no = data.children_id_card_no
840 - if ('居民身份证' == data.id_card_type) { 855 + if ('居民身份证' == data.children_id_card_type) {
841 this.dealIdInfo(data.children_id_card_no, 'children_id_card_no_input') 856 this.dealIdInfo(data.children_id_card_no, 'children_id_card_no_input')
842 } 857 }
843 } 858 }
@@ -870,9 +885,10 @@ Page({ @@ -870,9 +885,10 @@ Page({
870 if (data.spouse_name && data.spouse_name.length) { 885 if (data.spouse_name && data.spouse_name.length) {
871 setData.spouse_name = data.spouse_name 886 setData.spouse_name = data.spouse_name
872 } 887 }
  888 + this.dealCardType(data.spouse_id_card_type, 'lovercardtype')
873 if (data.spouse_id_card_no && data.spouse_id_card_no.length) { 889 if (data.spouse_id_card_no && data.spouse_id_card_no.length) {
874 setData.spouse_id_card_no = data.spouse_id_card_no 890 setData.spouse_id_card_no = data.spouse_id_card_no
875 - if ('居民身份证' == data.id_card_type) { 891 + if ('居民身份证' == data.spouse_id_card_type) {
876 this.dealIdInfo(data.spouse_id_card_no, 'spouse_id_card_no_input') 892 this.dealIdInfo(data.spouse_id_card_no, 'spouse_id_card_no_input')
877 } 893 }
878 } 894 }
@@ -936,6 +952,7 @@ Page({ @@ -936,6 +952,7 @@ Page({
936 this.setData(setData) 952 this.setData(setData)
937 break; 953 break;
938 case 'support_duty': 954 case 'support_duty':
  955 + this.dealCardType(data.id_card_type, 'oldercardtype')//为防止干扰其他字段,需要先执行
939 var setData = {} 956 var setData = {}
940 var olderbirthDate = this.data.olderbirthDate 957 var olderbirthDate = this.data.olderbirthDate
941 olderbirthDate.selected = format.formatTime_date(data.birth_date) 958 olderbirthDate.selected = format.formatTime_date(data.birth_date)
@@ -992,6 +1009,7 @@ Page({ @@ -992,6 +1009,7 @@ Page({
992 if (data.spouse_name && data.spouse_name.length) { 1009 if (data.spouse_name && data.spouse_name.length) {
993 setData.spouse_name = data.spouse_name 1010 setData.spouse_name = data.spouse_name
994 } 1011 }
  1012 + this.dealCardType(data.spouse_id_card_type, 'lovercardtype')
995 if (data.id_card_no && data.id_card_no.length) { 1013 if (data.id_card_no && data.id_card_no.length) {
996 setData.spouse_id_card_no = data.id_card_no 1014 setData.spouse_id_card_no = data.id_card_no
997 if ('居民身份证' == data.id_card_type) { 1015 if ('居民身份证' == data.id_card_type) {
@@ -1122,8 +1140,10 @@ Page({ @@ -1122,8 +1140,10 @@ Page({
1122 }, 1140 },
1123 1141
1124 handleTransData: function(data) { 1142 handleTransData: function(data) {
  1143 + console.log('data==',data)
1125 switch (this.data.cur_index + '') { 1144 switch (this.data.cur_index + '') {
1126 case 'children_education': 1145 case 'children_education':
  1146 + this.dealCardType(data.id_card_type, 'childrencardtype')//为防止干扰其他字段,需要先执行
1127 var setData = {} 1147 var setData = {}
1128 this.data.countryData.selected = data.native 1148 this.data.countryData.selected = data.native
1129 setData.countryData = this.data.countryData 1149 setData.countryData = this.data.countryData
@@ -1148,6 +1168,7 @@ Page({ @@ -1148,6 +1168,7 @@ Page({
1148 this.setData(setData) 1168 this.setData(setData)
1149 break; 1169 break;
1150 case 'support_duty': 1170 case 'support_duty':
  1171 + this.dealCardType(data.id_card_type, 'oldercardtype')//为防止干扰其他字段,需要先执行
1151 var setData = {} 1172 var setData = {}
1152 var olderbirthDate = this.data.olderbirthDate 1173 var olderbirthDate = this.data.olderbirthDate
1153 olderbirthDate.selected = format.formatTime_date(data.birth_date) 1174 olderbirthDate.selected = format.formatTime_date(data.birth_date)
@@ -1399,7 +1420,7 @@ Page({ @@ -1399,7 +1420,7 @@ Page({
1399 this.showToast('请填写子女证照号码') 1420 this.showToast('请填写子女证照号码')
1400 return 1421 return
1401 } 1422 }
1402 - if (!format.isIDCardNum(formdata.children_id_card_no)) { 1423 + if (this.data.isIdCard_child && !format.isIDCardNum(formdata.children_id_card_no)) {
1403 this.showToast('身份证格式有误') 1424 this.showToast('身份证格式有误')
1404 return 1425 return
1405 } 1426 }
@@ -1470,7 +1491,7 @@ Page({ @@ -1470,7 +1491,7 @@ Page({
1470 } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) { 1491 } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
1471 this.showToast('请填写配偶证照号码') 1492 this.showToast('请填写配偶证照号码')
1472 return 1493 return
1473 - } else if (!format.isIDCardNum(formdata.spouse_id_card_no)) { 1494 + } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) {
1474 this.showToast('配偶身份证格式有误') 1495 this.showToast('配偶身份证格式有误')
1475 return 1496 return
1476 }else if (this.data.loverbirthDate.selected.length < 1) { 1497 }else if (this.data.loverbirthDate.selected.length < 1) {
@@ -1490,7 +1511,7 @@ Page({ @@ -1490,7 +1511,7 @@ Page({
1490 newdata.education_start = this.data.studystartdate.datelong 1511 newdata.education_start = this.data.studystartdate.datelong
1491 newdata.education_period = this.data.childedudegreeData.selected 1512 newdata.education_period = this.data.childedudegreeData.selected
1492 newdata.school_country = this.data.schoolCountryData.selected 1513 newdata.school_country = this.data.schoolCountryData.selected
1493 - newdata.children_nation = "中国" 1514 + newdata.children_nation = this.data.countryData.selected//"中国"
1494 newdata.nation = "中国" 1515 newdata.nation = "中国"
1495 break; 1516 break;
1496 case 'continuing_education': 1517 case 'continuing_education':
@@ -1584,7 +1605,7 @@ Page({ @@ -1584,7 +1605,7 @@ Page({
1584 } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) { 1605 } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) {
1585 this.showToast('请填写被赡养人证照号') 1606 this.showToast('请填写被赡养人证照号')
1586 return 1607 return
1587 - } else if (!format.isIDCardNum(formdata.id_card_no)) { 1608 + } else if (this.data.isIdCard_older && !format.isIDCardNum(formdata.id_card_no)) {
1588 this.showToast('被赡养人身份证格式有误') 1609 this.showToast('被赡养人身份证格式有误')
1589 return 1610 return
1590 } 1611 }
@@ -1815,7 +1836,7 @@ Page({ @@ -1815,7 +1836,7 @@ Page({
1815 } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) { 1836 } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
1816 this.showToast('请填写配偶证照号码') 1837 this.showToast('请填写配偶证照号码')
1817 return 1838 return
1818 - } else if (!format.isIDCardNum(formdata.spouse_id_card_no)) { 1839 + } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) {
1819 this.showToast('配偶身份证格式有误') 1840 this.showToast('配偶身份证格式有误')
1820 return 1841 return
1821 } else if (this.data.loverbirthDate.selected.length < 1) { 1842 } else if (this.data.loverbirthDate.selected.length < 1) {
@@ -1907,18 +1928,70 @@ Page({ @@ -1907,18 +1928,70 @@ Page({
1907 }, 1928 },
1908 idChange: function (e) { 1929 idChange: function (e) {
1909 console.log('idCardNoChange',e, e.detail.value) 1930 console.log('idCardNoChange',e, e.detail.value)
  1931 + switch (e.currentTarget.id) {
  1932 + case 'children_id_card_no_input':
  1933 + if (!this.data.isIdCard_child) {
  1934 + return;
  1935 + }
  1936 + break;
  1937 + case 'older_id_card_no_input':
  1938 + if (!this.data.isIdCard_older) {
  1939 + return;
  1940 + }
  1941 + break;
  1942 + case 'spouse_id_card_no_input':
  1943 + if (!this.data.isIdCard_lover) {
  1944 + return;
  1945 + }
  1946 + break;
  1947 + }
1910 var idCardNo = e.detail.value 1948 var idCardNo = e.detail.value
1911 if (e.detail.value.length == 18) { 1949 if (e.detail.value.length == 18) {
1912 if (!format.isIDCardNum(idCardNo)) { 1950 if (!format.isIDCardNum(idCardNo)) {
1913 wx.showToast({ 1951 wx.showToast({
1914 - image: "../../../../images/warn.png",  
1915 - title: '身份证格式有误' 1952 + title: '身份证格式有误',
  1953 + icon:'none'
1916 }) 1954 })
1917 return; 1955 return;
1918 } 1956 }
1919 this.dealIdInfo(idCardNo, e.currentTarget.id) 1957 this.dealIdInfo(idCardNo, e.currentTarget.id)
1920 } 1958 }
1921 }, 1959 },
  1960 +
  1961 + idDone: function (e) {
  1962 + switch (e.currentTarget.id) {
  1963 + case 'children_id_card_no_input':
  1964 + if (!this.data.isIdCard_child) {
  1965 + return;
  1966 + }
  1967 + break;
  1968 + case 'older_id_card_no_input':
  1969 + if (!this.data.isIdCard_older) {
  1970 + return;
  1971 + }
  1972 + break;
  1973 + case 'spouse_id_card_no_input':
  1974 + if (!this.data.isIdCard_lover) {
  1975 + return;
  1976 + }
  1977 + break;
  1978 + }
  1979 + var idCardNo = e.detail.value
  1980 + if (!idCardNo.length) {
  1981 + wx.showToast({
  1982 + title: '请输入身份证号',
  1983 + icon: 'none'
  1984 + })
  1985 + return;
  1986 + }
  1987 + if (!format.isIDCardNum(idCardNo)) {
  1988 + wx.showToast({
  1989 + title: '身份证格式有误',
  1990 + icon: 'none'
  1991 + })
  1992 + return;
  1993 + }
  1994 + },
1922 medicalInput: function (e) { 1995 medicalInput: function (e) {
1923 console.log('-------', e.detail.value) 1996 console.log('-------', e.detail.value)
1924 var num = parseFloat(e.detail.value) 1997 var num = parseFloat(e.detail.value)
@@ -2050,9 +2123,111 @@ Page({ @@ -2050,9 +2123,111 @@ Page({
2050 beforemarryData: this.data.beforemarryData 2123 beforemarryData: this.data.beforemarryData
2051 }) 2124 })
2052 }, 2125 },
  2126 +
  2127 + dealCardType: function (new_type,witch) {
  2128 + var is_idcard, cardtypeData, countryData, birthDate
  2129 + switch (witch) {
  2130 + case 'childrencardtype':
  2131 + countryData = this.data.countryData
  2132 + cardtypeData = this.data.childrencardtypeData
  2133 + birthDate = this.data.commonbirthDate
  2134 + break;
  2135 + case 'lovercardtype':
  2136 + countryData = this.data.loverCountryData
  2137 + cardtypeData = this.data.lovercardtypeData
  2138 + birthDate = this.data.loverbirthDate
  2139 + break;
  2140 + case 'oldercardtype':
  2141 + countryData = this.data.olderCountryData
  2142 + cardtypeData = this.data.oldercardtypeData
  2143 + birthDate = this.data.olderbirthDate
  2144 + break;
  2145 + }
  2146 +
  2147 + cardtypeData.selected = new_type
  2148 + if ('居民身份证' == new_type) {
  2149 + is_idcard = true
  2150 + birthDate.disabled = true
  2151 + } else {
  2152 + is_idcard = false
  2153 + birthDate.disabled = false
  2154 + }
  2155 + if ('居民身份证' == new_type || '中国护照' == new_type) {
  2156 + countryData.selected = '中国'
  2157 + countryData.disabled = true
  2158 + } else if (new_type.indexOf("港澳") != -1) {
  2159 + countryData.values = ['中国香港', '中国澳门']
  2160 + countryData.selected = ''
  2161 + countryData.disabled = false
  2162 + } else if (new_type.indexOf("台湾") != -1) {
  2163 + countryData.selected = '中国台湾'
  2164 + countryData.disabled = true
  2165 + } else {
  2166 + countryData.selected = ''
  2167 + countryData.values = this.countrys ? this.countrys : []
  2168 + countryData.disabled = false
  2169 + }
  2170 + switch (witch) {
  2171 + case 'childrencardtype':
  2172 + this.setData({
  2173 + countryData: countryData,
  2174 + childrencardtypeData: cardtypeData,
  2175 + isIdCard_child: is_idcard,
  2176 + commonbirthDate: birthDate
  2177 + })
  2178 + break;
  2179 + case 'lovercardtype':
  2180 + this.setData({
  2181 + loverCountryData: countryData,
  2182 + lovercardtypeData: cardtypeData,
  2183 + isIdCard_lover: is_idcard,
  2184 + loverbirthDate: birthDate
  2185 + })
  2186 + break;
  2187 + case 'oldercardtype':
  2188 + this.setData({
  2189 + olderCountryData: countryData,
  2190 + oldercardtypeData: cardtypeData,
  2191 + olderbirthDate: birthDate,
  2192 + isIdCard_older: is_idcard,
  2193 + })
  2194 + break;
  2195 + }
  2196 +
  2197 + },
2053 onPickerSelect: function(e) { 2198 onPickerSelect: function(e) {
2054 console.log('picker发送选择改变,携带值为', e) 2199 console.log('picker发送选择改变,携带值为', e)
2055 switch (e.currentTarget.id) { 2200 switch (e.currentTarget.id) {
  2201 + case 'country':
  2202 + var countryData = this.data.countryData
  2203 + var new_country = countryData.values[e.detail.value]
  2204 + if (new_country != countryData.selected) {
  2205 + countryData.selected = new_country
  2206 + this.setData({
  2207 + countryData: countryData
  2208 + })
  2209 + }
  2210 + break;
  2211 + case 'lover_country':
  2212 + var loverCountryData = this.data.loverCountryData
  2213 + var new_country = loverCountryData.values[e.detail.value]
  2214 + if (new_country != loverCountryData.selected) {
  2215 + loverCountryData.selected = new_country
  2216 + this.setData({
  2217 + loverCountryData: loverCountryData
  2218 + })
  2219 + }
  2220 + break;
  2221 + case 'older_country':
  2222 + var olderCountryData = this.data.olderCountryData
  2223 + var new_country = olderCountryData.values[e.detail.value]
  2224 + if (new_country != olderCountryData.selected) {
  2225 + olderCountryData.selected = new_country
  2226 + this.setData({
  2227 + olderCountryData: olderCountryData
  2228 + })
  2229 + }
  2230 + break;
2056 case 'hasLover': 2231 case 'hasLover':
2057 var hasLoverData = this.data.hasLoverData 2232 var hasLoverData = this.data.hasLoverData
2058 hasLoverData.selected = hasLoverData.values[e.detail.value] 2233 hasLoverData.selected = hasLoverData.values[e.detail.value]
@@ -2068,13 +2243,22 @@ Page({ @@ -2068,13 +2243,22 @@ Page({
2068 this.handleHasLover(hasLover) 2243 this.handleHasLover(hasLover)
2069 } 2244 }
2070 break; 2245 break;
  2246 + // case 'lovercardtype':
  2247 + // var lover_cardtypeData = this.data.lovercardtypeData
  2248 + // lover_cardtypeData.selected = lover_cardtypeData.values[e.detail.value]
  2249 + // this.setData({
  2250 + // lovercardtypeData: lover_cardtypeData
  2251 + // })
  2252 + // break;
2071 case 'lovercardtype': 2253 case 'lovercardtype':
2072 - var lover_cardtypeData = this.data.lovercardtypeData  
2073 - lover_cardtypeData.selected = lover_cardtypeData.values[e.detail.value]  
2074 - this.setData({  
2075 - lovercardtypeData: lover_cardtypeData  
2076 - })  
2077 - break; 2254 + var lover_cardtypeData = this.data.lover_cardtypeData
  2255 + var new_type = lover_cardtypeData.values[e.detail.value]
  2256 + if (new_type != lover_cardtypeData.selected) {
  2257 + this.dealCardType(new_type, 'lovercardtype')
  2258 + this.setData({
  2259 + spouse_id_card_no: ""
  2260 + })
  2261 + }
2078 case 'loverbirthday': 2262 case 'loverbirthday':
2079 var lover_birthDate = this.data.loverbirthDate 2263 var lover_birthDate = this.data.loverbirthDate
2080 lover_birthDate.selected = e.detail.value 2264 lover_birthDate.selected = e.detail.value
@@ -2097,12 +2281,22 @@ Page({ @@ -2097,12 +2281,22 @@ Page({
2097 taxperson_relativeData: taxperson_relativedata 2281 taxperson_relativeData: taxperson_relativedata
2098 }) 2282 })
2099 break; 2283 break;
  2284 + // case 'childrencardtype':
  2285 + // var children_cardtypedata = this.data.childrencardtypeData
  2286 + // children_cardtypedata.selected = children_cardtypedata.values[e.detail.value]
  2287 + // this.setData({
  2288 + // childrencardtypeData: children_cardtypedata
  2289 + // })
  2290 + // break;
2100 case 'childrencardtype': 2291 case 'childrencardtype':
2101 - var children_cardtypedata = this.data.childrencardtypeData  
2102 - children_cardtypedata.selected = children_cardtypedata.values[e.detail.value]  
2103 - this.setData({  
2104 - childrencardtypeData: children_cardtypedata  
2105 - }) 2292 + var childrencardtypeData = this.data.childrencardtypeData
  2293 + var new_type = childrencardtypeData.values[e.detail.value]
  2294 + if (new_type != childrencardtypeData.selected) {
  2295 + this.dealCardType(new_type, 'childrencardtype')
  2296 + this.setData({
  2297 + children_id_card_no: ""
  2298 + })
  2299 + }
2106 break; 2300 break;
2107 case 'child_percent': 2301 case 'child_percent':
2108 var childrenpercent_data = this.data.childrenpercentData 2302 var childrenpercent_data = this.data.childrenpercentData
@@ -2231,12 +2425,22 @@ Page({ @@ -2231,12 +2425,22 @@ Page({
2231 // shareMethodData: share_methodData 2425 // shareMethodData: share_methodData
2232 // }) 2426 // })
2233 // break; 2427 // break;
  2428 + // case 'oldercardtype':
  2429 + // var older_cardtypeData = this.data.oldercardtypeData
  2430 + // older_cardtypeData.selected = older_cardtypeData.values[e.detail.value]
  2431 + // this.setData({
  2432 + // oldercardtypeData: older_cardtypeData
  2433 + // })
  2434 + // break;
2234 case 'oldercardtype': 2435 case 'oldercardtype':
2235 - var older_cardtypeData = this.data.oldercardtypeData  
2236 - older_cardtypeData.selected = older_cardtypeData.values[e.detail.value]  
2237 - this.setData({  
2238 - oldercardtypeData: older_cardtypeData  
2239 - }) 2436 + var oldercardtypeData = this.data.oldercardtypeData
  2437 + var new_type = oldercardtypeData.values[e.detail.value]
  2438 + if (new_type != oldercardtypeData.selected) {
  2439 + this.dealCardType(new_type, 'oldercardtype')
  2440 + this.setData({
  2441 + id_card_no: ""
  2442 + })
  2443 + }
2240 break; 2444 break;
2241 case 'olderbirthday': 2445 case 'olderbirthday':
2242 var older_birthDate = this.data.olderbirthDate 2446 var older_birthDate = this.data.olderbirthDate
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 <text class='red_star_right_10'>*</text> 12 <text class='red_star_right_10'>*</text>
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"></image>  
16 - <input class='input_wrap' style='color:#000;' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='children_id_card_no' maxlength='18' type='idcard' value='{{children_id_card_no}}' bindinput="idChange" id='children_id_card_no_input'></input> 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>
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>
@@ -136,19 +136,20 @@ @@ -136,19 +136,20 @@
136 <view style='height:90rpx'> 136 <view style='height:90rpx'>
137 <text class='red_star_right_10'>*</text> 137 <text class='red_star_right_10'>*</text>
138 <text class='text_777_30 float_left'>被赡养人证照号码</text> 138 <text class='text_777_30 float_left'>被赡养人证照号码</text>
139 - <view wx:if="{{isIdCard}}">  
140 - <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="older_id_card_no"></image>  
141 - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入或拍摄身份证' maxlength='18' type='idcard' name='id_card_no' value='{{id_card_no}}' bindinput="idChange" id="older_id_card_no_input"></input> 139 + <view>
  140 + <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="older_id_card_no" hidden='{{!isIdCard_older}}'></image>
  141 + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入或拍摄身份证' maxlength='18' type='idcard' name='id_card_no' value='{{id_card_no}}' bindinput="idChange" bindblur="idDone" id="older_id_card_no_input"></input>
142 </view> 142 </view>
143 </view> 143 </view>
144 <view class='divide_line_30'></view> 144 <view class='divide_line_30'></view>
145 <template is="picker_cell_normal" data="{{...olderbirthDate}}" /> 145 <template is="picker_cell_normal" data="{{...olderbirthDate}}" />
146 <view class='divide_line_30'></view> 146 <view class='divide_line_30'></view>
147 - <view style='height:90rpx'> 147 + <template is="picker_cell_normal" data="{{...olderCountryData}}" />
  148 + <!-- <view style='height:90rpx'>
148 <text class='red_star_right_10'>*</text> 149 <text class='red_star_right_10'>*</text>
149 <text class='text_777_30 float_left'>被赡养人国籍</text> 150 <text class='text_777_30 float_left'>被赡养人国籍</text>
150 <text class='text_black_30 float_right' style='line-height: 90rpx;text-align:right' name='country'>中国</text> 151 <text class='text_black_30 float_right' style='line-height: 90rpx;text-align:right' name='country'>中国</text>
151 - </view> 152 + </view> -->
152 <view class='divide_line_30'></view> 153 <view class='divide_line_30'></view>
153 154
154 <template is="picker_cell_normal" data="{{...older_relativeData}}" /> 155 <template is="picker_cell_normal" data="{{...older_relativeData}}" />
@@ -173,7 +174,7 @@ @@ -173,7 +174,7 @@
173 <view style='height:90rpx'> 174 <view style='height:90rpx'>
174 <text class='red_star_right_10'>*</text> 175 <text class='red_star_right_10'>*</text>
175 <text class='text_777_30 float_left'>病人证照号码</text> 176 <text class='text_777_30 float_left'>病人证照号码</text>
176 - <view wx:if="{{isIdCard}}"> 177 + <view>
177 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="medical_id_card_no"></image> 178 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="medical_id_card_no"></image>
178 <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;width:380rpx;color:#000;' placeholder='请输入或拍摄身份证' name='id_card_no' type='idcard' value='{{id_card_no}}' bindinput="idChange" id="medical_id_card_no_input"></input> 179 <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;width:380rpx;color:#000;' placeholder='请输入或拍摄身份证' name='id_card_no' type='idcard' value='{{id_card_no}}' bindinput="idChange" id="medical_id_card_no_input"></input>
179 </view> 180 </view>
@@ -306,7 +307,7 @@ @@ -306,7 +307,7 @@
306 <view style='height:90rpx' hidden="{{leasetypeData.selected == '组织'}}"> 307 <view style='height:90rpx' hidden="{{leasetypeData.selected == '组织'}}">
307 <text class='red_star_right_10'>*</text> 308 <text class='red_star_right_10'>*</text>
308 <text class='text_777_30 float_left'>证照号码</text> 309 <text class='text_777_30 float_left'>证照号码</text>
309 - <view wx:if="{{isIdCard}}"> 310 + <view>
310 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no"></image> 311 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no"></image>
311 <input class='input_wrap' placeholder-class='text_999_30 float_right' style=' line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入或拍摄身份证' maxlength='18' type='idcard' name='owner_id_card_no' value='{{owner_id_card_no}}' bindinput="idChange" id='owner_id_card_no_input'></input> 312 <input class='input_wrap' placeholder-class='text_999_30 float_right' style=' line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入或拍摄身份证' maxlength='18' type='idcard' name='owner_id_card_no' value='{{owner_id_card_no}}' bindinput="idChange" id='owner_id_card_no_input'></input>
312 </view> 313 </view>
@@ -365,18 +366,15 @@ @@ -365,18 +366,15 @@
365 <view class='divide_line_30'></view> 366 <view class='divide_line_30'></view>
366 <view style='height:90rpx'> 367 <view style='height:90rpx'>
367 <text class='text_777_30 float_left head_in'>配偶证照号码</text> 368 <text class='text_777_30 float_left head_in'>配偶证照号码</text>
368 - <view wx:if="{{isIdCard}}">  
369 - <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden='{{hasGetLover}}' id="spouse_id_card_no"></image>  
370 - <input class='input_wrap' style='color:#000;' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='18' type='idcard' value='{{spouse_id_card_no}}' bindinput="idChange" id='spouse_id_card_no_input' disabled='{{hasGetLover}}'></input> 369 + <view>
  370 + <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden='{{hasGetLover || !isIdCard_lover}}' id="spouse_id_card_no"></image>
  371 + <input class='input_wrap' style='color:#000;' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='18' type='idcard' value='{{spouse_id_card_no}}' bindinput="idChange" bindblur="idDone" id='spouse_id_card_no_input' disabled='{{hasGetLover}}'></input>
371 </view> 372 </view>
372 </view> 373 </view>
373 <view class='divide_line_30'></view> 374 <view class='divide_line_30'></view>
374 <template is="picker_cell_normal" data="{{...loverbirthDate}}" /> 375 <template is="picker_cell_normal" data="{{...loverbirthDate}}" />
375 <view class='divide_line_30'></view> 376 <view class='divide_line_30'></view>
376 - <view style='height:90rpx'>  
377 - <text class='text_777_30 float_left head_in'>国籍</text>  
378 - <text class='text_black_30 float_right' style='line-height: 90rpx;text-align:right;' name='lover_country'>{{lover_country}}</text>  
379 - </view> 377 + <template is="picker_cell_normal" data="{{...loverCountryData}}" />
380 </view> 378 </view>
381 379
382 380
@@ -37,7 +37,7 @@ Page({ @@ -37,7 +37,7 @@ Page({
37 }, 37 },
38 cardtypeData: { 38 cardtypeData: {
39 isrequre: true, 39 isrequre: true,
40 - // selected:'居民身份证', 40 + selected:'',
41 label: '证照类型', 41 label: '证照类型',
42 bindtype: 'cardtype', 42 bindtype: 'cardtype',
43 placeholder: '请选择证照类型', 43 placeholder: '请选择证照类型',
@@ -70,7 +70,7 @@ Page({ @@ -70,7 +70,7 @@ Page({
70 label: '国籍', 70 label: '国籍',
71 bindtype: 'country', 71 bindtype: 'country',
72 isrequre: true, 72 isrequre: true,
73 - // selected: '中国', 73 + selected: '',
74 disabled: true, 74 disabled: true,
75 // range_key:'name', 75 // range_key:'name',
76 placeholder: '请选择国籍', 76 placeholder: '请选择国籍',
@@ -409,7 +409,11 @@ Page({ @@ -409,7 +409,11 @@ Page({
409 if (this.data.relativeData.selected.length < 1) { 409 if (this.data.relativeData.selected.length < 1) {
410 this.showtoast('请选择关系'); 410 this.showtoast('请选择关系');
411 return 411 return
412 - } 412 + }
  413 + if (this.data.cardtypeData.selected.length < 1) {
  414 + this.showtoast('请选择证照类型');
  415 + return
  416 + }
413 var rel = this.data.relativeData.selected 417 var rel = this.data.relativeData.selected
414 if (this.data.card_number.length < 1) { 418 if (this.data.card_number.length < 1) {
415 this.showtoast('请填写证照号码'); 419 this.showtoast('请填写证照号码');
@@ -1156,6 +1156,10 @@ Page({ @@ -1156,6 +1156,10 @@ Page({
1156 var regMoney = /^([1-9][\d]{0,10}|0)(\.[\d]{1,2})?$/ 1156 var regMoney = /^([1-9][\d]{0,10}|0)(\.[\d]{1,2})?$/
1157 var formdata = e.detail.value; 1157 var formdata = e.detail.value;
1158 console.log("formdata", formdata) 1158 console.log("formdata", formdata)
  1159 + if (this.data.cardtypeData.selected.length < 1) {
  1160 + this.showtoast('请选择证照类型');
  1161 + return
  1162 + }
1159 if (this.data.card_number.length < 1) { 1163 if (this.data.card_number.length < 1) {
1160 this.showtoast('请填写证照号码'); 1164 this.showtoast('请填写证照号码');
1161 return 1165 return
注册登录 后发表评论