正在显示
2 个修改的文件
包含
143 行增加
和
44 行删除
@@ -2,6 +2,9 @@ | @@ -2,6 +2,9 @@ | ||
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 cardTypeArray = ['居民身份证', '中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)']; | ||
6 | +const cardTypeDicts = [{ 'code': '1', 'name': '居民身份证' }, { 'code': '2', 'name': '中国护照' }, { 'code': '3', 'name': '港澳居民来往内地通行证' }, { 'code': '4', 'name': '港澳居民居住证' }, { 'code': '5', 'name': '台湾居民来往大陆通行证' }, { 'code': '6', 'name': '台湾居民居住证' }, { 'code': '7', 'name': '外国护照' }, { 'code': '8', 'name': '外国人永久居留身份证' }, { 'code': '9', 'name': '外国人工作许可证(A类)' }, { 'code': '10', 'name': '外国人工作许可证(B类)' }, { 'code': '11', 'name': '外国人工作许可证(C类)' }]; | ||
7 | + | ||
5 | Page({ | 8 | Page({ |
6 | cur_id:null, | 9 | cur_id:null, |
7 | /** | 10 | /** |
@@ -36,14 +39,12 @@ Page({ | @@ -36,14 +39,12 @@ Page({ | ||
36 | }, | 39 | }, |
37 | cardtypeData: { | 40 | cardtypeData: { |
38 | isrequre: true, | 41 | isrequre: true, |
39 | - disabled: true, | ||
40 | label: '证照类型', | 42 | label: '证照类型', |
41 | bindtype: 'cardtype', | 43 | bindtype: 'cardtype', |
42 | - selected: '居民身份证', | ||
43 | placeholder: '请选择证照类型', | 44 | placeholder: '请选择证照类型', |
44 | - values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照', | ||
45 | - '外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证' | ||
46 | - ], | 45 | + values: cardTypeDicts, |
46 | + // values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照','外国护照', '香港永久性居民身份证', '澳门特别行政区永久性居民身份证', '台湾身份证', '台湾居民来往大陆通行证', '外国人永久居留证'], | ||
47 | + range_key: 'name', | ||
47 | onChange: 'onPickerSelect' | 48 | onChange: 'onPickerSelect' |
48 | }, | 49 | }, |
49 | forignerInfo: { | 50 | forignerInfo: { |
@@ -58,14 +59,22 @@ Page({ | @@ -58,14 +59,22 @@ Page({ | ||
58 | genderData: { | 59 | genderData: { |
59 | label: '性别', | 60 | label: '性别', |
60 | bindtype: 'gender', | 61 | bindtype: 'gender', |
61 | - disabled: true, | 62 | + // disabled: true, |
62 | selected: '', | 63 | selected: '', |
63 | - // placeholder: '请选择性别', | ||
64 | - placeholder: '性别', | 64 | + placeholder: '请选择性别', |
65 | + // placeholder: '性别', | ||
65 | values: ["男", "女"], | 66 | values: ["男", "女"], |
66 | onChange: 'onPickerSelect' | 67 | onChange: 'onPickerSelect' |
67 | }, | 68 | }, |
68 | - | 69 | + countryData: { |
70 | + label: '国籍', | ||
71 | + bindtype: 'country', | ||
72 | + isrequre: true, | ||
73 | + selected: '', | ||
74 | + // range_key:'name', | ||
75 | + placeholder: '请选择国籍', | ||
76 | + onChange: 'onPickerSelect', | ||
77 | + }, | ||
69 | }, | 78 | }, |
70 | 79 | ||
71 | /** | 80 | /** |
@@ -112,25 +121,28 @@ Page({ | @@ -112,25 +121,28 @@ Page({ | ||
112 | }, | 121 | }, |
113 | //对各参数初始赋值 | 122 | //对各参数初始赋值 |
114 | handleDatas: function (tax_info) { | 123 | handleDatas: function (tax_info) { |
124 | + this.dealCardType(tax_info.id_card_type)//为防止干扰其他字段,需要先执行 | ||
115 | 125 | ||
116 | var isDisable = tax_info.certification_status == 'active' && tax_info.id_card_no.length//已通过拍摄身份证认证过,不能修改 | 126 | var isDisable = tax_info.certification_status == 'active' && tax_info.id_card_no.length//已通过拍摄身份证认证过,不能修改 |
117 | 127 | ||
118 | this.data.relativeData.selected = tax_info.family_ties | 128 | this.data.relativeData.selected = tax_info.family_ties |
119 | - // this.data.cardtypeData.selected = tax_info.id_card_type | ||
120 | this.data.genderData.selected = tax_info.gender | 129 | this.data.genderData.selected = tax_info.gender |
130 | + this.data.countryData.selected = tax_info.native | ||
121 | // this.data.genderData.disabled = isDisable | 131 | // this.data.genderData.disabled = isDisable |
122 | 132 | ||
123 | this.setData({ | 133 | this.setData({ |
124 | isDisable: isDisable, | 134 | isDisable: isDisable, |
125 | relativeData: this.data.relativeData, | 135 | relativeData: this.data.relativeData, |
126 | name: tax_info.name, | 136 | name: tax_info.name, |
127 | - // cardtypeData: this.data.cardtypeData, | 137 | + cardtypeData: this.data.cardtypeData, |
138 | + age: tax_info.age, | ||
128 | mobile: tax_info.mobile, | 139 | mobile: tax_info.mobile, |
129 | genderData: this.data.genderData, | 140 | genderData: this.data.genderData, |
130 | isIdCard: '居民身份证' == tax_info.id_card_type ? true : false, | 141 | isIdCard: '居民身份证' == tax_info.id_card_type ? true : false, |
131 | - card_number: tax_info.id_card_no | 142 | + card_number: tax_info.id_card_no, |
143 | + countryData: this.data.countryData | ||
132 | }) | 144 | }) |
133 | - this.dealIdInfo(tax_info.id_card_no)//处理了性别和年龄 | 145 | + // this.dealIdInfo(tax_info.id_card_no)//处理了性别和年龄 |
134 | }, | 146 | }, |
135 | 147 | ||
136 | /** | 148 | /** |
@@ -162,8 +174,9 @@ Page({ | @@ -162,8 +174,9 @@ Page({ | ||
162 | } else if (id_info.birthday.month < 10 && id_info.birthday.day < 10) { | 174 | } else if (id_info.birthday.month < 10 && id_info.birthday.day < 10) { |
163 | birth_day = id_info.birthday.year + '-0' + id_info.birthday.month + '-0' + id_info.birthday.day; | 175 | birth_day = id_info.birthday.year + '-0' + id_info.birthday.month + '-0' + id_info.birthday.day; |
164 | } | 176 | } |
165 | - // var cardtype_Data = that.data.cardtypeData | ||
166 | - // cardtype_Data.selected = '居民身份证' | 177 | + var cardtype_Data = that.data.cardtypeData |
178 | + cardtype_Data.selected = '居民身份证' | ||
179 | + cardtypeData.selected_code = '1' | ||
167 | var gender_Data = that.data.genderData | 180 | var gender_Data = that.data.genderData |
168 | gender_Data.selected = id_info.gender | 181 | gender_Data.selected = id_info.gender |
169 | 182 | ||
@@ -181,13 +194,13 @@ Page({ | @@ -181,13 +194,13 @@ Page({ | ||
181 | idInfoData: id_info, | 194 | idInfoData: id_info, |
182 | name: id_info.name, | 195 | name: id_info.name, |
183 | // birthday: birth_day, | 196 | // birthday: birth_day, |
184 | - // cardtypeData: cardtype_Data, | 197 | + cardtypeData: cardtype_Data, |
185 | genderData: gender_Data, | 198 | genderData: gender_Data, |
186 | // long_birth_date: Date.parse(new Date(birth_day)) / 1000, | 199 | // long_birth_date: Date.parse(new Date(birth_day)) / 1000, |
187 | // birthDate: that.data.birthDate, | 200 | // birthDate: that.data.birthDate, |
188 | card_number: id_info.id_card_number | 201 | card_number: id_info.id_card_number |
189 | }) | 202 | }) |
190 | - that.dealIdInfo(id_info.id_card_number) | 203 | + // that.dealIdInfo(id_info.id_card_number) |
191 | } | 204 | } |
192 | }, | 205 | }, |
193 | }) | 206 | }) |
@@ -199,6 +212,80 @@ Page({ | @@ -199,6 +212,80 @@ Page({ | ||
199 | }) | 212 | }) |
200 | }, | 213 | }, |
201 | 214 | ||
215 | + dealCardType: function (new_type_code) { | ||
216 | + var is_idcard = this.data.isIdCard | ||
217 | + const new_type = cardTypeArray[parseInt(new_type_code) - 1] | ||
218 | + this.data.cardtypeData.selected_code = new_type_code | ||
219 | + this.data.cardtypeData.selected = new_type | ||
220 | + | ||
221 | + if ('居民身份证' == new_type) { | ||
222 | + is_idcard = true | ||
223 | + this.data.genderData.disabled = true | ||
224 | + // this.data.birthDate.disabled = true | ||
225 | + } else { | ||
226 | + is_idcard = false | ||
227 | + this.data.genderData.disabled = false | ||
228 | + // this.data.birthDate.disabled = false | ||
229 | + } | ||
230 | + // this.data.hasOtherCard = true | ||
231 | + this.data.overseas = '否' | ||
232 | + // this.data.taxpayerTypeData.disabled = false | ||
233 | + // this.data.taxpayerTypeData.selected = '' | ||
234 | + if ('居民身份证' == new_type || '中国护照' == new_type) { | ||
235 | + this.data.countryData.selected = '中国' | ||
236 | + this.data.countryData.disabled = true | ||
237 | + // this.data.hasOtherCard = false | ||
238 | + // this.data.taxpayerTypeData.selected = '居民' | ||
239 | + // this.data.taxpayerTypeData.disabled = true | ||
240 | + } else if (new_type.indexOf("港澳") != -1) { | ||
241 | + this.data.countryData.values = ['中国香港', '中国澳门'] | ||
242 | + this.data.countryData.selected = '' | ||
243 | + this.data.countryData.disabled = false | ||
244 | + // this.data.nameText = '英文名' | ||
245 | + // if (new_type.indexOf('通行证') != -1) { | ||
246 | + // this.data.otherCardtypeData.values = [{ 'code': '4', 'name': '港澳居民居住证' }]; | ||
247 | + // } else { | ||
248 | + // this.data.otherCardtypeData.values = [{ 'code': '3', 'name': '港澳居民来往内地通行证' }]; | ||
249 | + // } | ||
250 | + } else if (new_type.indexOf("台湾") != -1) { | ||
251 | + this.data.countryData.selected = '中国台湾' | ||
252 | + this.data.countryData.disabled = true | ||
253 | + // this.data.nameText = '英文名' | ||
254 | + // if (new_type.indexOf('通行证') != -1) { | ||
255 | + // this.data.otherCardtypeData.values = [{ 'code': '6', 'name': '台湾居民居住证' }]; | ||
256 | + // } else { | ||
257 | + // this.data.otherCardtypeData.values = [{ 'code': '5', 'name': '台湾居民来往大陆通行证' }]; | ||
258 | + // } | ||
259 | + | ||
260 | + } else { | ||
261 | + this.data.overseas = '是' | ||
262 | + this.data.countryData.selected = '' | ||
263 | + this.data.countryData.values = this.countrys ? this.countrys : [] | ||
264 | + this.data.countryData.disabled = false | ||
265 | + // this.data.nameText = '中文名' | ||
266 | + // if (new_type.indexOf("外国护照") != -1) { | ||
267 | + // this.data.otherCardtypeData.values = [{ 'code': '8', 'name': '外国人永久居留身份证' }, { 'code': '9', 'name': '外国人工作许可证(A类)' }, { 'code': '10', 'name': '外国人工作许可证(B类)' }, { 'code': '11', 'name': '外国人工作许可证(C类)' }]; | ||
268 | + // } else { | ||
269 | + // this.data.otherCardtypeData.values = [{ 'code': '7', 'name': '外国护照' }]; | ||
270 | + // } | ||
271 | + } | ||
272 | + this.setData({ | ||
273 | + isIdCard: is_idcard, | ||
274 | + // hasOtherCard: this.data.hasOtherCard, | ||
275 | + genderData: this.data.genderData, | ||
276 | + // birthDate: this.data.birthDate, | ||
277 | + countryData: this.data.countryData, | ||
278 | + cardtypeData: this.data.cardtypeData, | ||
279 | + // otherCardtypeData: this.data.otherCardtypeData, | ||
280 | + // nameText: this.data.nameText, | ||
281 | + overseas: this.data.overseas, | ||
282 | + // taxpayerTypeData: this.data.taxpayerTypeData | ||
283 | + }) | ||
284 | + | ||
285 | + | ||
286 | + }, | ||
287 | + | ||
288 | + | ||
202 | // =============普通单列picker选中处理============== | 289 | // =============普通单列picker选中处理============== |
203 | onPickerSelect: function(e) { | 290 | onPickerSelect: function(e) { |
204 | console.log('picker发送选择改变,携带值为', e) | 291 | console.log('picker发送选择改变,携带值为', e) |
@@ -211,18 +298,15 @@ Page({ | @@ -211,18 +298,15 @@ Page({ | ||
211 | }) | 298 | }) |
212 | break; | 299 | break; |
213 | case 'cardtype': | 300 | case 'cardtype': |
214 | - var is_idcard = this.data.isIdCard | ||
215 | - var cardtype_data = this.data.cardtypeData | ||
216 | - cardtype_data.selected = cardtype_data.values[e.detail.value] | ||
217 | - if (0 == e.detail.value) { | ||
218 | - is_idcard = true | ||
219 | - } else { | ||
220 | - is_idcard = false | ||
221 | - } | ||
222 | - this.setData({ | ||
223 | - isIdCard: is_idcard, | ||
224 | - cardtypeData: cardtype_data | ||
225 | - }) | 301 | + var cardtypeData = this.data.cardtypeData |
302 | + var new_type = cardtypeData.values[e.detail.value]['name'] | ||
303 | + var new_type_code = cardtypeData.values[e.detail.value]['code'] | ||
304 | + // if (new_type != cardtypeData.selected) { | ||
305 | + this.dealCardType(new_type_code) | ||
306 | + this.setData({ | ||
307 | + card_number: "" | ||
308 | + }) | ||
309 | + // } | ||
226 | break; | 310 | break; |
227 | case 'gender': | 311 | case 'gender': |
228 | var gender_data = this.data.genderData | 312 | var gender_data = this.data.genderData |
@@ -231,7 +315,16 @@ Page({ | @@ -231,7 +315,16 @@ Page({ | ||
231 | genderData: gender_data | 315 | genderData: gender_data |
232 | }) | 316 | }) |
233 | break; | 317 | break; |
234 | - | 318 | + case 'country': |
319 | + var countryData = this.data.countryData | ||
320 | + var new_country = countryData.values[e.detail.value] | ||
321 | + if (new_country != countryData.selected) { | ||
322 | + countryData.selected = new_country | ||
323 | + this.setData({ | ||
324 | + countryData: countryData | ||
325 | + }) | ||
326 | + } | ||
327 | + break; | ||
235 | } | 328 | } |
236 | 329 | ||
237 | }, | 330 | }, |
@@ -338,14 +431,15 @@ Page({ | @@ -338,14 +431,15 @@ Page({ | ||
338 | data: { | 431 | data: { |
339 | 'certification_status': that.getCertifyStatus(formdata), | 432 | 'certification_status': that.getCertifyStatus(formdata), |
340 | "family_ties": that.data.relativeData.selected, | 433 | "family_ties": that.data.relativeData.selected, |
341 | - "id_card_type": '居民身份证',//that.data.cardtypeData.selected, | 434 | + "id_card_type": that.data.cardtypeData.selected_code, |
342 | "id_card_no": that.data.card_number, | 435 | "id_card_no": that.data.card_number, |
343 | "name": name, | 436 | "name": name, |
344 | "gender": that.data.genderData.selected, | 437 | "gender": that.data.genderData.selected, |
345 | "mobile": formdata.mobile, | 438 | "mobile": formdata.mobile, |
346 | //"age": formdata.age ? formdata.age : '',//不传 | 439 | //"age": formdata.age ? formdata.age : '',//不传 |
347 | - "native": "中国", | ||
348 | - "is_overseas_personnel": "否", | 440 | + "age": formdata.age ? formdata.age : '', |
441 | + "native": that.data.countryData.selected, | ||
442 | + "is_overseas_personnel": that.data.overseas, | ||
349 | }, | 443 | }, |
350 | header: { | 444 | header: { |
351 | 'content-type': 'application/json', // 默认值 | 445 | 'content-type': 'application/json', // 默认值 |
@@ -418,6 +512,9 @@ Page({ | @@ -418,6 +512,9 @@ Page({ | ||
418 | this.setData({ | 512 | this.setData({ |
419 | card_number: idCardNo | 513 | card_number: idCardNo |
420 | }) | 514 | }) |
515 | + if (!this.data.isIdCard) { | ||
516 | + return; | ||
517 | + } | ||
421 | if (e.detail.value.length == 18){ | 518 | if (e.detail.value.length == 18){ |
422 | if (!format.isIDCardNum(idCardNo)) { | 519 | if (!format.isIDCardNum(idCardNo)) { |
423 | wx.showToast({ | 520 | wx.showToast({ |
@@ -434,6 +531,9 @@ Page({ | @@ -434,6 +531,9 @@ Page({ | ||
434 | this.setData({ | 531 | this.setData({ |
435 | card_number: idCardNo | 532 | card_number: idCardNo |
436 | }) | 533 | }) |
534 | + if (!this.data.isIdCard) { | ||
535 | + return; | ||
536 | + } | ||
437 | if (!idCardNo.length) { | 537 | if (!idCardNo.length) { |
438 | wx.showToast({ | 538 | wx.showToast({ |
439 | image: "../../../../images/warn.png", | 539 | image: "../../../../images/warn.png", |
@@ -10,12 +10,12 @@ | @@ -10,12 +10,12 @@ | ||
10 | 10 | ||
11 | <template is="picker_cell_normal" data="{{...relativeData}}" /> | 11 | <template is="picker_cell_normal" data="{{...relativeData}}" /> |
12 | <view class="divide_line_30"></view> | 12 | <view class="divide_line_30"></view> |
13 | - | ||
14 | - <view class='item_body'> | 13 | + <template is="picker_cell_normal" data="{{...cardtypeData}}" /> |
14 | + <!-- <view class='item_body'> | ||
15 | <text class='red_star_right_10'>*</text> | 15 | <text class='red_star_right_10'>*</text> |
16 | <text class='text_777_30 float_left'>证照类型</text> | 16 | <text class='text_777_30 float_left'>证照类型</text> |
17 | <text class='text_black_30 float_right' style='line-height: 90rpx'>居民身份证</text> | 17 | <text class='text_black_30 float_right' style='line-height: 90rpx'>居民身份证</text> |
18 | - </view> | 18 | + </view> --> |
19 | <view class="divide_line_30"></view> | 19 | <view class="divide_line_30"></view> |
20 | 20 | ||
21 | <view class='item_body'> | 21 | <view class='item_body'> |
@@ -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='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='30' 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> |
@@ -43,21 +43,20 @@ | @@ -43,21 +43,20 @@ | ||
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_999_30' placeholder='年龄' maxlength='2' value='{{age}}' disabled='true'></input> | 46 | + <input class='input_wrap' name='age' type='number' placeholder-class='text_999_30' placeholder='年龄' maxlength='2' value='{{age}}' disabled='{{isIdCard}}'></input> |
47 | </view> | 47 | </view> |
48 | - <view class="divide_line_30"></view> | ||
49 | - | ||
50 | - | ||
51 | - <view class='item_body'> | 48 | + <view class="divide_line_30"></view> |
49 | + <template is="picker_cell_normal" data="{{...countryData}}" /> | ||
50 | + <!-- <view class='item_body'> | ||
52 | <text class='red_star_right_10'>*</text> | 51 | <text class='red_star_right_10'>*</text> |
53 | <text class='text_777_30 float_left' style='line-height: 90rpx'>国籍</text> | 52 | <text class='text_777_30 float_left' style='line-height: 90rpx'>国籍</text> |
54 | <text class='text_black_30 float_right' style='line-height: 90rpx' >中国</text> | 53 | <text class='text_black_30 float_right' style='line-height: 90rpx' >中国</text> |
55 | - </view> | 54 | + </view> --> |
56 | <view class="divide_line_30"></view> | 55 | <view class="divide_line_30"></view> |
57 | <view class='item_body'> | 56 | <view class='item_body'> |
58 | <text class='red_star_right_10'>*</text> | 57 | <text class='red_star_right_10'>*</text> |
59 | <text class='text_777_30 float_left' style='line-height: 90rpx'>是否境外人员</text> | 58 | <text class='text_777_30 float_left' style='line-height: 90rpx'>是否境外人员</text> |
60 | - <text class='text_black_30 float_right' style='line-height: 90rpx' >否</text> | 59 | + <text class='text_black_30 float_right' style='line-height: 90rpx' >{{overseas}}</text> |
61 | </view> | 60 | </view> |
62 | <!-- <template is="picker_cell_normal" data="{{...forignerInfo}}" /> --> | 61 | <!-- <template is="picker_cell_normal" data="{{...forignerInfo}}" /> --> |
63 | <view class="divide_line_30"></view> | 62 | <view class="divide_line_30"></view> |
请
注册
或
登录
后发表评论