正在显示
3 个修改的文件
包含
96 行增加
和
14 行删除
... | ... | @@ -16,7 +16,10 @@ Page({ |
16 | 16 | birthday: "", |
17 | 17 | datas: "", |
18 | 18 | cardTypeArray : ['居民身份证', '中国护照', '港澳居民居住证', '台湾居民居住证', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'], |
19 | + countryArray:[], | |
20 | + countryAbleChoosed:true, | |
19 | 21 | cardtype:"", |
22 | + nation:"", | |
20 | 23 | birthday_datelong: -1, |
21 | 24 | }, |
22 | 25 | |
... | ... | @@ -42,7 +45,7 @@ Page({ |
42 | 45 | birthday_datelong: curdata.birthday |
43 | 46 | }) |
44 | 47 | } |
45 | - | |
48 | + this.getCountry() | |
46 | 49 | }, |
47 | 50 | |
48 | 51 | /** |
... | ... | @@ -91,6 +94,48 @@ Page({ |
91 | 94 | }) |
92 | 95 | }, |
93 | 96 | |
97 | + //****************获取国籍数据************/ | |
98 | + getCountry: function () { | |
99 | + var that = this | |
100 | + wx.showLoading({ | |
101 | + title: '', | |
102 | + }) | |
103 | + var Authorization = app.globalData.Authorization; | |
104 | + wx.request({ | |
105 | + url: baseUrl + 'persontax/v1/nation-list', | |
106 | + method: "GET", | |
107 | + header: { | |
108 | + 'content-type': 'application/json', // 默认值 | |
109 | + "Authorization": Authorization | |
110 | + }, | |
111 | + success: function (res) { | |
112 | + var countrys = res.data.concat() | |
113 | + that.data.countryArray = res.data | |
114 | + if (countrys.indexOf('中国') > -1) { | |
115 | + countrys.splice(countrys.indexOf('中国'), 1); | |
116 | + } | |
117 | + if (countrys.indexOf('中国台湾') > -1) { | |
118 | + countrys.splice(countrys.indexOf('中国台湾'), 1); | |
119 | + } | |
120 | + if (countrys.indexOf('香港') > -1) { | |
121 | + countrys.splice(countrys.indexOf('香港'), 1); | |
122 | + } | |
123 | + if (countrys.indexOf('澳门') > -1) { | |
124 | + countrys.splice(countrys.indexOf('澳门'), 1); | |
125 | + } | |
126 | + that.setData({ | |
127 | + countryArray: countrys, | |
128 | + }) | |
129 | + }, | |
130 | + fail(res) { | |
131 | + wx.hideLoading() | |
132 | + }, | |
133 | + complete() { | |
134 | + wx.hideLoading() | |
135 | + } | |
136 | + }) | |
137 | + }, | |
138 | + | |
94 | 139 | getIdInfo: function(e) { |
95 | 140 | wx.navigateTo({ |
96 | 141 | url: '../../taxperson/idinfo/idinfo' |
... | ... | @@ -104,7 +149,11 @@ Page({ |
104 | 149 | if (!formdata.name || formdata.name.length < 1) { |
105 | 150 | this.showToast("请输入姓名") |
106 | 151 | return; |
107 | - } else if (!formdata.id_card_no || formdata.id_card_no.length < 1) { | |
152 | + } | |
153 | + if (this.data.cardtype.length<1){ | |
154 | + this.showToast("请选择证照类型") | |
155 | + return; | |
156 | + }else if (!formdata.id_card_no || formdata.id_card_no.length < 1) { | |
108 | 157 | this.showToast("请输入身份证号") |
109 | 158 | return; |
110 | 159 | } else if (!format.isIDCardNum(formdata.id_card_no)) { |
... | ... | @@ -115,6 +164,10 @@ Page({ |
115 | 164 | this.showToast("请选择出生日期") |
116 | 165 | return; |
117 | 166 | } |
167 | + if (this.data.nation.length < 1) { | |
168 | + this.showToast("请选择出生日期") | |
169 | + return; | |
170 | + } | |
118 | 171 | this.goAdd(formdata) |
119 | 172 | }, |
120 | 173 | |
... | ... | @@ -127,10 +180,10 @@ Page({ |
127 | 180 | "id": that.data.supporter_id, |
128 | 181 | "legal_entity_id": that.data.legal_entity_id, |
129 | 182 | "co_supporter": formdata.name, |
130 | - "id_card_type": "1", | |
183 | + "id_card_type": that.data.cardtype, | |
131 | 184 | "id_card_no": formdata.id_card_no, |
132 | 185 | "birthday": that.data.birthday_datelong, |
133 | - "nation": "中国", | |
186 | + "nation": that.data.nation, | |
134 | 187 | "relation_ship": "兄、弟、姐、妹" |
135 | 188 | }, |
136 | 189 | header: { |
... | ... | @@ -167,7 +220,23 @@ Page({ |
167 | 220 | |
168 | 221 | bindCardtypeChange:function(e){ |
169 | 222 | console.log('bindCardtypeChange', e) |
170 | - | |
223 | + var card_type = this.data.cardTypeArray[e.detail.value] | |
224 | + var | |
225 | + var nation = this.data.nation | |
226 | + if (card_type=="居民身份证"||card_type=="中国护照"){ | |
227 | + nation = "中国" | |
228 | + } | |
229 | + this.setData({ | |
230 | + cardtype: card_type, | |
231 | + nation: nation | |
232 | + }) | |
233 | + }, | |
234 | + | |
235 | + bindnationChange: function (e) { | |
236 | + console.log('bindnationChange', e) | |
237 | + this.setData({ | |
238 | + nation: this.data.countryArray[e.detail.value] | |
239 | + }) | |
171 | 240 | }, |
172 | 241 | |
173 | 242 | showToast: function(data) { |
... | ... | @@ -182,7 +251,7 @@ Page({ |
182 | 251 | bindinput: function(e) { |
183 | 252 | console.log("bindinput", e.detail.value) |
184 | 253 | var idCardNo = e.detail.value |
185 | - if (idCardNo.length == 18) { | |
254 | + if (this.data.cardtype=='居民身份证'&&idCardNo.length == 18) { | |
186 | 255 | if (!format.isIDCardNum(idCardNo)) { |
187 | 256 | wx.showToast({ |
188 | 257 | image: "../../../../images/warn.png", | ... | ... |
... | ... | @@ -10,23 +10,26 @@ |
10 | 10 | <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right' placeholder='请输入姓名' name='name' value='{{name}}'></input> |
11 | 11 | </view> |
12 | 12 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> |
13 | - | |
14 | - <picker bindchange="bindPickerChange" value="{{index}}" range="{{cardTypeArray}}"> | |
15 | - <view style='height:90rpx;padding:0 30rpx ' bindchange="bindCardtypeChange"> | |
13 | + <picker bindchange="bindCardtypeChange" value="{{index}}" range="{{cardTypeArray}}"> | |
14 | + <view style='height:90rpx;padding:0 30rpx '> | |
16 | 15 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
17 | 16 | <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照类型</text> |
18 | 17 | <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> |
19 | - <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{cardtype}}</text> | |
18 | + <text wx:if="{{cardtype.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请输入证照类型</text> | |
19 | + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{cardtype}}</text> | |
20 | 20 | </view> |
21 | 21 | </picker> |
22 | 22 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> |
23 | 23 | <view style='height:90rpx;padding:0 30rpx'> |
24 | 24 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
25 | 25 | <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人证照号码</text> |
26 | - <view> | |
26 | + <view wx:if="{{cardtype=='居民身份证'}}"> | |
27 | 27 | <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' id="children_id_card_no"></image> |
28 | 28 | <input class='input_wrap01 float_right' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='id_card_no' maxlength='18' type='idcard' value='{{id_card_no}}' bindinput="bindinput"></input> |
29 | 29 | </view> |
30 | + <view wx:else> | |
31 | + <input class='input_wrap01 float_right' placeholder='请输入证件号码' placeholder-class='text_999_30' name='id_card_no' maxlength='24' value='{{id_card_no}}' bindinput="bindinput"></input> | |
32 | + </view> | |
30 | 33 | </view> |
31 | 34 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> |
32 | 35 | <picker mode="date" value="{{date}}" start="1919-01-01" end="2017-09-01" bindchange="bindDateChange"> |
... | ... | @@ -34,16 +37,26 @@ |
34 | 37 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
35 | 38 | <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人出生日期</text> |
36 | 39 | <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> |
37 | - <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{birthday}}</text> | |
40 | + <text wx:if="{{birthday.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请输入出生日期</text> | |
41 | + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{birthday}}</text> | |
38 | 42 | </view> |
39 | 43 | </picker> |
40 | 44 | <!-- <template is="picker_cell_normal" data="{{...commonbirthDate}}" /> --> |
41 | 45 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> |
42 | - <view style='height:90rpx;padding:0 30rpx'> | |
46 | + <!-- <view style='height:90rpx;padding:0 30rpx'> | |
43 | 47 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> |
44 | 48 | <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>被赡养人国籍</text> |
45 | 49 | <text style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>中国</text> |
50 | + </view> --> | |
51 | + <picker bindchange="bindnationChange" value="{{index}}" range="{{countryArray}}"> | |
52 | + <view style='height:90rpx;padding:0 30rpx '> | |
53 | + <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> | |
54 | + <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>被赡养人国籍</text> | |
55 | + <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> | |
56 | + <text wx:if="{{nation.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请选择国籍</text> | |
57 | + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{nation}}</text> | |
46 | 58 | </view> |
59 | + </picker> | |
47 | 60 | <view style="margin:0 30rpx;background:#e5e5e5;height:2rpx;"></view> |
48 | 61 | <view style='height:90rpx;padding:0 30rpx'> |
49 | 62 | <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text> | ... | ... |
... | ... | @@ -231,7 +231,7 @@ |
231 | 231 | </view> |
232 | 232 | <view style='height:70rpx'> |
233 | 233 | <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照类型:</text> |
234 | - <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.id_card_type=='1'?"居民身份证":itemdetail.id_card_type}}</text> | |
234 | + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.id_card_type}}</text> | |
235 | 235 | </view> |
236 | 236 | <view style='height:70rpx'> |
237 | 237 | <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照号码:</text> | ... | ... |
请
注册
或
登录
后发表评论