提交 d5053091236da14e416681918ee3bfc9de1a01df

作者 pangy
2 个父辈 e06a6be6 d089e441

Merge branch 'dev_py' into dev2.0

@@ -146,6 +146,7 @@ App({ @@ -146,6 +146,7 @@ App({
146 // baseUrl: "https://api.workai.com.cn/", 146 // baseUrl: "https://api.workai.com.cn/",
147 OSSUrl: "", //"https://oss.workai.com.cn/", 147 OSSUrl: "", //"https://oss.workai.com.cn/",
148 userInfo: null, 148 userInfo: null,
  149 + hostInfo:null,
149 hasLogin: false, 150 hasLogin: false,
150 openid: null, 151 openid: null,
151 Authorization: null, 152 Authorization: null,
@@ -81,16 +81,17 @@ Page({ @@ -81,16 +81,17 @@ Page({
81 end: '2018-01-01', 81 end: '2018-01-01',
82 onChange: 'onPickerSelect', 82 onChange: 'onPickerSelect',
83 }, 83 },
84 - // older_relativeData: {  
85 - // label: '与纳税人关系',  
86 - // isrequre: true,  
87 - // bindtype: 'older_relative',  
88 - // selected: '',  
89 - // isblack: 'true',  
90 - // placeholder: '请选择与纳税人关系',  
91 - // values: ["父母", "祖父母、外祖父母"],  
92 - // onChange: 'onPickerSelect'  
93 - // }, 84 + older_relativeData: {
  85 + label: '与纳税人关系',
  86 + isrequre: true,
  87 + // disabled: true,
  88 + bindtype: 'older_relative',
  89 + selected: "",
  90 + isblack: 'true',
  91 + placeholder: '请选择与纳税人关系',
  92 + values: ["父母", "其他"],
  93 + onChange: 'onPickerSelect'
  94 + },
94 taxperson_relativeData: { 95 taxperson_relativeData: {
95 label: '与纳税人的关系', 96 label: '与纳税人的关系',
96 isrequre: true, 97 isrequre: true,
@@ -127,10 +128,11 @@ Page({ @@ -127,10 +128,11 @@ Page({
127 commonbirthDate: { 128 commonbirthDate: {
128 label: '出生日期', 129 label: '出生日期',
129 isrequre: true, 130 isrequre: true,
  131 + disabled:true,
130 bindtype: 'commonbirthday', 132 bindtype: 'commonbirthday',
131 selected: '', 133 selected: '',
132 isblack: 'true', 134 isblack: 'true',
133 - placeholder: '请选择出生日期', 135 + placeholder: '出生日期',
134 mode: "date", 136 mode: "date",
135 fields: "day", 137 fields: "day",
136 start: '1970-01-01', 138 start: '1970-01-01',
@@ -143,7 +145,8 @@ Page({ @@ -143,7 +145,8 @@ Page({
143 bindtype: 'child_edu_degree', 145 bindtype: 'child_edu_degree',
144 selected: '', 146 selected: '',
145 isblack: 'true', 147 isblack: 'true',
146 - values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育", "硕士研究生教育", "博士研究生教育"], 148 + // values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育", "硕士研究生教育", "博士研究生教育"],
  149 + values: ["学前教育阶段", "义务教育", "高中阶段教育", "高等教育"],
147 placeholder: '请选择教育阶段', 150 placeholder: '请选择教育阶段',
148 onChange: 'onPickerSelect' 151 onChange: 'onPickerSelect'
149 }, 152 },
@@ -182,7 +185,8 @@ Page({ @@ -182,7 +185,8 @@ Page({
182 bindtype: 'edu_level', 185 bindtype: 'edu_level',
183 selected: '', 186 selected: '',
184 isblack: 'true', 187 isblack: 'true',
185 - values: ["专科", "本科", "硕士研究生", "博士研究生", "其他"], 188 + // values: ["专科", "本科", "硕士研究生", "博士研究生", "其他"],
  189 + values: ["大学专科", "大学本科", "硕士研究生", "博士研究生", "其他"],
186 placeholder: '请选择学历教育阶段', 190 placeholder: '请选择学历教育阶段',
187 onChange: 'onPickerSelect' 191 onChange: 'onPickerSelect'
188 }, 192 },
@@ -235,10 +239,11 @@ Page({ @@ -235,10 +239,11 @@ Page({
235 olderbirthDate: { 239 olderbirthDate: {
236 label: '被赡养人出生日期', 240 label: '被赡养人出生日期',
237 isrequre: true, 241 isrequre: true,
  242 + disabled: true,
238 bindtype: 'olderbirthday', 243 bindtype: 'olderbirthday',
239 selected: '', 244 selected: '',
240 isblack: 'true', 245 isblack: 'true',
241 - placeholder: '请选择日期', 246 + placeholder: '出生日期',
242 mode: "date", 247 mode: "date",
243 fields: "day", 248 fields: "day",
244 start: '1970-01-01', 249 start: '1970-01-01',
@@ -285,7 +290,7 @@ Page({ @@ -285,7 +290,7 @@ Page({
285 placeholder: '请选择时间', 290 placeholder: '请选择时间',
286 onChange: 'onPickerSelect', 291 onChange: 'onPickerSelect',
287 mode: "date", 292 mode: "date",
288 - fields: "day", 293 + fields: "month",
289 datelong: 0, 294 datelong: 0,
290 start: '1970-01-01', 295 start: '1970-01-01',
291 // start: (new Date()).getFullYear() + '-09-01',//'1970-01-01', 296 // start: (new Date()).getFullYear() + '-09-01',//'1970-01-01',
@@ -302,7 +307,7 @@ Page({ @@ -302,7 +307,7 @@ Page({
302 placeholder: '请选择时间', 307 placeholder: '请选择时间',
303 onChange: 'onPickerSelect', 308 onChange: 'onPickerSelect',
304 mode: "date", 309 mode: "date",
305 - fields: "day", 310 + fields: "month",
306 start: '1970-01-01', 311 start: '1970-01-01',
307 // start: (new Date()).getFullYear() + '-07-31',//'1970-01-01', 312 // start: (new Date()).getFullYear() + '-07-31',//'1970-01-01',
308 // end: (new Date()).getFullYear() + '-07-31', 313 // end: (new Date()).getFullYear() + '-07-31',
@@ -658,6 +663,10 @@ Page({ @@ -658,6 +663,10 @@ Page({
658 switch (this.data.cur_index + '') { 663 switch (this.data.cur_index + '') {
659 case 'children_education': 664 case 'children_education':
660 var setData = {} 665 var setData = {}
  666 + var commonbirthDate = this.data.commonbirthDate
  667 + commonbirthDate.selected = format.formatTime_date(data.birth_date)
  668 + commonbirthDate.datelong = data.birth_date
  669 + setData.commonbirthDate = commonbirthDate
661 if (data.id_card_no && data.id_card_no.length) { 670 if (data.id_card_no && data.id_card_no.length) {
662 setData.children_id_card_no = data.id_card_no 671 setData.children_id_card_no = data.id_card_no
663 this.dealIdInfo(data.id_card_no, 'children_id_card_no_input') 672 this.dealIdInfo(data.id_card_no, 'children_id_card_no_input')
@@ -665,12 +674,6 @@ Page({ @@ -665,12 +674,6 @@ Page({
665 if (data.name && data.name.length) { 674 if (data.name && data.name.length) {
666 setData.children_name = data.name 675 setData.children_name = data.name
667 } 676 }
668 - if (data.birth_date && data.birth_date > 0) {  
669 - var commonbirthDate = this.data.commonbirthDate  
670 - commonbirthDate.selected = format.formatTime_date(data.birth_date)  
671 - commonbirthDate.datelong = data.birth_date  
672 - setData.commonbirthDate = commonbirthDate  
673 - }  
674 if (data.percent && data.percent.length) { 677 if (data.percent && data.percent.length) {
675 var childrenpercentData = this.data.childrenpercentData 678 var childrenpercentData = this.data.childrenpercentData
676 childrenpercentData.selected = data.percent 679 childrenpercentData.selected = data.percent
@@ -770,6 +773,10 @@ Page({ @@ -770,6 +773,10 @@ Page({
770 break; 773 break;
771 case 'support_duty': 774 case 'support_duty':
772 var setData = {} 775 var setData = {}
  776 + var olderbirthDate = this.data.olderbirthDate
  777 + olderbirthDate.selected = format.formatTime_date(data.birth_date)
  778 + olderbirthDate.datelong = data.birth_date
  779 + setData.olderbirthDate = olderbirthDate
773 if (data.name && data.name.length) { 780 if (data.name && data.name.length) {
774 setData.supported_name = data.name 781 setData.supported_name = data.name
775 } 782 }
@@ -777,16 +784,14 @@ Page({ @@ -777,16 +784,14 @@ Page({
777 setData.id_card_no = data.id_card_no 784 setData.id_card_no = data.id_card_no
778 this.dealIdInfo(data.id_card_no, 'older_id_card_no_input') 785 this.dealIdInfo(data.id_card_no, 'older_id_card_no_input')
779 } 786 }
780 - if (data.birth_date && data.birth_date.length) {  
781 - var olderbirthDate = this.data.olderbirthDate  
782 - olderbirthDate.selected = format.formatTime_date(data.birth_date)  
783 - olderbirthDate.datelong = data.birth_date  
784 - setData.olderbirthDate = olderbirthDate  
785 - }  
786 this.setData(setData) 787 this.setData(setData)
787 break; 788 break;
788 case 'medical_fund': 789 case 'medical_fund':
789 var setData = {} 790 var setData = {}
  791 + var commonbirthDate = this.data.commonbirthDate
  792 + commonbirthDate.selected = format.formatTime_date(data.patient_birthday)
  793 + commonbirthDate.datelong = data.patient_birthday
  794 + setData.commonbirthDate = commonbirthDate
790 if (data.name && data.name.length) { 795 if (data.name && data.name.length) {
791 setData.name = data.name 796 setData.name = data.name
792 } 797 }
@@ -799,12 +804,6 @@ Page({ @@ -799,12 +804,6 @@ Page({
799 taxperson_relativeData.selected = data.family_ties 804 taxperson_relativeData.selected = data.family_ties
800 setData.taxperson_relativeData = taxperson_relativeData 805 setData.taxperson_relativeData = taxperson_relativeData
801 } 806 }
802 - if (data.patient_birthday && data.patient_birthday > 0) {  
803 - var commonbirthDate = this.data.commonbirthDate  
804 - commonbirthDate.selected = format.formatTime_date(data.patient_birthday)  
805 - commonbirthDate.datelong = data.birth_date  
806 - setData.commonbirthDate = commonbirthDate  
807 - }  
808 this.setData(setData) 807 this.setData(setData)
809 break; 808 break;
810 case "house_fund": 809 case "house_fund":
@@ -960,6 +959,9 @@ Page({ @@ -960,6 +959,9 @@ Page({
960 children_name: id_info.name, 959 children_name: id_info.name,
961 commonbirthDate: that.data.commonbirthDate 960 commonbirthDate: that.data.commonbirthDate
962 } 961 }
  962 + if (format.getAge(birth_day) < 3) {
  963 + this.showToast('子女年龄小于3岁,不可申报')
  964 + }
963 } else if (that.idcard_belong == 'spouse_id_card_no') { 965 } else if (that.idcard_belong == 'spouse_id_card_no') {
964 that.data.loverbirthDate.selected = birth_day 966 that.data.loverbirthDate.selected = birth_day
965 that.data.loverbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000) 967 that.data.loverbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000)
@@ -976,6 +978,9 @@ Page({ @@ -976,6 +978,9 @@ Page({
976 supported_name: id_info.name, 978 supported_name: id_info.name,
977 olderbirthDate: that.data.olderbirthDate 979 olderbirthDate: that.data.olderbirthDate
978 } 980 }
  981 + if (format.getAge(birth_day) < 60) {
  982 + this.showToast('被赡养人年龄不足60岁,不可申报')
  983 + }
979 } else if (that.idcard_belong == 'medical_id_card_no') { 984 } else if (that.idcard_belong == 'medical_id_card_no') {
980 that.data.commonbirthDate.selected = birth_day 985 that.data.commonbirthDate.selected = birth_day
981 that.data.commonbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000) 986 that.data.commonbirthDate.datelong = (Date.parse(new Date(birth_day)) / 1000)
@@ -1053,14 +1058,18 @@ Page({ @@ -1053,14 +1058,18 @@ Page({
1053 this.showToast('身份证格式有误') 1058 this.showToast('身份证格式有误')
1054 return 1059 return
1055 } 1060 }
1056 - if (!formdata.children_name || formdata.children_name.length < 1) {  
1057 - this.showToast('请填写子女姓名') 1061 + if (format.getAge(this.data.commonbirthDate.selected) < 3) {
  1062 + this.showToast('子女年龄小于3岁,不可申报')
1058 return 1063 return
1059 } 1064 }
1060 - if (this.data.commonbirthDate.selected.length < 1) {  
1061 - this.showToast('请选择子女出生日期') 1065 + if (!formdata.children_name || formdata.children_name.length < 1) {
  1066 + this.showToast('请填写子女姓名')
1062 return 1067 return
1063 } 1068 }
  1069 + // if (this.data.commonbirthDate.selected.length < 1) {
  1070 + // this.showToast('请选择子女出生日期')
  1071 + // return
  1072 + // }
1064 if (this.data.childrenpercentData.selected.length < 1) { 1073 if (this.data.childrenpercentData.selected.length < 1) {
1065 this.showToast('请选择分配比例') 1074 this.showToast('请选择分配比例')
1066 return 1075 return
@@ -1195,14 +1204,18 @@ Page({ @@ -1195,14 +1204,18 @@ Page({
1195 this.showToast('被赡养人身份证格式有误') 1204 this.showToast('被赡养人身份证格式有误')
1196 return 1205 return
1197 } 1206 }
1198 - if (this.data.olderbirthDate.selected.length < 1) {  
1199 - this.showToast('请选择被赡养人出生日期')  
1200 - return  
1201 - }  
1202 - // if (this.data.older_relativeData.selected.length < 1) {  
1203 - // this.showToast('请选择与纳税人关系') 1207 + // if (this.data.olderbirthDate.selected.length < 1) {
  1208 + // this.showToast('请选择被赡养人出生日期')
1204 // return 1209 // return
1205 // } 1210 // }
  1211 + if (format.getAge(this.data.olderbirthDate.selected) < 60) {
  1212 + this.showToast('被赡养人年龄不足60岁,不可申报')
  1213 + return
  1214 + }
  1215 + if (this.data.older_relativeData.selected.length < 1) {
  1216 + this.showToast('请选择与纳税人关系')
  1217 + return
  1218 + }
1206 // if (!formdata.percentage || formdata.percentage.length < 1 || formdata.percentage > 100) { 1219 // if (!formdata.percentage || formdata.percentage.length < 1 || formdata.percentage > 100) {
1207 // this.showToast('请填写合理分摊比例') 1220 // this.showToast('请填写合理分摊比例')
1208 // return 1221 // return
@@ -1215,7 +1228,7 @@ Page({ @@ -1215,7 +1228,7 @@ Page({
1215 newdata.share_method = this.share_method 1228 newdata.share_method = this.share_method
1216 } 1229 }
1217 newdata.birthday = this.data.olderbirthDate.datelong 1230 newdata.birthday = this.data.olderbirthDate.datelong
1218 - // newdata.relationship = this.data.older_relativeData.selected 1231 + newdata.relationship = this.data.older_relativeData.selected
1219 newdata.id_card_type = '1' //this.data.oldercardtypeData.selected 1232 newdata.id_card_type = '1' //this.data.oldercardtypeData.selected
1220 newdata.nation = "中国" 1233 newdata.nation = "中国"
1221 break; 1234 break;
@@ -1513,26 +1526,38 @@ Page({ @@ -1513,26 +1526,38 @@ Page({
1513 } 1526 }
1514 }, 1527 },
1515 loan_input: function (e) { 1528 loan_input: function (e) {
1516 - console.log('-------', e.detail.value) 1529 + var value = e.detail.value
1517 switch (e.currentTarget.id) { 1530 switch (e.currentTarget.id) {
1518 case 'loan_contract_no': 1531 case 'loan_contract_no':
1519 this.setData({ 1532 this.setData({
1520 - loan_contract_no: e.detail.value 1533 + loan_contract_no: value
1521 }) 1534 })
1522 break; 1535 break;
1523 case 'loan_months': 1536 case 'loan_months':
  1537 + if (value.length && value <= 0) {
  1538 + value = 1
  1539 + } else if (value > 240) {
  1540 + value = 240
  1541 + this.showToast('月数不得大于240')
  1542 + }
1524 this.setData({ 1543 this.setData({
1525 - loan_months: e.detail.value 1544 + loan_months: value
1526 }) 1545 })
1527 break; 1546 break;
1528 case 'sec_loan_contract_no': 1547 case 'sec_loan_contract_no':
1529 this.setData({ 1548 this.setData({
1530 - sec_loan_contract_no: e.detail.value 1549 + sec_loan_contract_no: value
1531 }) 1550 })
1532 break; 1551 break;
1533 case 'sec_loan_months': 1552 case 'sec_loan_months':
  1553 + if (value.length && value <= 0) {
  1554 + value = 1
  1555 + }else if (value>240){
  1556 + value = 240
  1557 + this.showToast('月数不得大于240')
  1558 + }
1534 this.setData({ 1559 this.setData({
1535 - sec_loan_months: e.detail.value 1560 + sec_loan_months: value
1536 }) 1561 })
1537 break; 1562 break;
1538 } 1563 }
@@ -1548,6 +1573,9 @@ Page({ @@ -1548,6 +1573,9 @@ Page({
1548 data = { 1573 data = {
1549 commonbirthDate: this.data.commonbirthDate 1574 commonbirthDate: this.data.commonbirthDate
1550 } 1575 }
  1576 + if (info.age<3){
  1577 + this.showToast('子女年龄小于3岁,不可申报')
  1578 + }
1551 } else if (idcard_belong == 'spouse_id_card_no_input') { 1579 } else if (idcard_belong == 'spouse_id_card_no_input') {
1552 this.data.loverbirthDate.selected = info.birthDay 1580 this.data.loverbirthDate.selected = info.birthDay
1553 this.data.loverbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000) 1581 this.data.loverbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000)
@@ -1566,6 +1594,9 @@ Page({ @@ -1566,6 +1594,9 @@ Page({
1566 data = { 1594 data = {
1567 olderbirthDate: this.data.olderbirthDate 1595 olderbirthDate: this.data.olderbirthDate
1568 } 1596 }
  1597 + if (info.age < 60) {
  1598 + this.showToast('被赡养人年龄不足60岁,不可申报')
  1599 + }
1569 } else if (idcard_belong == 'owner_id_card_no_input') { 1600 } else if (idcard_belong == 'owner_id_card_no_input') {
1570 // this.data.olderbirthDate.selected = info.birthDay 1601 // this.data.olderbirthDate.selected = info.birthDay
1571 // this.data.olderbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000) 1602 // this.data.olderbirthDate.datelong = (Date.parse(new Date(info.birthDay)) / 1000)
@@ -1629,13 +1660,13 @@ Page({ @@ -1629,13 +1660,13 @@ Page({
1629 loverbirthDate: lover_birthDate 1660 loverbirthDate: lover_birthDate
1630 }) 1661 })
1631 break; 1662 break;
1632 - // case 'older_relative':  
1633 - // var older_relativeData = this.data.older_relativeData  
1634 - // older_relativeData.selected = older_relativeData.values[e.detail.value]  
1635 - // this.setData({  
1636 - // older_relativeData: older_relativeData  
1637 - // })  
1638 - // break; 1663 + case 'older_relative':
  1664 + var older_relativeData = this.data.older_relativeData
  1665 + older_relativeData.selected = older_relativeData.values[e.detail.value]
  1666 + this.setData({
  1667 + older_relativeData: older_relativeData
  1668 + })
  1669 + break;
1639 case 'taxperson_relative': 1670 case 'taxperson_relative':
1640 var taxperson_relativedata = this.data.taxperson_relativeData 1671 var taxperson_relativedata = this.data.taxperson_relativeData
1641 taxperson_relativedata.selected = taxperson_relativedata.values[e.detail.value] 1672 taxperson_relativedata.selected = taxperson_relativedata.values[e.detail.value]
@@ -145,7 +145,7 @@ @@ -145,7 +145,7 @@
145 </view> 145 </view>
146 <view class='divide_line_30'></view> 146 <view class='divide_line_30'></view>
147 147
148 - <!-- <template is="picker_cell_normal" data="{{...older_relativeData}}" /> --> 148 + <template is="picker_cell_normal" data="{{...older_relativeData}}" />
149 <!-- <view style='height:90rpx;'> 149 <!-- <view style='height:90rpx;'>
150 <text class='red_star_right_10'>*</text> 150 <text class='red_star_right_10'>*</text>
151 <text class='text_777_30 float_left'>分摊比例</text> 151 <text class='text_777_30 float_left'>分摊比例</text>
@@ -31,7 +31,7 @@ Page({ @@ -31,7 +31,7 @@ Page({
31 disabled: false, 31 disabled: false,
32 placeholder: '请选择关系', 32 placeholder: '请选择关系',
33 // values: ["子","女" ,"配偶", "父母", "祖父母、外祖父母"], 33 // values: ["子","女" ,"配偶", "父母", "祖父母、外祖父母"],
34 - values: ["子", "女", "配偶", "父母"], 34 + values: ["子", "女", "配偶", "父母","其他"],
35 onChange: 'onPickerSelect' 35 onChange: 'onPickerSelect'
36 }, 36 },
37 cardtypeData: { 37 cardtypeData: {
@@ -58,8 +58,10 @@ Page({ @@ -58,8 +58,10 @@ Page({
58 genderData: { 58 genderData: {
59 label: '性别', 59 label: '性别',
60 bindtype: 'gender', 60 bindtype: 'gender',
  61 + disabled: true,
61 selected: '', 62 selected: '',
62 - placeholder: '请选择性别', 63 + // placeholder: '请选择性别',
  64 + placeholder: '性别',
63 values: ["男", "女"], 65 values: ["男", "女"],
64 onChange: 'onPickerSelect' 66 onChange: 'onPickerSelect'
65 }, 67 },
@@ -116,7 +118,7 @@ Page({ @@ -116,7 +118,7 @@ Page({
116 this.data.relativeData.selected = tax_info.family_ties 118 this.data.relativeData.selected = tax_info.family_ties
117 // this.data.cardtypeData.selected = tax_info.id_card_type 119 // this.data.cardtypeData.selected = tax_info.id_card_type
118 this.data.genderData.selected = tax_info.gender 120 this.data.genderData.selected = tax_info.gender
119 - this.data.genderData.disabled = isDisable 121 + // this.data.genderData.disabled = isDisable
120 122
121 this.setData({ 123 this.setData({
122 isDisable: isDisable, 124 isDisable: isDisable,
@@ -287,6 +289,23 @@ Page({ @@ -287,6 +289,23 @@ Page({
287 this.showtoast('手机号码有误'); 289 this.showtoast('手机号码有误');
288 return 290 return
289 } 291 }
  292 + if (this.data.genderData.selected == '男') {
  293 + var rel = this.data.relativeData.selected
  294 + if (rel == '女'){
  295 + this.showtoast('关系和性别冲突');
  296 + return
  297 + }
  298 + }else{
  299 + var rel = this.data.relativeData.selected
  300 + if (rel == '子') {
  301 + this.showtoast('关系和性别冲突');
  302 + return
  303 + }
  304 + }
  305 + if (this.data.genderData.selected == app.globalData.hostInfo.gender) {
  306 + this.showtoast('关系和性别冲突');
  307 + return
  308 + }
290 this.goCommit(formdata); 309 this.goCommit(formdata);
291 }, 310 },
292 311
@@ -24,10 +24,10 @@ @@ -24,10 +24,10 @@
24 <view wx:if="{{isIdCard}}" > 24 <view wx:if="{{isIdCard}}" >
25 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo'></image> 25 <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo'></image>
26 <!-- <text class='text_333_28 float_right'>{{card_number}}</text> --> 26 <!-- <text class='text_333_28 float_right'>{{card_number}}</text> -->
27 - <input class='input_wrap' placeholder='请输入或拍摄身份证' placeholder-class='text_777_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_777_30' name='id_card_no' maxlength='18' type="idcard" 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='18' type="idcard" 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>
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <view class='item_body'> 35 <view class='item_body'>
36 <text class='red_star_right_10'>*</text> 36 <text class='red_star_right_10'>*</text>
37 <text class='text_777_30 float_left' style='line-height: 90rpx'>姓名</text> 37 <text class='text_777_30 float_left' style='line-height: 90rpx'>姓名</text>
38 - <input class='input_wrap' placeholder='请填写姓名' name='person_name' value='{{name}}' placeholder-class='text_777_30' maxlength='15' disabled='{{isDisable}}' bindinput='nameInput'></input> 38 + <input class='input_wrap' placeholder='请填写姓名' name='person_name' value='{{name}}' placeholder-class='text_999_30' maxlength='15' disabled='{{isDisable}}' bindinput='nameInput'></input>
39 </view> 39 </view>
40 <view class="divide_line_30"></view> 40 <view class="divide_line_30"></view>
41 41
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <view class="divide_line_30"></view> 43 <view class="divide_line_30"></view>
44 <view class='item_body'> 44 <view class='item_body'>
45 <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>年龄</text> 45 <text class='text_777_30 float_left head_in' style='line-height: 90rpx'>年龄</text>
46 - <input class='input_wrap' name='age' type='number' placeholder-class='text_777_30' placeholder='请输入年龄' maxlength='2' value='{{age}}' disabled='{{isDisable}}'></input> 46 + <input class='input_wrap' name='age' type='number' placeholder-class='text_999_30' placeholder='年龄' maxlength='2' value='{{age}}' disabled='true'></input>
47 </view> 47 </view>
48 <view class="divide_line_30"></view> 48 <view class="divide_line_30"></view>
49 49
@@ -74,7 +74,8 @@ Page({ @@ -74,7 +74,8 @@ Page({
74 genderData: { 74 genderData: {
75 label: '性别', 75 label: '性别',
76 bindtype: 'gender', 76 bindtype: 'gender',
77 - placeholder: '请选择性别', 77 + disabled: true,
  78 + placeholder: '性别',
78 values: ["男", "女"], 79 values: ["男", "女"],
79 selected: '', 80 selected: '',
80 onChange: 'onPickerSelect' 81 onChange: 'onPickerSelect'
@@ -159,8 +160,9 @@ Page({ @@ -159,8 +160,9 @@ Page({
159 // 时间picker 160 // 时间picker
160 birthDate: { 161 birthDate: {
161 label: '出生年月', 162 label: '出生年月',
  163 + disabled:true,
162 bindtype: 'birthday', 164 bindtype: 'birthday',
163 - placeholder: '请选择出生日期', 165 + placeholder: '出生日期',
164 selected: '', 166 selected: '',
165 mode: "date", 167 mode: "date",
166 fields: "day", 168 fields: "day",
@@ -112,6 +112,7 @@ Page({ @@ -112,6 +112,7 @@ Page({
112 text_tip: '去查看' 112 text_tip: '去查看'
113 }) 113 })
114 } 114 }
  115 + app.globalData.hostInfo = data.items[i]
115 } 116 }
116 datalist.push(data.items[i]) 117 datalist.push(data.items[i])
117 } 118 }
@@ -150,6 +150,21 @@ function checkNumber(theObj) { @@ -150,6 +150,21 @@ function checkNumber(theObj) {
150 return false; 150 return false;
151 } 151 }
152 152
  153 +function getAge(birthdate) {
  154 + var yearBirth = birthdate.substring(0, 4);
  155 + var monthBirth = birthdate.substring(5, 7);
  156 + var dayBirth = birthdate.substring(8, 10);
  157 + //获取当前年月日并计算年龄
  158 + var myDate = new Date();
  159 + var monthNow = myDate.getMonth() + 1;
  160 + var dayNow = myDate.getDay();
  161 + var age = myDate.getFullYear() - yearBirth;
  162 + if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
  163 + age--;
  164 + }
  165 + return age;
  166 +}
  167 +
153 module.exports = { 168 module.exports = {
154 formatTime: formatTime, 169 formatTime: formatTime,
155 formatTime_date: formatTime_date, 170 formatTime_date: formatTime_date,
@@ -162,5 +177,6 @@ module.exports = { @@ -162,5 +177,6 @@ module.exports = {
162 curDateTime: curDateTime, 177 curDateTime: curDateTime,
163 analyzeIDCard: analyzeIDCard, 178 analyzeIDCard: analyzeIDCard,
164 checkNumber: checkNumber, 179 checkNumber: checkNumber,
165 - isMobile: isMobile 180 + isMobile: isMobile,
  181 + getAge: getAge
166 } 182 }
注册登录 后发表评论