提交 7fa1b604941ea5786f9b911752d6115359cc80ad
Merge branch '机器人dev' into 苏州英格玛
# Conflicts: # app.js # app.json # pages/main/advancepayment/adPayHome.js # pages/main/guide/guide.js # pages/main/guide/guide.wxml
正在显示
39 个修改的文件
包含
1095 行增加
和
69 行删除
... | ... | @@ -71,6 +71,7 @@ App({ |
71 | 71 | that.globalData.wx_open_id = user.wx_open_id; |
72 | 72 | that.globalData.Authorization = "Bearer " + res.data.access_token; |
73 | 73 | that.globalData.refresh_token = res.data.refresh_token; |
74 | + that.globalData.real_auth_status = res.data.user.real_auth_status; | |
74 | 75 | if (user && user.type == "0") { //匿名用户 |
75 | 76 | wx.redirectTo({ |
76 | 77 | // url: '../../getPhone/getPhone' |
... | ... | @@ -156,6 +157,7 @@ App({ |
156 | 157 | refresh_token: "", |
157 | 158 | tenant_id: "", |
158 | 159 | wx_open_id: "", |
160 | + real_auth_status:'', | |
159 | 161 | newComerOrder: null |
160 | 162 | } |
161 | 163 | }) |
\ No newline at end of file | ... | ... |
... | ... | @@ -12,9 +12,7 @@ |
12 | 12 | "pages/main/addtionalreduce/godetail/godetail", |
13 | 13 | "pages/main/addtionalreduce/lookandupdate/lookandupdate", |
14 | 14 | "pages/main/addtionalreduce/addextrainfo/addextrainfo", |
15 | - | |
16 | 15 | "pages/main/addtionalreduce/adddupporters/adddupporters", |
17 | - | |
18 | 16 | "pages/main/addtionalreduce/additiondetail/additiondetail", |
19 | 17 | "pages/main/advancepayment/adPayHome", |
20 | 18 | "pages/main/finalpayment/home", |
... | ... | @@ -22,12 +20,16 @@ |
22 | 20 | "pages/main/finalpayment/historylist/historylist", |
23 | 21 | "pages/main/finalpayment/historydetail/historydetail", |
24 | 22 | "pages/login/login", |
25 | - "pages/main/advancepayment/adPayDetails/adPayDetails" | |
23 | + "pages/main/advancepayment/adPayDetails/adPayDetails", | |
24 | + "pages/main/verify/verify_info", | |
25 | + "pages/main/verify/verify_result/verify_result", | |
26 | + "pages/main/verify/verify_idcard/verify_idcard" | |
26 | 27 | ], |
27 | 28 | "window": { |
28 | 29 | "backgroundTextStyle": "light", |
29 | 30 | "navigationBarBackgroundColor": "#4478e3", |
30 | 31 | "navigationBarTitleText": "WeChat", |
31 | 32 | "navigationBarTextStyle": "white" |
32 | - } | |
33 | + }, | |
34 | + "sitemapLocation": "sitemap.json" | |
33 | 35 | } |
\ No newline at end of file | ... | ... |
images/close02.png
0 → 100644
2.1 KB
images/noDataIcon.jpg
已删除
100644 → 0
33.1 KB
images/nodeclare_img.png
已删除
100644 → 0
39.2 KB
images/step_first_blue.png
0 → 100644
1.6 KB
images/step_second_blue.png
0 → 100644
2.3 KB
images/step_second_gray.png
0 → 100644
2.3 KB
images/verify_dialog.png
0 → 100644
67.3 KB
images/verify_fail.png
0 → 100644
26.9 KB
images/verify_succ.png
0 → 100644
26.9 KB
... | ... | @@ -64,7 +64,7 @@ Page({ |
64 | 64 | app.globalData.tenant_id = tenant.id; |
65 | 65 | app.globalData.userInfo = user; |
66 | 66 | app.globalData.wx_open_id = user.wx_open_id; |
67 | - | |
67 | + app.globalData.real_auth_status = res.data.user.real_auth_status; | |
68 | 68 | app.configOssUrl() |
69 | 69 | wx.reLaunch({ |
70 | 70 | url: '../main/guide/guide' | ... | ... |
... | ... | @@ -125,6 +125,7 @@ Page({ |
125 | 125 | var tenant = res.data.tenant; |
126 | 126 | app.globalData.tenant_id = tenant.id; |
127 | 127 | app.globalData.userInfo = user; |
128 | + app.globalData.real_auth_status = res.data.user.real_auth_status; | |
128 | 129 | app.globalData.wx_open_id = user.wx_open_id; |
129 | 130 | app.configOssUrl() |
130 | 131 | wx.reLaunch({ | ... | ... |
... | ... | @@ -111,6 +111,6 @@ |
111 | 111 | |
112 | 112 | </view> |
113 | 113 | <view wx:if="{{hascompleted&&additionlist.length<1}}" style='background:#fff;'> |
114 | - <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/nodeclare_img.png'></image> | |
114 | + <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/noreduce_img.png'></image> | |
115 | 115 | </view> |
116 | 116 | </view> |
\ No newline at end of file | ... | ... |
... | ... | @@ -399,9 +399,10 @@ |
399 | 399 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_rent'}}" class='modal_img02' src="/images/house_declare_rent.png"></image> |
400 | 400 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_loan'}}" class='modal_img' src="/images/house_declare_loan.png"></image> |
401 | 401 | <!-- <text style='position:absolute;font-size:20px;color:#fff;float:right;top:0;right:100rpx' bindtap='closeModalImg'>x</text> --> |
402 | - <view style='width:80rpx;height:80rpx;position:absolute;float:right;top:0;right:0;display:flex;align-items:center;justify-content:center;' bindtap='closeModalImg'> | |
402 | + <view style='width:80rpx;height:80rpx;position:absolute;float:right;top:0;right:0;display:flex;align-items:center;justify-content:center;' bindtap='closeModalImg'> | |
403 | 403 | <image style='width:30rpx;height:30rpx;' src='/images/close.png'></image> |
404 | 404 | </view> |
405 | + | |
405 | 406 | </view> |
406 | 407 | |
407 | 408 | <!-- 扣除类型 --> | ... | ... |
... | ... | @@ -112,8 +112,10 @@ Page({ |
112 | 112 | handleSalaryData: function (items) { |
113 | 113 | for (var i = 0; i < items.length; ++i) { |
114 | 114 | var item = items[i] |
115 | + console.log("item---", item) | |
115 | 116 | item.payroll_date = format.formatTime_date(item.payroll_date) |
116 | 117 | item.count_date = format.formatDate_min(item.start_time) + '-' + format.formatDate_min(item.end_time) |
118 | + item.zeroShow = item.zero_display=='yes'?true:false//是否展示非0字段 | |
117 | 119 | item.detals = this.handleDetailsData(item) |
118 | 120 | item.isshow = false |
119 | 121 | } |
... | ... | @@ -193,10 +195,10 @@ Page({ |
193 | 195 | }, |
194 | 196 | |
195 | 197 | handleDetailsData: function (data) { |
196 | - | |
197 | - let titles = JSON.parse(data['slip_titles']) | |
198 | + let titles = JSON.parse(data['slip_titles']) | |
198 | 199 | let detail = JSON.parse(data['detail']) |
199 | - let mapping_keys = data["mapping_keys"] ? data["mapping_keys"] : [] | |
200 | + let mapping_keys = data["mapping_keys"] ? data["mapping_keys"]:[] | |
201 | + console.log(titles,detail,mapping_keys) | |
200 | 202 | var details = [] |
201 | 203 | for (var i = 0; i < titles.length; ++i) { |
202 | 204 | var titleData = titles[i] |
... | ... | @@ -205,14 +207,15 @@ Page({ |
205 | 207 | if (!title) { |
206 | 208 | title = titleData['original_column'] |
207 | 209 | } |
208 | - if (!value) { | |
210 | + if (value != 0 && !value) { | |
209 | 211 | value = data[titleData['key']] |
210 | 212 | if (value != undefined) { |
211 | 213 | value += 'tax_rate' == titleData['key'] ? '%' : '' |
212 | 214 | } |
213 | 215 | } |
214 | - if (!title || !value) continue; | |
215 | - if (mapping_keys.indexOf(titleData['key']) == -1 && value == '0') continue; | |
216 | + if (!title) continue; | |
217 | + if (!title || (value != 0 && !value)) continue; | |
218 | + // if (mapping_keys.indexOf(titleData['key']) == -1 && (value == '0' || value == 0)) continue; | |
216 | 219 | details.push({ |
217 | 220 | title: title, |
218 | 221 | value: value | ... | ... |
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | <view class="swiper-box page" style="height:100%;margin-top:20rpx" bindchange="bindChange"> |
17 | 17 | <view wx:if="{{currentTab==0}}"> |
18 | 18 | <view wx:if="{{hascompleted_tax&&taxDatas.length<1}}" style='background:#fff;width:100%; align-items: center;'> |
19 | - <image style='width:418rpx;height:254rpx;margin: 0 auto;padding-top:300rpx; display: block;' mode="aspectFit" src='/images/noDataIcon.jpg'></image> | |
19 | + <image style='width:418rpx;height:254rpx;margin: 0 auto;padding-top:300rpx; display: block;' mode="aspectFit" src='/images/nodata.png'></image> | |
20 | 20 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>还没有企业为您申报个税哦~</view> |
21 | 21 | </view> |
22 | 22 | <view wx:for="{{taxDatas}}" style='margin-bottom:20rpx'> |
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | </view> |
36 | 36 | <view wx:else> <!-- 工资明细 --> |
37 | 37 | <view wx:if="{{hascompleted_sal&&salaryDatas.length<1}}" style='background:#fff;'> |
38 | - <image style='width:418rpx;height:254rpx;margin: 0 auto;padding-top:300rpx; display: block;' mode="aspectFit" src='/images/noDataIcon.jpg'></image> | |
38 | + <image style='width:418rpx;height:254rpx;margin: 0 auto;padding-top:300rpx; display: block;' mode="aspectFit" src='/images/nodata.png'></image> | |
39 | 39 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>您还没有工资条哦~</view> |
40 | 40 | </view> |
41 | 41 | <view wx:for="{{salaryDatas}}" style='margin-bottom:20rpx'> |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | <view class='divide_line_f5f5f5' style='margin:30rpx 0'></view> |
58 | 58 | </view> |
59 | 59 | <view wx:if="{{item.isshow}}" wx:for="{{item.detals}}" wx:for-item='detal'> |
60 | - <view> | |
60 | + <view hidden="{{!item.zeroShow&&(detal.value=='0'||detal.value==0)}}" > | |
61 | 61 | <text class='text_999_28'>{{detal.title}}</text> |
62 | 62 | <text class='text_999_28' style='color:#333;text-align:right;float: right'>{{detal.value}}</text> |
63 | 63 | </view> | ... | ... |
1 | 1 | // pages/main/guide/guide.js |
2 | 2 | var baseUrl = getApp().globalData.baseUrl; |
3 | +let Authorization = ''; | |
3 | 4 | Page({ |
4 | 5 | |
5 | 6 | /** |
... | ... | @@ -7,14 +8,15 @@ Page({ |
7 | 8 | */ |
8 | 9 | data: { |
9 | 10 | isshow: false, |
10 | - mobile:"" | |
11 | + onresume: false, | |
12 | + has_verify: true | |
11 | 13 | }, |
12 | 14 | |
13 | 15 | /** |
14 | 16 | * 生命周期函数--监听页面加载 |
15 | 17 | */ |
16 | 18 | onLoad: function(options) { |
17 | - | |
19 | + | |
18 | 20 | }, |
19 | 21 | |
20 | 22 | /** |
... | ... | @@ -28,38 +30,77 @@ Page({ |
28 | 30 | * 生命周期函数--监听页面显示 |
29 | 31 | */ |
30 | 32 | onShow: function() { |
31 | - var user = getApp().globalData.userInfo | |
32 | - if (user && user.mobile.length==11){ | |
33 | - this.setData({ | |
34 | - mobile: user.mobile | |
35 | - }) | |
36 | - this.taxconfirm(); | |
37 | - } | |
33 | + console.log("onshow") | |
34 | + this.setData({ | |
35 | + onresume:true | |
36 | + }) | |
37 | + this.checkUserInfo("") | |
38 | 38 | }, |
39 | 39 | |
40 | - taxconfirm: function() { | |
40 | + //判断该雇员是否有姓名和身份证号 | |
41 | + checkUserInfo: function (skip_type) { | |
41 | 42 | var that = this; |
42 | - var Authorization = getApp().globalData.Authorization; | |
43 | + Authorization = getApp().globalData.Authorization; | |
44 | + var real_auth_status = getApp().globalData.real_auth_status | |
45 | + console.log("real_auth_status", real_auth_status) | |
43 | 46 | console.log("Authorization", Authorization) |
44 | 47 | if (Authorization && Authorization.length > 10) { |
45 | - wx.request({ | |
46 | - url: baseUrl + 'persontax/v1/personal-taxes-confirm', | |
47 | - header: { | |
48 | - 'content-type': 'application/json', | |
49 | - "Authorization": Authorization | |
50 | - }, | |
51 | - success: function(res) { | |
52 | - console.log("taxconfirm", res) | |
53 | - if (res.statusCode == 200 && !that.data.isshow && res.data.status != '0' ) { //未完善 | |
54 | - that.showModal(res.data) | |
55 | - } else { | |
56 | - that.setData({ | |
57 | - isshow: false | |
48 | + // that.setData({ | |
49 | + // has_verify: false | |
50 | + // }) | |
51 | + if (real_auth_status == 'active') { //不需要再实名认证 | |
52 | + that.setData({ | |
53 | + has_verify: true, | |
54 | + onresume: false, | |
55 | + }) | |
56 | + that.taxconfirm(skip_type); | |
57 | + } else { | |
58 | + that.setData({ | |
59 | + has_verify: false | |
60 | + }) | |
61 | + } | |
62 | + } | |
63 | + }, | |
64 | + | |
65 | + taxconfirm: function(skip_type) { | |
66 | + var that = this; | |
67 | + Authorization = getApp().globalData.Authorization; | |
68 | + | |
69 | + wx.request({ | |
70 | + url: baseUrl + 'persontax/v1/personal-taxes-confirm', | |
71 | + header: { | |
72 | + 'content-type': 'application/json', | |
73 | + "Authorization": Authorization | |
74 | + }, | |
75 | + success: function(res) { | |
76 | + console.log("taxconfirm", res) | |
77 | + if (res.statusCode == 200 && !that.data.isshow && res.data.status != '0') { //未完善 | |
78 | + that.showModal(res.data) | |
79 | + } else { | |
80 | + that.setData({ | |
81 | + isshow: false | |
82 | + }) | |
83 | + if(skip_type=="1"){ | |
84 | + wx.navigateTo({ | |
85 | + url: '../taxperson/home', | |
86 | + }) | |
87 | + } else if (skip_type == "2") { | |
88 | + wx.navigateTo({ | |
89 | + url: '../addtionalreduce/home', | |
90 | + }) | |
91 | + } else if (skip_type == "3") { | |
92 | + wx.navigateTo({ | |
93 | + url: '../advancepayment/adPayHome', | |
58 | 94 | }) |
59 | - } | |
95 | + } else if (skip_type == "4") { | |
96 | + wx.navigateTo({ | |
97 | + url: '../finalpayment/home', | |
98 | + }) | |
99 | + } | |
60 | 100 | } |
61 | - }) | |
62 | - } | |
101 | + } | |
102 | + }) | |
103 | + | |
63 | 104 | }, |
64 | 105 | |
65 | 106 | showModal: function(data) { |
... | ... | @@ -78,7 +119,9 @@ Page({ |
78 | 119 | that.setData({ |
79 | 120 | isshow: false |
80 | 121 | }) |
81 | - that.gotaxPerson() | |
122 | + wx.navigateTo({ | |
123 | + url: '../taxperson/home', | |
124 | + }) | |
82 | 125 | } |
83 | 126 | } |
84 | 127 | }) |
... | ... | @@ -88,36 +131,28 @@ Page({ |
88 | 131 | * 自然人信息采集 |
89 | 132 | */ |
90 | 133 | gotaxPerson: function() { |
91 | - wx.navigateTo({ | |
92 | - url: '../taxperson/home', | |
93 | - }) | |
134 | + this.checkUserInfo("1") | |
94 | 135 | }, |
95 | 136 | |
96 | 137 | /** |
97 | 138 | * 专项附加扣除 |
98 | 139 | */ |
99 | 140 | goAdditionalDiduction: function() { |
100 | - wx.navigateTo({ | |
101 | - url: '../addtionalreduce/home', | |
102 | - }) | |
141 | + this.checkUserInfo("2") | |
103 | 142 | }, |
104 | 143 | |
105 | 144 | /** |
106 | 145 | * 预扣预缴 |
107 | 146 | */ |
108 | 147 | goAdvancePayment: function() { |
109 | - wx.navigateTo({ | |
110 | - url: '../advancepayment/adPayHome', | |
111 | - }) | |
148 | + this.checkUserInfo("3") | |
112 | 149 | }, |
113 | 150 | |
114 | 151 | /** |
115 | 152 | * 汇算清缴 |
116 | 153 | */ |
117 | 154 | goFinalPayment: function() { |
118 | - wx.navigateTo({ | |
119 | - url: '../finalpayment/home', | |
120 | - }) | |
155 | + this.checkUserInfo("4") | |
121 | 156 | }, |
122 | 157 | |
123 | 158 | gochat: function() { |
... | ... | @@ -126,13 +161,13 @@ Page({ |
126 | 161 | }) |
127 | 162 | }, |
128 | 163 | |
129 | - loginout:function(){ | |
164 | + loginout: function() { | |
130 | 165 | wx.showModal({ |
131 | 166 | title: '退出登录', |
132 | 167 | content: '确认要退出登录吗?', |
133 | 168 | confirmText: '确定', |
134 | 169 | showCancel: true, |
135 | - cancelText:"取消", | |
170 | + cancelText: "取消", | |
136 | 171 | confirmColor: '#357aeb', |
137 | 172 | success(res) { |
138 | 173 | console.log("loginout", res) |
... | ... | @@ -146,18 +181,40 @@ Page({ |
146 | 181 | }) |
147 | 182 | }, |
148 | 183 | |
184 | + | |
185 | + go_verify_idcard: function() { //身份证认证 | |
186 | + wx.navigateTo({ | |
187 | + url: '../verify/verify_info?foreigner=false', | |
188 | + }) | |
189 | + }, | |
190 | + | |
191 | + go_verify: function() { //外籍人员信息认证 | |
192 | + wx.navigateTo({ | |
193 | + url: '../verify/verify_info?foreigner=true', | |
194 | + }) | |
195 | + }, | |
196 | + | |
149 | 197 | /** |
150 | 198 | * 生命周期函数--监听页面隐藏 |
151 | 199 | */ |
152 | 200 | onHide: function() { |
201 | + console.log("onhide") | |
202 | + this.setData({ | |
203 | + onresume: false | |
204 | + }) | |
205 | + }, | |
153 | 206 | |
207 | + close02:function(){ | |
208 | + this.setData({ | |
209 | + has_verify: true | |
210 | + }) | |
154 | 211 | }, |
155 | 212 | |
156 | 213 | /** |
157 | 214 | * 生命周期函数--监听页面卸载 |
158 | 215 | */ |
159 | 216 | onUnload: function() { |
160 | - | |
217 | + | |
161 | 218 | }, |
162 | 219 | |
163 | 220 | /** | ... | ... |
1 | 1 | <!--pages/main/guide/guide.wxml--> |
2 | 2 | |
3 | -<view class='' wx:if="{{mobile.length==11}}"> | |
3 | +<view class=''> | |
4 | 4 | <scroll-view> |
5 | 5 | <view class="bg_wrap"> |
6 | 6 | |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image> |
57 | 57 | </view> --> |
58 | 58 | |
59 | - <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> --> | |
59 | + <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> --> | |
60 | 60 | </view> |
61 | 61 | </scroll-view> |
62 | 62 | |
... | ... | @@ -66,4 +66,17 @@ |
66 | 66 | |
67 | 67 | <image class='logout-img' bindtap='gochat' src='/images/icon_chat.png'></image> |
68 | 68 | |
69 | -</view> | |
69 | + <view class="mask" wx:if="{{!has_verify&&onresume}}"></view> | |
70 | + | |
71 | + <view style='top:180rpx;position:absolute;z-index:10;right:0;left:0;margin:auto;text-align:center;' wx:if="{{!has_verify&&onresume}}"> | |
72 | + <image style='height:860rpx' src='/images/verify_dialog.png'> | |
73 | + </image> | |
74 | + <view style='position:absolute;top:660rpx;right:0;left:0;display:flex;flex-direction:column'> | |
75 | + <view class='btn_blue_radius' bindtap="go_verify_idcard"> | |
76 | + <text style='font-size: 32rpx;color:#fff;text-align: center;line-height: 42px;' >立即认证</text> | |
77 | + </view> | |
78 | + <text style='font-size:26rpx;color: #357aeb;margin-top:22rpx' bindtap='go_verify'>外籍人员信息认证</text> | |
79 | + </view> | |
80 | + </view> | |
81 | +<image wx:if="{{!has_verify&&onresume}}" style='width:44rpx;height:44rpx;right:0;left:0;margin:auto;margin-top:60rpx;position:absolute;z-index:10;' src="/images/close02.png" bindtap='close02'></image> | |
82 | +</view> | |
\ No newline at end of file | ... | ... |
... | ... | @@ -74,3 +74,24 @@ text_wrap_sub_999 { |
74 | 74 | right: 40rpx; |
75 | 75 | bottom: 40rpx; |
76 | 76 | } |
77 | + | |
78 | +/* 遮罩层 */ | |
79 | + | |
80 | +.mask { | |
81 | + width: 100%; | |
82 | + height: 100%; | |
83 | + position: fixed; | |
84 | + top: 0; | |
85 | + left: 0; | |
86 | + background: #000; | |
87 | + opacity: 0.7; | |
88 | + z-index: 10; | |
89 | +} | |
90 | + | |
91 | +.btn_blue_radius { | |
92 | + margin-left: 120rpx ; | |
93 | + margin-right: 120rpx; | |
94 | + background: #357aeb; | |
95 | + border-radius: 5px; | |
96 | + height: 84rpx; | |
97 | +} | ... | ... |
... | ... | @@ -104,6 +104,7 @@ Page({ |
104 | 104 | label: '纳税人类型', |
105 | 105 | bindtype: 'taxpayerType', |
106 | 106 | placeholder: '请选择纳税人类型', |
107 | + selected:"居民", | |
107 | 108 | values: ["居民", "非居民"], |
108 | 109 | onChange: 'onPickerSelect' |
109 | 110 | }, |
... | ... | @@ -113,6 +114,7 @@ Page({ |
113 | 114 | bindtype: 'forigner', |
114 | 115 | placeholder: '请选择', |
115 | 116 | disabled: true, |
117 | + selected:"否", | |
116 | 118 | values: ["否", "是"], |
117 | 119 | onChange: 'onPickerSelect' |
118 | 120 | }, |
... | ... | @@ -405,8 +407,10 @@ Page({ |
405 | 407 | this.data.name = tax_info.name |
406 | 408 | this.data.other_name = tax_info.other_name |
407 | 409 | if (tax_info.certification_status == 'active' && tax_info.id_card_no.length) {//已通过拍摄身份证认证过,不能修改 |
408 | - this.data.genderData.disabled = true | |
409 | - this.data.birthDate.disabled = true | |
410 | + if (tax_info.id_card_type=='居民身份证'){ | |
411 | + this.data.genderData.disabled = true | |
412 | + this.data.birthDate.disabled = true | |
413 | + } | |
410 | 414 | this.data.cardtypeData.disabled = true |
411 | 415 | } |
412 | 416 | |
... | ... | @@ -420,7 +424,9 @@ Page({ |
420 | 424 | |
421 | 425 | this.data.other_card_number = tax_info.other_id_card_no |
422 | 426 | this.data.overseas = tax_info.is_overseas_personnel |
423 | - this.data.countryData.selected = tax_info.native | |
427 | + if (tax_info.native){ | |
428 | + this.data.countryData.selected = tax_info.native | |
429 | + } | |
424 | 430 | this.data.birthCountryData.selected = tax_info.birth_native |
425 | 431 | if (tax_info.taxpayer_type == 'non-resident') { |
426 | 432 | this.data.taxpayerTypeData.selected = '非居民' |
... | ... | @@ -748,7 +754,7 @@ Page({ |
748 | 754 | this.data.hasOtherCard = true |
749 | 755 | this.data.overseas = '是' |
750 | 756 | this.data.taxpayerTypeData.disabled = false |
751 | - this.data.taxpayerTypeData.selected = '' | |
757 | + this.data.taxpayerTypeData.selected = '非居民' | |
752 | 758 | if ('居民身份证' == new_type || '中国护照' == new_type) { |
753 | 759 | this.data.overseas = '否' |
754 | 760 | this.data.countryData.selected = '中国' |
... | ... | @@ -1416,7 +1422,7 @@ Page({ |
1416 | 1422 | "other_name": that.data.hasOtherCard ? that.data.other_name : '', |
1417 | 1423 | "family_ties": '本人',//that.data.relativeData.selected, |
1418 | 1424 | "native": that.data.countryData.selected, |
1419 | - "taxpayer_type": that.data.taxpayerTypeData.selected == '居民' ? 'resident' :'non-resident', | |
1425 | + "taxpayer_type": that.data.taxpayerTypeData.selected == '非居民' ? 'non-resident' :'resident', | |
1420 | 1426 | "is_overseas_personnel": that.data.overseas, |
1421 | 1427 | 'birth_native': that.data.hasOtherCard ? that.data.birthCountryData.selected : '', |
1422 | 1428 | "id_card_type": that.data.cardtypeData.selected, //selected_code, | ... | ... |
1 | +// pages/main/verify/verify_idcard/verify_idcard.js | |
2 | +var OSSInit; | |
3 | +var baseUrl = getApp().globalData.baseUrl; | |
4 | +Page({ | |
5 | + | |
6 | + /** | |
7 | + * Page initial data | |
8 | + */ | |
9 | + data: { | |
10 | + input_name: "", | |
11 | + input_card_number: "", | |
12 | + | |
13 | + facepath: '', | |
14 | + already_getdata: false, | |
15 | + front_card_info: {}, | |
16 | + backpath: '', | |
17 | + back_card_info: {}, | |
18 | + idInfo: {}, | |
19 | + }, | |
20 | + | |
21 | + onLoad: function (options) { | |
22 | + console.log("options",options) | |
23 | + this.setData({ | |
24 | + input_name:options.input_name, | |
25 | + input_card_number: options.input_card_number, | |
26 | + }) | |
27 | + this.initOSS() | |
28 | + }, | |
29 | + | |
30 | + initOSS: function () { | |
31 | + var that = this | |
32 | + var Authorization = getApp().globalData.Authorization; | |
33 | + //OSS 上传前init | |
34 | + wx.showLoading() | |
35 | + wx.request({ | |
36 | + url: baseUrl + "filemeta/v1/inits", | |
37 | + header: { | |
38 | + 'Authorization': Authorization | |
39 | + }, | |
40 | + method: 'POST', | |
41 | + data: { | |
42 | + "access_type": "web_upload", | |
43 | + "action ": "put_object", | |
44 | + "instance_id": "", | |
45 | + "object_type": "wx_image" | |
46 | + }, | |
47 | + success: function (result) { | |
48 | + | |
49 | + OSSInit = result.data | |
50 | + console.log(' OSS init 成功', OSSInit) | |
51 | + }, | |
52 | + fail: function (res) { | |
53 | + console.log('OSS init 失败', res) | |
54 | + }, | |
55 | + complete: function () { | |
56 | + wx.hideLoading() | |
57 | + } | |
58 | + }) | |
59 | + }, | |
60 | + | |
61 | + /** | |
62 | + * 生命周期函数--监听页面初次渲染完成 | |
63 | + */ | |
64 | + onReady: function () { | |
65 | + | |
66 | + }, | |
67 | + | |
68 | + /** | |
69 | + * 生命周期函数--监听页面显示 | |
70 | + */ | |
71 | + onShow: function () { | |
72 | + console.log('onShow') | |
73 | + }, | |
74 | + | |
75 | + chooseImage: function (e) { | |
76 | + console.log(e) | |
77 | + var that = this | |
78 | + wx.chooseImage({ | |
79 | + sourceType: ['camera', 'album'], | |
80 | + // sizeType: ['original'], | |
81 | + count: 1, | |
82 | + success: function (res) { | |
83 | + console.log('success', res) | |
84 | + if ("id_face" == e.currentTarget.id) { | |
85 | + that.setData({ | |
86 | + facepath: res.tempFilePaths[0] | |
87 | + }) | |
88 | + that.uploadImage(that.data.facepath, 'id_face') | |
89 | + } else if ("id_back" == e.currentTarget.id) { | |
90 | + that.setData({ | |
91 | + backpath: res.tempFilePaths[0] | |
92 | + }) | |
93 | + that.uploadImage(that.data.backpath, 'id_back') | |
94 | + } | |
95 | + } | |
96 | + }) | |
97 | + }, | |
98 | + | |
99 | + uploadImage: function (path, str) { | |
100 | + var that = this | |
101 | + wx.showLoading({ | |
102 | + title: '上传图片中...', | |
103 | + }) | |
104 | + console.log('key', 'imagepath_' + path.substring(path.length - 10, path.length)) | |
105 | + wx.uploadFile({ | |
106 | + url: getApp().globalData.OSSUrl, | |
107 | + filePath: path, | |
108 | + name: 'file', | |
109 | + formData: { | |
110 | + 'key': 'imagepath_' + path.substring(path.length - 15, path.length), | |
111 | + 'OSSAccessKeyId': OSSInit.access_key_id, | |
112 | + 'policy': OSSInit.policy, | |
113 | + 'signature': OSSInit.signature, | |
114 | + 'callback': OSSInit.callback_body, | |
115 | + 'x:access_token': OSSInit.callback_token, | |
116 | + // 'x-oss-security-token': OSSInit.security_token, | |
117 | + 'success_action_status': '200', | |
118 | + }, | |
119 | + success: function (res) { | |
120 | + console.log('uploadFile', res.data) | |
121 | + if (res.statusCode == 200) { | |
122 | + var data = JSON.parse(res.data) | |
123 | + console.log('上传成功', res) | |
124 | + that.oss_bucket = data.bucket | |
125 | + if ("id_face" == str) { | |
126 | + that.setData({ | |
127 | + front_card_info: data | |
128 | + }) | |
129 | + } else if ("id_back" == str) { | |
130 | + that.setData({ | |
131 | + back_card_info: data | |
132 | + }) | |
133 | + } | |
134 | + that.checkAndupload() | |
135 | + } else { | |
136 | + var title = '图片上传失败,请重新上传' | |
137 | + if (res.statusCode == 413) { | |
138 | + title = '图片体积过大,请选择较小图片上传' | |
139 | + } | |
140 | + wx.showModal({ | |
141 | + title: '上传失败', | |
142 | + content: title, | |
143 | + showCancel: false, | |
144 | + confirmColor: '#4E8FE7' | |
145 | + }) | |
146 | + } | |
147 | + wx.hideLoading() | |
148 | + }, | |
149 | + fail: function (err) { | |
150 | + console.log('fail', err) | |
151 | + wx.showModal({ | |
152 | + title: '上传失败', | |
153 | + content: '图片上传失败,请重新上传', | |
154 | + showCancel: false, | |
155 | + confirmColor: '#4E8FE7' | |
156 | + }) | |
157 | + wx.hideLoading() | |
158 | + }, | |
159 | + complete(res) { | |
160 | + console.log('complete', res) | |
161 | + wx.hideLoading() | |
162 | + } | |
163 | + }) | |
164 | + }, | |
165 | + | |
166 | + checkAndupload: function () { | |
167 | + var that = this | |
168 | + var frontdata = that.data.front_card_info | |
169 | + var backdata = that.data.back_card_info | |
170 | + console.log('frontdata', frontdata) | |
171 | + console.log('backdata', backdata) | |
172 | + if (!frontdata || !frontdata.object_id) { | |
173 | + return; | |
174 | + } | |
175 | + if (!backdata || !backdata.object_id) { | |
176 | + return; | |
177 | + } | |
178 | + wx.showLoading({ | |
179 | + title: '解析图片中...', | |
180 | + }) | |
181 | + var Authorization = getApp().globalData.Authorization; | |
182 | + wx.request({ | |
183 | + url: baseUrl + 'common/v1/ocr/id-card-verify', | |
184 | + method: "POST", | |
185 | + header: { | |
186 | + 'content-type': 'application/json', // 默认值 | |
187 | + "Authorization": Authorization | |
188 | + }, | |
189 | + data: { | |
190 | + front_card_copy: that.data.front_card_info, | |
191 | + back_card_copy: backdata | |
192 | + }, | |
193 | + success: function (res) { | |
194 | + console.log('suc', res) | |
195 | + if (res.statusCode == 200) { | |
196 | + that.setData({ | |
197 | + already_getdata: true, | |
198 | + idInfo: res.data.item | |
199 | + }) | |
200 | + console.log('suc', that.data.idInfo) | |
201 | + } else { | |
202 | + wx.showModal({ | |
203 | + showCancel: false, | |
204 | + title: '', | |
205 | + content: res.data.message ? res.data.message : "数据错误", | |
206 | + }) | |
207 | + } | |
208 | + }, | |
209 | + fail(res) { | |
210 | + console.log('fail', res.data) | |
211 | + }, | |
212 | + complete(res) { | |
213 | + console.log('complete', res.data) | |
214 | + wx.hideLoading() | |
215 | + } | |
216 | + }) | |
217 | + }, | |
218 | + | |
219 | + gonext: function () { | |
220 | + var frontdata = this.data.front_card_info | |
221 | + var backdata = this.data.back_card_info | |
222 | + var that = this | |
223 | + if (this.data.already_getdata) { | |
224 | + var id_Info = this.data.idInfo; | |
225 | + if(this.data.input_name!=id_Info.name){ | |
226 | + this.showtoast("您输入的姓名与身份证照片不一致,请重试"); | |
227 | + return; | |
228 | + } | |
229 | + if (this.data.input_card_number != id_Info.id_card_number) { | |
230 | + this.showtoast("您输入的证照号码与身份证照片不一致,请重试"); | |
231 | + return; | |
232 | + } | |
233 | + //提交数据 | |
234 | + var Authorization = getApp().globalData.Authorization; | |
235 | + wx.request({ | |
236 | + url: baseUrl + 'uaa/v1/users/auth', | |
237 | + method: 'POST', | |
238 | + data: { | |
239 | + id_card_front: frontdata, | |
240 | + id_card_back: backdata | |
241 | + }, | |
242 | + header: { | |
243 | + 'content-type': 'application/json', | |
244 | + "Authorization": Authorization | |
245 | + }, | |
246 | + success: function (res) { | |
247 | + console.log("verify_idcard",res); | |
248 | + if (res.statusCode && res.statusCode >= 300) { | |
249 | + that.showtoast(res.data.message); | |
250 | + wx.redirectTo({ | |
251 | + url: '../verify_result/verify_result?result=fail', | |
252 | + }) | |
253 | + } else { | |
254 | + that.showtoast('提交成功'); | |
255 | + wx.redirectTo({ | |
256 | + url: '../verify_result/verify_result?result=succ', | |
257 | + }) | |
258 | + } | |
259 | + }, | |
260 | + fail(res){ | |
261 | + that.showtoast(res.data.message); | |
262 | + } | |
263 | + }) | |
264 | + } else { | |
265 | + // wx.redirectTo({ | |
266 | + // url: '../verify_result/verify_result?result=fail', | |
267 | + // }) | |
268 | + if (!frontdata || !frontdata.object_id) { | |
269 | + this.showtoast('请上传证件照'); | |
270 | + return; | |
271 | + } | |
272 | + if (!backdata || !backdata.object_id) { | |
273 | + this.showtoast('请上传证件照'); | |
274 | + return; | |
275 | + } | |
276 | + } | |
277 | + }, | |
278 | + | |
279 | + showtoast: function (title) { | |
280 | + wx.showToast({ | |
281 | + title: title, | |
282 | + duration: 2000, | |
283 | + icon: 'none' | |
284 | + // image: '/images/error.png' | |
285 | + }) | |
286 | + }, | |
287 | + | |
288 | + | |
289 | + /** | |
290 | + * Lifecycle function--Called when page hide | |
291 | + */ | |
292 | + onHide: function () { | |
293 | + | |
294 | + }, | |
295 | + | |
296 | + /** | |
297 | + * Lifecycle function--Called when page unload | |
298 | + */ | |
299 | + onUnload: function () { | |
300 | + | |
301 | + }, | |
302 | + | |
303 | + /** | |
304 | + * Page event handler function--Called when user drop down | |
305 | + */ | |
306 | + onPullDownRefresh: function () { | |
307 | + | |
308 | + }, | |
309 | + | |
310 | + /** | |
311 | + * Called when page reach bottom | |
312 | + */ | |
313 | + onReachBottom: function () { | |
314 | + | |
315 | + }, | |
316 | + | |
317 | + /** | |
318 | + * Called when user click on the top right corner to share | |
319 | + */ | |
320 | + onShareAppMessage: function () { | |
321 | + | |
322 | + } | |
323 | +}) | |
\ No newline at end of file | ... | ... |
1 | +<view class='page'> | |
2 | + <scroll-view scroll-y style="padding-bottom:180rpx;"> | |
3 | + <view style='display:flex;flex-direction:row;background:#fff'> | |
4 | + <!--左边 身份信息 --> | |
5 | + <view style='margin:40rpx 0 30rpx 130rpx'> | |
6 | + <view style='display:flex;flex-direction:row;height:48rpx;width:100%;'> | |
7 | + <image style='margin-left:30rpx; width: 24px;height: 24px' src='/images/step_first_blue.png'></image> | |
8 | + <view style='background:#357aeb;width:90px;height:4rpx;align-self:center;'></view> | |
9 | + </view> | |
10 | + <view style='font-size: 17px;color: #000;margin-top:16rpx'>身份信息</view> | |
11 | + </view> | |
12 | + <!--右边 上传证件照 --> | |
13 | + <view style='margin:40rpx 100rpx 30rpx 0'> | |
14 | + <view style='display:flex;flex-direction:row;height:48rpx;width:100%;'> | |
15 | + <view style='background:#357aeb;width:90px;height:4rpx;align-self:center;'></view> | |
16 | + <image style='margin-right:30rpx; width: 24px;height: 24px' src='/images/step_second_blue.png'></image> | |
17 | + </view> | |
18 | + <view style='font-size: 17px;color: #000;margin-top:16rpx;text-align:right'>上传证件照</view> | |
19 | + </view> | |
20 | + </view> | |
21 | + | |
22 | + <view class='id_background' bindtap="chooseImage" id='id_face'> | |
23 | + <image class='id_image_wrap' src="{{facepath?facepath:'/images/id_face.png'}}"></image> | |
24 | + </view> | |
25 | + <view class='id_background' bindtap="chooseImage" id='id_back'> | |
26 | + <image class='id_image_wrap' src="{{backpath?backpath:'/images/id_back.png'}}"></image> | |
27 | + </view> | |
28 | + | |
29 | + <view style='background-color:#fff;padding:0 32rpx ;'> | |
30 | + <view class='item_body'> | |
31 | + <text class='text_666_28 float_left'>签发机关</text> | |
32 | + <text class='text_333_28 float_right'>{{idInfo.issued_by}}</text> | |
33 | + </view> | |
34 | + <view class="divide_line"></view> | |
35 | + <view class='item_body'> | |
36 | + <text class='text_666_28 float_left'>有效期</text> | |
37 | + <text class='text_333_28 float_right'>{{idInfo.valid_date}}</text> | |
38 | + </view> | |
39 | + </view> | |
40 | + </scroll-view> | |
41 | + | |
42 | + <view class='bottom_btn_wrap'> | |
43 | + <view class='btn_blue_radius' bindtap="gonext"> | |
44 | + <view class='text_white_34'>提交</view> | |
45 | + </view> | |
46 | + </view> | |
47 | +</view> | |
\ No newline at end of file | ... | ... |
1 | +.page { | |
2 | + background: #f8f8f8; | |
3 | +} | |
4 | + | |
5 | +.id_background{ | |
6 | + width: 100%; | |
7 | + height: 380rpx; | |
8 | + display: flex; | |
9 | + align-items: center; | |
10 | + background-color: #fff; | |
11 | +} | |
12 | + | |
13 | +.id_image_wrap{ | |
14 | + width: 540rpx; | |
15 | + height: 312rpx; | |
16 | + margin-left: 110rpx; | |
17 | + margin-right: 110rpx; | |
18 | +} | |
19 | + | |
20 | + | |
21 | +.item_body { | |
22 | + width: 100%; | |
23 | + height: 80rpx; | |
24 | +} | |
25 | + | |
26 | +.text_666_28 { | |
27 | + font-family: PingFangSC-Regular; | |
28 | + font-size: 28rpx; | |
29 | + color: #666; | |
30 | + line-height: 80rpx; | |
31 | +} | |
32 | + | |
33 | +.text_333_28 { | |
34 | + font-family: PingFangSC-Regular; | |
35 | + font-size: 28rpx; | |
36 | + color: #333; | |
37 | + text-align: right; | |
38 | + line-height: 80rpx; | |
39 | +} | |
40 | + | |
41 | +.bottom_btn_wrap{ | |
42 | + background: #FFFFFF; | |
43 | + box-shadow: 0 -2px 8px 0 rgba(208,208,208,0.30); | |
44 | + height: 136rpx; | |
45 | + width: 100%; | |
46 | + position: fixed; | |
47 | + bottom: 0; | |
48 | +} | |
49 | +.btn_blue_radius{ | |
50 | + margin: 26rpx 30rpx; | |
51 | + background: #357AEB; | |
52 | + border-radius: 5px; | |
53 | + height: 84rpx; | |
54 | +} | |
55 | + | |
56 | +.text_white_34 { | |
57 | + font-family: PingFangSC-Regular; | |
58 | + font-size: 17px; | |
59 | + color: #FFFFFF; | |
60 | + text-align: center; | |
61 | + line-height: 42px; | |
62 | +} | |
\ No newline at end of file | ... | ... |
pages/main/verify/verify_info.js
0 → 100644
1 | +// pages/main/verify/verify_info.js | |
2 | +var format = require('../../../utils/util.js'); | |
3 | +const reg_18_Number = /^[0-9]{18}$/; | |
4 | +const reg_9_n_a = /^([a-zA-z]|[0-9]){9}$/; | |
5 | +const reg_15_n_a = /^([a-zA-z]|[0-9]){15}$/; | |
6 | +const reg_20_n_a = /^([a-zA-z]|[0-9]){1,20}$/; | |
7 | +var baseUrl = getApp().globalData.baseUrl; | |
8 | +let Authorization = ''; | |
9 | +Page({ | |
10 | + /** | |
11 | + * Page initial data | |
12 | + */ | |
13 | + data: { | |
14 | + is_foreigner: false, | |
15 | + btn_text: "下一步", | |
16 | + info_steps: [{ | |
17 | + label: '身份信息', | |
18 | + status: 'success' | |
19 | + }, { | |
20 | + label: '上传证件照', | |
21 | + status: 'circle' | |
22 | + }], | |
23 | + cardTypeArray: ['中国护照', '港澳居民来往内地通行证', '港澳居民居住证', '台湾居民来往大陆通行证', '台湾居民居住证', '外国护照', '外国人永久居留身份证', '外国人工作许可证(A类)', '外国人工作许可证(B类)', '外国人工作许可证(C类)'], | |
24 | + cardtype: "", | |
25 | + card_number: "", | |
26 | + name: "", | |
27 | + }, | |
28 | + | |
29 | + /** | |
30 | + * Lifecycle function--Called when page load | |
31 | + */ | |
32 | + onLoad: function(options) { | |
33 | + console.log("options", options); | |
34 | + this.setData({ | |
35 | + is_foreigner: options.foreigner, | |
36 | + btn_text: "true" == options.foreigner ? "提交" : "下一步" | |
37 | + }) | |
38 | + }, | |
39 | + | |
40 | + /** | |
41 | + * Lifecycle function--Called when page is initially rendered | |
42 | + */ | |
43 | + onReady: function() { | |
44 | + | |
45 | + }, | |
46 | + | |
47 | + /** | |
48 | + * Lifecycle function--Called when page show | |
49 | + */ | |
50 | + onShow: function() { | |
51 | + | |
52 | + }, | |
53 | + | |
54 | + bindCardtypeChange: function(e) { | |
55 | + console.log("bindCardtypeChange", e) | |
56 | + var cardTypeArray = this.data.cardTypeArray | |
57 | + var new_type = cardTypeArray[e.detail.value] //['name'] | |
58 | + this.setData({ | |
59 | + cardtype: new_type | |
60 | + }) | |
61 | + }, | |
62 | + | |
63 | + bindinputcardnum: function(e) { | |
64 | + var idCardNo = e.detail.value | |
65 | + this.setData({ | |
66 | + card_number: idCardNo | |
67 | + }) | |
68 | + }, | |
69 | + | |
70 | + nameInput: function(e) { | |
71 | + this.setData({ | |
72 | + name: e.detail.value | |
73 | + }) | |
74 | + }, | |
75 | + | |
76 | + dealCardType: function() { //提交前验证输入的内容规则 | |
77 | + | |
78 | + }, | |
79 | + | |
80 | + gonext: function() { | |
81 | + var that = this | |
82 | + //校验证照类型,证照号码,姓名 | |
83 | + var type = this.data.cardtype; | |
84 | + var idCardNo = this.data.card_number; | |
85 | + var name = this.data.name.replace(/(^\s*)|(\s*$)/g, ""); | |
86 | + var regname_c = /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,30}$/; //中文 | |
87 | + var regname_e = /^[A-Za-z][A-Za-z\s]*[A-Za-z]$/; //英文 | |
88 | + console.log('cardtype', type) | |
89 | + // this.showtoast(this.data.cardTypeArray.indexOf(type) + ""); | |
90 | + | |
91 | + if (this.data.is_foreigner == 'true') { //非身份证 | |
92 | + if (type.length < 1) { | |
93 | + this.showtoast('请选择证照类型'); | |
94 | + return | |
95 | + } | |
96 | + if (name.length < 1) { | |
97 | + this.showtoast('请输入姓名'); | |
98 | + return | |
99 | + } | |
100 | + name = name.replace(/(^\s*)|(\s*$)/g, ""); | |
101 | + if (!regname_c.test(name) && !regname_e.test(name)) { | |
102 | + this.showtoast('请输入正确的姓名'); | |
103 | + return | |
104 | + } | |
105 | + if (idCardNo.length < 1) { | |
106 | + this.showtoast('请填写证照号码'); | |
107 | + return | |
108 | + } | |
109 | + if (type.indexOf('居住证') > -1 && !reg_18_Number.test(idCardNo)) { | |
110 | + this.showtoast('证照号码有误'); | |
111 | + return | |
112 | + }else if (type.indexOf('中国护照') > -1 && !reg_9_n_a.test(idCardNo)) { | |
113 | + this.showtoast('证照号码有误'); | |
114 | + return | |
115 | + }else if (type.indexOf('永久居留') > -1 && !reg_15_n_a.test(idCardNo)) { | |
116 | + this.showtoast('证照号码有误'); | |
117 | + return | |
118 | + } | |
119 | + if (type.indexOf('居住证') < 0 && type.indexOf('中国护照') < 0 && type.indexOf('永久居留') < 0 &&!reg_20_n_a.test(idCardNo)) { | |
120 | + this.showtoast('证照号码有误'); | |
121 | + return | |
122 | + } | |
123 | + //TODO 请求数据,上传用户身份信息 | |
124 | + Authorization = getApp().globalData.Authorization; | |
125 | + wx.request({ | |
126 | + url: baseUrl + 'uaa/v1/users/auth-extend', | |
127 | + method: 'POST', | |
128 | + data: { | |
129 | + name: name, | |
130 | + id_card_type: that.data.cardTypeArray.indexOf(type)+2+"", | |
131 | + id_card_no: idCardNo | |
132 | + }, | |
133 | + header: { | |
134 | + 'content-type': 'application/json', | |
135 | + "Authorization": Authorization | |
136 | + }, | |
137 | + success: function(res) { | |
138 | + console.log("SUCC", res) | |
139 | + if (res.statusCode && res.statusCode >= 300) { | |
140 | + wx.navigateTo({ | |
141 | + url: 'verify_result/verify_result?result=fail', | |
142 | + }) | |
143 | + that.showtoast(res.data.message); | |
144 | + } else { | |
145 | + wx.navigateTo({ | |
146 | + url: 'verify_result/verify_result?result=succ', | |
147 | + }) | |
148 | + } | |
149 | + } | |
150 | + }) | |
151 | + } else { //身份证 | |
152 | + if (name.length < 1) { | |
153 | + this.showtoast('请输入姓名'); | |
154 | + return | |
155 | + } | |
156 | + if (!regname_c.test(name)) { | |
157 | + this.showtoast('请输入正确的姓名'); | |
158 | + return | |
159 | + } | |
160 | + if (idCardNo.length < 1) { | |
161 | + this.showtoast('请填写证照号码'); | |
162 | + return | |
163 | + } | |
164 | + if (!format.isIDCardNum(idCardNo)) { | |
165 | + this.showtoast('证照号码有误'); | |
166 | + return; | |
167 | + } | |
168 | + wx.navigateTo({ | |
169 | + url: 'verify_idcard/verify_idcard?input_name=' + name + '&input_card_number=' + idCardNo, | |
170 | + }) | |
171 | + } | |
172 | + }, | |
173 | + | |
174 | + showtoast: function(title) { | |
175 | + wx.showToast({ | |
176 | + title: title, | |
177 | + duration: 2000, | |
178 | + icon: 'none' | |
179 | + // image: '/images/error.png' | |
180 | + }) | |
181 | + }, | |
182 | + | |
183 | + /** | |
184 | + * Lifecycle function--Called when page hide | |
185 | + */ | |
186 | + onHide: function() { | |
187 | + | |
188 | + }, | |
189 | + | |
190 | + /** | |
191 | + * Lifecycle function--Called when page unload | |
192 | + */ | |
193 | + onUnload: function() { | |
194 | + | |
195 | + }, | |
196 | + | |
197 | + /** | |
198 | + * Page event handler function--Called when user drop down | |
199 | + */ | |
200 | + onPullDownRefresh: function() { | |
201 | + | |
202 | + }, | |
203 | + | |
204 | + /** | |
205 | + * Called when page reach bottom | |
206 | + */ | |
207 | + onReachBottom: function() { | |
208 | + | |
209 | + }, | |
210 | + | |
211 | + /** | |
212 | + * Called when user click on the top right corner to share | |
213 | + */ | |
214 | + onShareAppMessage: function() { | |
215 | + | |
216 | + } | |
217 | +}) | |
\ No newline at end of file | ... | ... |
pages/main/verify/verify_info.json
0 → 100644
pages/main/verify/verify_info.wxml
0 → 100644
1 | +<view class='page'> | |
2 | + <view style='background:#FDFBEA;height:96rpx;width:100%;text-align:center'> | |
3 | + <text style='font-size:30rpx;color:#E47C4A;font-family:PingFang-SC-Medium;line-height:96rpx'>为了您的账户安全,请先完成实名认证</text> | |
4 | + </view> | |
5 | + | |
6 | + <view hidden="{{is_foreigner=='true'}}"> | |
7 | + <view style='display:flex;flex-direction:row;background:#fff'> | |
8 | + <!--左边 身份信息 --> | |
9 | + <view style='margin:40rpx 0 30rpx 130rpx'> | |
10 | + <view style='display:flex;flex-direction:row;height:48rpx;width:100%;'> | |
11 | + <image style='margin-left:30rpx; width: 24px;height: 24px' src='/images/step_first_blue.png'></image> | |
12 | + <view style='background:#357aeb;width:90px;height:4rpx;align-self:center;'></view> | |
13 | + </view> | |
14 | + <view style='font-size: 17px;color: #000;margin-top:16rpx'>身份信息</view> | |
15 | + </view> | |
16 | + <!--右边 上传证件照 --> | |
17 | + <view style='margin:40rpx 100rpx 30rpx 0'> | |
18 | + <view style='display:flex;flex-direction:row;height:48rpx;width:100%;'> | |
19 | + <view style='background:#bcc3c7;width:90px;height:4rpx;align-self:center;'></view> | |
20 | + <image style='margin-right:30rpx; width: 24px;height: 24px' src='/images/step_second_gray.png'></image> | |
21 | + </view> | |
22 | + <view style='font-size: 17px;color: #999;margin-top:16rpx;text-align:right'>上传证件照</view> | |
23 | + </view> | |
24 | + </view> | |
25 | + </view> | |
26 | + | |
27 | + <view style='flex-direction: column;display: flex;background:#fff'> | |
28 | + <view hidden="{{is_foreigner=='false'}}"> | |
29 | + <picker bindchange="bindCardtypeChange" value="{{index}}" range="{{cardTypeArray}}"> | |
30 | + <view style='height:90rpx;padding:0 30rpx '> | |
31 | + <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>证照类型</text> | |
32 | + <image class='arrow_wrap' src='/images/arrow_right.png' style='margin-top:26rpx'></image> | |
33 | + <text wx:if="{{cardtype.length<1}}" class='text_999_30 float_right' style="line-height: 90rpx;">请选择</text> | |
34 | + <text wx:else style='color:#333;font-size: 30rpx;line-height: 90rpx; float:right'>{{cardtype}}</text> | |
35 | + </view> | |
36 | + </picker> | |
37 | + <view class="divide_line_30"></view> | |
38 | + </view> | |
39 | + | |
40 | + <view style='padding-left: 30rpx;padding-right: 30rpx;'> | |
41 | + <text class='text_777_30 float_left' style='line-height: 90rpx'>姓名</text> | |
42 | + <input class='input_wrap' placeholder='请输入您的真实姓名' value='{{name}}' placeholder-class='text_999_30' maxlength='15' bindinput='nameInput'></input> | |
43 | + </view> | |
44 | + <view class="divide_line_30"></view> | |
45 | + | |
46 | + <view style='padding-left: 30rpx;padding-right: 30rpx;'> | |
47 | + <view wx:if="{{is_foreigner=='false'}}"> | |
48 | + <text class='text_777_30 float_left' style='line-height: 90rpx'>身份证号码</text> | |
49 | + <input class='input_wrap' placeholder='请输入您的身份证号码' placeholder-class='text_999_30' name='id_card_no' maxlength='18' value='{{card_number}}' bindinput="bindinputcardnum" type='idcard'></input> | |
50 | + </view> | |
51 | + <view wx:else> | |
52 | + <text class='text_777_30 float_left' style='line-height: 90rpx'>证照号码</text> | |
53 | + <input class='input_wrap' placeholder='请输入您的证件号码' placeholder-class='text_999_30' name='id_card_no' maxlength='20' value='{{card_number}}' bindinput="bindinputcardnum"></input> | |
54 | + </view> | |
55 | + </view> | |
56 | + </view> | |
57 | + | |
58 | + <view class='bottom_btn_wrap'> | |
59 | + <view class='btn_blue_radius' bindtap="gonext"> | |
60 | + <view class='text_white_34'>{{btn_text}}</view> | |
61 | + </view> | |
62 | + </view> | |
63 | +</view> | |
\ No newline at end of file | ... | ... |
pages/main/verify/verify_info.wxss
0 → 100644
1 | +.page{ | |
2 | + background: #f8f8f8; | |
3 | + width: 100%; | |
4 | + height: 3000rpx; | |
5 | +} | |
6 | + | |
7 | +.input_wrap { | |
8 | + /* max-width: 460rpx; */ | |
9 | + -webkit-box-flex: 1; | |
10 | + -webkit-flex: 1; | |
11 | + flex: 1; | |
12 | + height: 90rpx; | |
13 | + font-size: 28rpx; | |
14 | + color: #000; | |
15 | + text-align: right; | |
16 | + overflow: hidden; | |
17 | + text-overflow: ellipsis; | |
18 | + white-space: nowrap; | |
19 | +} | |
20 | + | |
21 | +.bottom_btn_wrap{ | |
22 | + background: #FFFFFF; | |
23 | + box-shadow: 0 -2px 8px 0 rgba(208,208,208,0.30); | |
24 | + height: 136rpx; | |
25 | + width: 100%; | |
26 | + position: fixed; | |
27 | + bottom: 0; | |
28 | +} | |
29 | +.btn_blue_radius{ | |
30 | + margin: 26rpx 30rpx; | |
31 | + background: #357AEB; | |
32 | + border-radius: 5px; | |
33 | + height: 84rpx; | |
34 | +} | |
35 | + | |
36 | +.text_white_34 { | |
37 | + font-family: PingFangSC-Regular; | |
38 | + font-size: 17px; | |
39 | + color: #FFFFFF; | |
40 | + text-align: center; | |
41 | + line-height: 42px; | |
42 | +} | |
43 | + | |
44 | +.text_black_34 { | |
45 | + font-family: PingFangSC-Regular; | |
46 | + font-size: 34rpx; | |
47 | + color: #000; | |
48 | +} | |
\ No newline at end of file | ... | ... |
1 | +// pages/main/verify/verify_result/verify_result.js | |
2 | +var app = getApp(); | |
3 | +Page({ | |
4 | + | |
5 | + /** | |
6 | + * Page initial data | |
7 | + */ | |
8 | + data: { | |
9 | + verify_img: "/images/verify_succ.png", | |
10 | + verify_status: "succ", | |
11 | + verify_tip: "恭喜您!认证成功", | |
12 | + btn_text: "完成" | |
13 | + }, | |
14 | + | |
15 | + /** | |
16 | + * Lifecycle function--Called when page load | |
17 | + */ | |
18 | + onLoad: function(options) { | |
19 | + console.log("options", options) | |
20 | + if ('succ' == options.result) { | |
21 | + this.setData({ | |
22 | + verify_img: "/images/verify_succ.png", | |
23 | + verify_status: "succ", | |
24 | + verify_tip: "恭喜您!认证成功", | |
25 | + btn_text: "完成" | |
26 | + }) | |
27 | + } else if ('fail' == options.result) { | |
28 | + this.setData({ | |
29 | + verify_img: "/images/verify_fail.png", | |
30 | + verify_status: "fail", | |
31 | + verify_tip: "对不起!认证失败", | |
32 | + btn_text: "重新认证" | |
33 | + }) | |
34 | + } | |
35 | + }, | |
36 | + | |
37 | + /** | |
38 | + * Lifecycle function--Called when page is initially rendered | |
39 | + */ | |
40 | + onReady: function() { | |
41 | + | |
42 | + }, | |
43 | + | |
44 | + /** | |
45 | + * Lifecycle function--Called when page show | |
46 | + */ | |
47 | + onShow: function() { | |
48 | + | |
49 | + }, | |
50 | + | |
51 | + done: function() { | |
52 | + if ('succ' == this.data.verify_status) { | |
53 | + // var requestdata = { | |
54 | + // "grant_type": "refresh_token", | |
55 | + // "refresh_token": app.globalData.refresh_token, | |
56 | + // "scope": "global_access:end_user" | |
57 | + // }; | |
58 | + // app.getTokenByCode(requestdata, false, "") | |
59 | + app.globalData.real_auth_status = "active"; | |
60 | + wx.reLaunch({ | |
61 | + url: '../../guide/guide', | |
62 | + }) | |
63 | + } else { | |
64 | + wx.navigateBack({ | |
65 | + delta: 1 | |
66 | + }) | |
67 | + } | |
68 | + }, | |
69 | + | |
70 | + /** | |
71 | + * Lifecycle function--Called when page hide | |
72 | + */ | |
73 | + onHide: function() { | |
74 | + | |
75 | + }, | |
76 | + | |
77 | + /** | |
78 | + * Lifecycle function--Called when page unload | |
79 | + */ | |
80 | + onUnload: function() { | |
81 | + | |
82 | + }, | |
83 | + | |
84 | + /** | |
85 | + * Page event handler function--Called when user drop down | |
86 | + */ | |
87 | + onPullDownRefresh: function() { | |
88 | + | |
89 | + }, | |
90 | + | |
91 | + /** | |
92 | + * Called when page reach bottom | |
93 | + */ | |
94 | + onReachBottom: function() { | |
95 | + | |
96 | + }, | |
97 | + | |
98 | + /** | |
99 | + * Called when user click on the top right corner to share | |
100 | + */ | |
101 | + onShareAppMessage: function() { | |
102 | + | |
103 | + } | |
104 | +}) | |
\ No newline at end of file | ... | ... |
1 | +<view class='page'> | |
2 | +<image style='width:60%;height:330rpx;margin:250rpx 160rpx 0 160rpx;' src='{{verify_img}}'></image> | |
3 | +<view style='text-align:center'> | |
4 | +<text style='font-size:14px;color:#999;margin-top:20rpx'>{{verify_tip}}</text> | |
5 | +</view> | |
6 | +<view class='bottom_btn_wrap' > | |
7 | + <view class='btn_blue_radius' bindtap="done"> | |
8 | + <view class='text_white_34'>{{btn_text}}</view> | |
9 | + </view> | |
10 | + </view> | |
11 | +</view> | ... | ... |
1 | +/* pages/main/verify/verify_result/verify_result.wxss */ | |
2 | + | |
3 | + | |
4 | +.bottom_btn_wrap{ | |
5 | + background: #FFFFFF; | |
6 | + box-shadow: 0 -2px 8px 0 rgba(208,208,208,0.30); | |
7 | + height: 136rpx; | |
8 | + width: 100%; | |
9 | + position: fixed; | |
10 | + bottom: 0; | |
11 | +} | |
12 | +.btn_blue_radius{ | |
13 | + margin: 26rpx 30rpx; | |
14 | + background: #357AEB; | |
15 | + border-radius: 5px; | |
16 | + height: 84rpx; | |
17 | +} | |
18 | + | |
19 | +.text_white_34 { | |
20 | + font-family: PingFangSC-Regular; | |
21 | + font-size: 17px; | |
22 | + color: #FFFFFF; | |
23 | + text-align: center; | |
24 | + line-height: 42px; | |
25 | +} | |
\ No newline at end of file | ... | ... |
... | ... | @@ -8,7 +8,8 @@ |
8 | 8 | "es6": true, |
9 | 9 | "postcss": true, |
10 | 10 | "minified": true, |
11 | - "newFeature": true | |
11 | + "newFeature": true, | |
12 | + "checkInvalidKey": true | |
12 | 13 | }, |
13 | 14 | "compileType": "miniprogram", |
14 | 15 | "libVersion": "2.4.2", |
... | ... | @@ -18,6 +19,8 @@ |
18 | 19 | "hidedInDevtools": [] |
19 | 20 | }, |
20 | 21 | "isGameTourist": false, |
22 | + "simulatorType": "wechat", | |
23 | + "simulatorPluginLibVersion": {}, | |
21 | 24 | "condition": { |
22 | 25 | "search": { |
23 | 26 | "current": -1, | ... | ... |
请
注册
或
登录
后发表评论