提交 aaf13c726164ddf09b8fe4df34270b6663d516db

作者 pangy
1 个父辈 954fe29d

信息不全提示、 租房房主身份证逻辑

外国人 编辑时初始化国籍
... ... @@ -66,7 +66,7 @@ Page({
66 66 lovercardtypeData: {
67 67 label: '配偶证照类型',
68 68 bindtype: 'lovercardtype',
69   - // selected: '居民身份证',
  69 + selected: '',
70 70 disabled: true,
71 71 placeholder: '请选择证照类型',
72 72 values: cardTypeArray,
... ... @@ -119,7 +119,7 @@ Page({
119 119 label: '子女证照类型',
120 120 isrequre: true,
121 121 bindtype: 'childrencardtype',
122   - selected: '居民身份证',
  122 + selected: '',
123 123 // disabled: true,
124 124 isblack: 'true',
125 125 placeholder: '请选择证照类型',
... ... @@ -225,7 +225,7 @@ Page({
225 225 isrequre: true,
226 226 // disabled: true,
227 227 bindtype: 'oldercardtype',
228   - selected: '居民身份证',
  228 + selected: '',
229 229 isblack: 'true',
230 230 placeholder: '请选择被赡养人证照类型',
231 231 values: cardTypeArray,
... ... @@ -234,8 +234,8 @@ Page({
234 234 cardtypeData: {
235 235 label: '证照类型',
236 236 isrequre: true,
237   - bindtype: 'cardtype',
238   - selected: '居民身份证',
  237 + bindtype: 'ownercardtype',
  238 + selected: '',
239 239 // disabled: true,
240 240 isblack: 'true',
241 241 placeholder: '证照类型',
... ... @@ -555,7 +555,7 @@ Page({
555 555 * Lifecycle function--Called when page load
556 556 */
557 557 onLoad: function(options) {
558   -
  558 + this.getCountry()
559 559 this.getTaxHostInfo()
560 560 var pages = getCurrentPages()
561 561 var frontPage = pages[pages.length - 2]
... ... @@ -577,7 +577,6 @@ Page({
577 577 // deduction_amount = Deduce_amounts_year[nameKey] ? Deduce_amounts_year[nameKey] : 0
578 578 }
579 579 if ("children_education" == options.status) {
580   - this.getCountry()
581 580 if (options.isedit != 'true'){
582 581 this.getTaxList()
583 582 }
... ... @@ -770,9 +769,15 @@ Page({
770 769 // },
771 770
772 771 //****************获取国籍数据************/
773   - getCountry: function () {
  772 + getCountry: function (cb) {
774 773 var that = this
775 774 wx.showLoading()
  775 + if (that.countrys && that.countrys.length > 0) {
  776 + typeof cb == "function" && cb(that.countrys)
  777 + console.log('----直接取值')
  778 + wx.hideLoading()
  779 + return
  780 + }
776 781 var Authorization = app.globalData.Authorization;
777 782 wx.request({
778 783 url: baseUrl + 'persontax/v1/nation-list',
... ... @@ -799,10 +804,9 @@ Page({
799 804 that.data.schoolCountryData.values = res.data
800 805 that.countrys = countrys
801 806 that.setData({
802   - ///////////////////////////需对照addinfo完善
803   - // countryData: that.data.countryData,
804 807 schoolCountryData: that.data.schoolCountryData
805 808 })
  809 + typeof cb == "function" && cb(countrys)
806 810 },
807 811 complete() {
808 812 wx.hideLoading()
... ... @@ -824,8 +828,8 @@ Page({
824 828 setData.taxperson_relativeData = this.data.taxperson_relativeData
825 829 }
826 830 var commonbirthDate = this.data.commonbirthDate
827   - commonbirthDate.selected = format.formatTime_date(data.birth_date)
828   - commonbirthDate.datelong = data.birth_date
  831 + commonbirthDate.selected = format.formatTime_date(data.children_birthday)
  832 + commonbirthDate.datelong = data.children_birthday
829 833 setData.commonbirthDate = commonbirthDate
830 834 var childrenpercentData = this.data.childrenpercentData
831 835 childrenpercentData.selected = data.percent + '%'
... ... @@ -954,9 +958,11 @@ Page({
954 958 this.dealCardType(data.id_card_type, 'oldercardtype')//为防止干扰其他字段,需要先执行
955 959 var setData = {}
956 960 var olderbirthDate = this.data.olderbirthDate
957   - olderbirthDate.selected = format.formatTime_date(data.birth_date)
958   - olderbirthDate.datelong = data.birth_date
  961 + olderbirthDate.selected = format.formatTime_date(data.birthday)
  962 + olderbirthDate.datelong = data.birthday
959 963 setData.olderbirthDate = olderbirthDate
  964 + this.data.olderCountryData.selected = data.nation
  965 + setData.olderCountryData = this.data.olderCountryData
960 966 if (data.supported_name && data.supported_name.length) {
961 967 setData.supported_name = data.supported_name
962 968 }
... ... @@ -1008,7 +1014,7 @@ Page({
1008 1014 if (data.spouse_name && data.spouse_name.length) {
1009 1015 setData.spouse_name = data.spouse_name
1010 1016 }
1011   - this.dealCardType(data.spouse_id_card_type, 'lovercardtype')
  1017 + this.dealCardType(data.id_card_type, 'lovercardtype')
1012 1018 if (data.id_card_no && data.id_card_no.length) {
1013 1019 setData.spouse_id_card_no = data.id_card_no
1014 1020 if ('居民身份证' == data.id_card_type) {
... ... @@ -1016,6 +1022,7 @@ Page({
1016 1022 }
1017 1023 }
1018 1024 if (this.data.house_type == 'house_fund_rent'){
  1025 + this.dealCardType(data.owner_id_card_type, 'ownercardtype')//为防止干扰其他字段,需要先执行
1019 1026 var workingcityInfo = this.data.workingcityInfo
1020 1027 workingcityInfo.requestdata = data.work_city
1021 1028 workingcityInfo.selected = data.work_city.province + data.work_city.city
... ... @@ -1415,6 +1422,10 @@ Page({
1415 1422 switch (this.data.cur_index + '') {
1416 1423 case 'children_education':
1417 1424 subUrl = 'persontax/v1/children-educations'
  1425 + if (this.data.childrencardtypeData.selected.length < 1) {
  1426 + this.showToast('请选择证照类型')
  1427 + return
  1428 + }
1418 1429 if (!formdata.children_id_card_no || formdata.children_id_card_no.length < 1) {
1419 1430 this.showToast('请填写子女证照号码')
1420 1431 return
... ... @@ -1435,11 +1446,14 @@ Page({
1435 1446 this.showToast('请填写子女姓名')
1436 1447 return
1437 1448 }
1438   - // if (this.data.commonbirthDate.selected.length < 1) {
1439   - // this.showToast('请选择子女出生日期')
1440   - // return
1441   - // }
1442   -
  1449 + if (this.data.commonbirthDate.selected.length < 1) {
  1450 + this.showToast('请选择子女出生日期')
  1451 + return
  1452 + }
  1453 + if (this.data.countryData.selected.length < 1) {
  1454 + this.showToast('请选择国籍')
  1455 + return
  1456 + }
1443 1457 if (this.data.taxperson_relativeData.selected.length < 1) {
1444 1458 this.showToast('请选择与纳税人关系')
1445 1459 return
... ... @@ -1487,7 +1501,10 @@ Page({
1487 1501 if (!formdata.spouse_name || formdata.spouse_name.length < 1) {
1488 1502 this.showToast('请填写配偶姓名')
1489 1503 return
1490   - } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
  1504 + } if (this.data.lovercardtypeData.selected.length < 1) {
  1505 + this.showToast('请选择配偶证照类型')
  1506 + return
  1507 + } if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
1491 1508 this.showToast('请填写配偶证照号码')
1492 1509 return
1493 1510 } else if (this.data.isIdCard_lover && !format.isIDCardNum(formdata.spouse_id_card_no)) {
... ... @@ -1497,8 +1514,13 @@ Page({
1497 1514 this.showToast('请选择配偶出生日期')
1498 1515 return
1499 1516 }
  1517 + if (this.data.loverCountryData.selected.length < 1) {
  1518 + this.showToast('请选择配偶国籍')
  1519 + return
  1520 + }
1500 1521 newdata.spouse_id_card_type = this.data.lovercardtypeData.selected
1501 1522 newdata.spouse_birthday = this.data.loverbirthDate.datelong
  1523 + newdata.nation = this.data.loverCountryData.selected
1502 1524 }
1503 1525 newdata.has_spouse = this.data.hasLover?'y':'n'
1504 1526 newdata.relationship = this.data.taxperson_relativeData.selected
... ... @@ -1511,7 +1533,6 @@ Page({
1511 1533 newdata.education_period = this.data.childedudegreeData.selected
1512 1534 newdata.school_country = this.data.schoolCountryData.selected
1513 1535 newdata.children_nation = this.data.countryData.selected//"中国"
1514   - newdata.nation = "中国"
1515 1536 break;
1516 1537 case 'continuing_education':
1517 1538 subUrl = 'persontax/v1/continuing-educations'
... ... @@ -1602,16 +1623,16 @@ Page({
1602 1623 this.showToast('请选择被赡养人证照类型')
1603 1624 return
1604 1625 } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) {
1605   - this.showToast('请填写被赡养人证照号')
  1626 + this.showToast('请填写证照号')
1606 1627 return
1607 1628 } else if (this.data.isIdCard_older && !format.isIDCardNum(formdata.id_card_no)) {
1608 1629 this.showToast('被赡养人身份证格式有误')
1609 1630 return
1610 1631 }
1611   - // if (this.data.olderbirthDate.selected.length < 1) {
1612   - // this.showToast('请选择被赡养人出生日期')
1613   - // return
1614   - // }
  1632 + if (this.data.olderbirthDate.selected.length < 1) {
  1633 + this.showToast('请选择出生日期')
  1634 + return
  1635 + }
1615 1636 if (format.getAge(this.data.olderbirthDate.selected) < 60) {
1616 1637 this.showToast('被赡养人年龄不足60岁,不可申报')
1617 1638 return
... ... @@ -1620,6 +1641,10 @@ Page({
1620 1641 this.showToast('被赡养人年龄应大于本人');
1621 1642 return
1622 1643 }
  1644 + if (this.data.olderCountryData.selected.length < 1) {
  1645 + this.showToast('请选择国籍')
  1646 + return
  1647 + }
1623 1648 if (this.data.older_relativeData.selected.length < 1) {
1624 1649 this.showToast('请选择与纳税人关系')
1625 1650 return
... ... @@ -1637,8 +1662,8 @@ Page({
1637 1662 }
1638 1663 newdata.birthday = this.data.olderbirthDate.datelong
1639 1664 newdata.relationship = this.data.older_relativeData.selected
1640   - newdata.id_card_type = '居民身份证' //this.data.oldercardtypeData.selected
1641   - newdata.nation = "中国"
  1665 + newdata.id_card_type = this.data.oldercardtypeData.selected
  1666 + newdata.nation = this.data.olderCountryData.selected
1642 1667 break;
1643 1668 case 'medical_fund':
1644 1669 subUrl = 'persontax/v1/medical-funds'
... ... @@ -1676,7 +1701,7 @@ Page({
1676 1701
1677 1702 newdata.total_amount = parseFloat(formdata.total_amount)
1678 1703 newdata.amount_by_person = parseFloat(formdata.amount_by_person)
1679   - newdata.id_card_type = '居民身份证'//this.data.cardtypeData.selected
  1704 + newdata.id_card_type = this.data.cardtypeData.selected
1680 1705 newdata.relationship = this.data.taxperson_relativeData.selected
1681 1706 newdata.patient_birthday = this.data.commonbirthDate.datelong
1682 1707 newdata.patient_nation = "中国"
... ... @@ -1778,14 +1803,18 @@ Page({
1778 1803 }
1779 1804 newdata.owner_id_card_no = ''
1780 1805 } else{
  1806 + if (this.data.cardtypeData.selected.length < 1) {
  1807 + this.showToast('请选择证照类型')
  1808 + return
  1809 + }
1781 1810 if (!formdata.owner_id_card_no || formdata.owner_id_card_no.length < 1) {
1782 1811 this.showToast('请填写证照号码')
1783 1812 return
1784   - } else if (!format.isIDCardNum(formdata.owner_id_card_no)) {
  1813 + } else if (this.data.isIdCard_owner && !format.isIDCardNum(formdata.owner_id_card_no)) {
1785 1814 this.showToast('身份证格式有误')
1786 1815 return
1787 1816 }
1788   - newdata.owner_id_card_type = '居民身份证'//this.data.cardtypeData.selected
  1817 + newdata.owner_id_card_type = this.data.cardtypeData.selected
1789 1818 }
1790 1819 // if (this.data.rentLocateInfo.address_value[0].length < 1) {
1791 1820 // this.showToast('请选择房屋地址')
... ... @@ -1832,6 +1861,10 @@ Page({
1832 1861 if (!formdata.spouse_name || formdata.spouse_name.length < 1) {
1833 1862 this.showToast('请填写配偶姓名')
1834 1863 return
  1864 + }
  1865 + if (this.data.lovercardtypeData.selected.length < 1) {
  1866 + this.showToast('请选择配偶证照类型')
  1867 + return
1835 1868 } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
1836 1869 this.showToast('请填写配偶证照号码')
1837 1870 return
... ... @@ -1842,10 +1875,14 @@ Page({
1842 1875 this.showToast('请选择配偶出生日期')
1843 1876 return
1844 1877 }
  1878 + if (this.data.loverCountryData.selected.length < 1) {
  1879 + this.showToast('请选择配偶国籍')
  1880 + return
  1881 + }
1845 1882 newdata.id_card_no = newdata.spouse_id_card_no ? newdata.spouse_id_card_no : ''
1846 1883 newdata.id_card_type = this.data.lovercardtypeData.selected
1847 1884 newdata.birthday = this.data.loverbirthDate.datelong
1848   - newdata.nation = "中国"
  1885 + newdata.nation = this.data.loverCountryData.selected
1849 1886 }
1850 1887 newdata.has_spouse = this.data.hasLover ? 'y' : 'n'
1851 1888 break;
... ... @@ -1943,6 +1980,11 @@ Page({
1943 1980 return;
1944 1981 }
1945 1982 break;
  1983 + case 'owner_id_card_no_input':
  1984 + if (!this.data.isIdCard_owner) {
  1985 + return;
  1986 + }
  1987 + break;
1946 1988 }
1947 1989 var idCardNo = e.detail.value
1948 1990 if (e.detail.value.length == 18) {
... ... @@ -1974,11 +2016,16 @@ Page({
1974 2016 return;
1975 2017 }
1976 2018 break;
  2019 + case 'owner_id_card_no_input':
  2020 + if (!this.data.isIdCard_owner) {
  2021 + return;
  2022 + }
  2023 + break;
1977 2024 }
1978 2025 var idCardNo = e.detail.value
1979 2026 if (!idCardNo.length) {
1980 2027 wx.showToast({
1981   - title: '请输入身份证号',
  2028 + title: '请输入证照号码',
1982 2029 icon: 'none'
1983 2030 })
1984 2031 return;
... ... @@ -2124,6 +2171,7 @@ Page({
2124 2171 },
2125 2172
2126 2173 dealCardType: function (new_type,witch) {
  2174 + console.log('new_type', new_type)
2127 2175 var is_idcard, cardtypeData, countryData, birthDate
2128 2176 switch (witch) {
2129 2177 case 'childrencardtype':
... ... @@ -2141,6 +2189,15 @@ Page({
2141 2189 cardtypeData = this.data.oldercardtypeData
2142 2190 birthDate = this.data.olderbirthDate
2143 2191 break;
  2192 + case 'ownercardtype':
  2193 + cardtypeData = this.data.cardtypeData
  2194 + cardtypeData.selected = new_type
  2195 + this.setData({
  2196 + cardtypeData: cardtypeData,
  2197 + isIdCard_owner: ('居民身份证' == new_type),
  2198 + })
  2199 + return;
  2200 + break;
2144 2201 }
2145 2202
2146 2203 cardtypeData.selected = new_type
... ... @@ -2165,7 +2222,7 @@ Page({
2165 2222 countryData.selected = ''
2166 2223 countryData.values = this.countrys ? this.countrys : []
2167 2224 countryData.disabled = false
2168   - }
  2225 + }
2169 2226 switch (witch) {
2170 2227 case 'childrencardtype':
2171 2228 this.setData({
... ... @@ -2192,6 +2249,28 @@ Page({
2192 2249 })
2193 2250 break;
2194 2251 }
  2252 + if (countryData.values && countryData.values.length < 1) {
  2253 + console.log('-----countrys 还未加载完成 ')
  2254 + var that = this, setData = {}
  2255 + this.getCountry(function (countrys){
  2256 + console.log('-----countrys 加载完成 ', witch)
  2257 + switch (witch) {
  2258 + case 'childrencardtype':
  2259 + that.data.countryData.values = countrys
  2260 + setData.countryData = that.data.childrencardtypeData
  2261 + break;
  2262 + case 'lovercardtype':
  2263 + that.data.loverCountryData.values = countrys
  2264 + setData.loverCountryData = that.data.loverCountryData
  2265 + break;
  2266 + case 'oldercardtype':
  2267 + that.data.olderCountryData.values = countrys
  2268 + setData.olderCountryData = that.data.olderCountryData
  2269 + break;
  2270 + }
  2271 + that.setData(setData)
  2272 + })
  2273 + }
2195 2274
2196 2275 },
2197 2276 onPickerSelect: function(e) {
... ... @@ -2527,12 +2606,15 @@ Page({
2527 2606 return
2528 2607 }
2529 2608 break;
2530   - case 'cardtype':
2531   - var cardtype_Data = this.data.cardtypeData
2532   - cardtype_Data.selected = cardtype_Data.values[e.detail.value]
2533   - this.setData({
2534   - cardtypeData: cardtype_Data
2535   - })
  2609 + case 'ownercardtype':
  2610 + var cardtypeData = this.data.cardtypeData
  2611 + var new_type = cardtypeData.values[e.detail.value]
  2612 + if (new_type != cardtypeData.selected) {
  2613 + this.dealCardType(new_type, 'ownercardtype')
  2614 + this.setData({
  2615 + owner_id_card_no: ""
  2616 + })
  2617 + }
2536 2618 break;
2537 2619 case 'identify_type':
2538 2620 var identifytype_Data = this.data.identifytypeData
... ...
... ... @@ -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='18' 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>
... ... @@ -138,7 +138,7 @@
138 138 <text class='text_777_30 float_left'>被赡养人证照号码</text>
139 139 <view>
140 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>
  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 142 </view>
143 143 </view>
144 144 <view class='divide_line_30'></view>
... ... @@ -176,7 +176,7 @@
176 176 <text class='text_777_30 float_left'>病人证照号码</text>
177 177 <view>
178 178 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="medical_id_card_no"></image>
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 + <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>
180 180 </view>
181 181 </view>
182 182 <view class='divide_line_30'></view>
... ... @@ -308,8 +308,8 @@
308 308 <text class='red_star_right_10'>*</text>
309 309 <text class='text_777_30 float_left'>证照号码</text>
310 310 <view>
311   - <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no"></image>
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>
  311 + <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="owner_id_card_no" hidden='{{!isIdCard_owner}}'></image>
  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" bindblur="idDone" id='owner_id_card_no_input'></input>
313 313 </view>
314 314 </view>
315 315 </view>
... ... @@ -368,7 +368,7 @@
368 368 <text class='text_777_30 float_left head_in'>配偶证照号码</text>
369 369 <view>
370 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 + <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>
372 372 </view>
373 373 </view>
374 374 <view class='divide_line_30'></view>
... ...
注册登录 后发表评论