提交 c62c37ecbc88c573d4272924a95e5676f332ce02
Merge branch '机器人dev_实名认证' into 海峡new
# Conflicts: # pages/main/advancepayment/adPayHome.js # pages/main/guide/guide.js # pages/main/guide/guide.wxml
正在显示
32 个修改的文件
包含
1105 行增加
和
76 行删除
@@ -71,6 +71,7 @@ App({ | @@ -71,6 +71,7 @@ App({ | ||
71 | that.globalData.wx_open_id = user.wx_open_id; | 71 | that.globalData.wx_open_id = user.wx_open_id; |
72 | that.globalData.Authorization = "Bearer " + res.data.access_token; | 72 | that.globalData.Authorization = "Bearer " + res.data.access_token; |
73 | that.globalData.refresh_token = res.data.refresh_token; | 73 | that.globalData.refresh_token = res.data.refresh_token; |
74 | + that.globalData.real_auth_status = res.data.user.real_auth_status; | ||
74 | if (user && user.type == "0") { //匿名用户 | 75 | if (user && user.type == "0") { //匿名用户 |
75 | wx.redirectTo({ | 76 | wx.redirectTo({ |
76 | // url: '../../getPhone/getPhone' | 77 | // url: '../../getPhone/getPhone' |
@@ -156,6 +157,7 @@ App({ | @@ -156,6 +157,7 @@ App({ | ||
156 | refresh_token: "", | 157 | refresh_token: "", |
157 | tenant_id: "", | 158 | tenant_id: "", |
158 | wx_open_id: "", | 159 | wx_open_id: "", |
160 | + real_auth_status:'', | ||
159 | newComerOrder: null | 161 | newComerOrder: null |
160 | } | 162 | } |
161 | }) | 163 | }) |
@@ -20,7 +20,10 @@ | @@ -20,7 +20,10 @@ | ||
20 | "pages/main/finalpayment/historylist/historylist", | 20 | "pages/main/finalpayment/historylist/historylist", |
21 | "pages/main/finalpayment/historydetail/historydetail", | 21 | "pages/main/finalpayment/historydetail/historydetail", |
22 | "pages/login/login", | 22 | "pages/login/login", |
23 | - "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" | ||
24 | ], | 27 | ], |
25 | "window": { | 28 | "window": { |
26 | "backgroundTextStyle": "light", | 29 | "backgroundTextStyle": "light", |
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
@@ -399,9 +399,10 @@ | @@ -399,9 +399,10 @@ | ||
399 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_rent'}}" class='modal_img02' src="/images/house_declare_rent.png"></image> | 399 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_rent'}}" class='modal_img02' src="/images/house_declare_rent.png"></image> |
400 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_loan'}}" class='modal_img' src="/images/house_declare_loan.png"></image> | 400 | <image wx:if="{{cur_status=='house_fund'&&house_type=='house_fund_loan'}}" class='modal_img' src="/images/house_declare_loan.png"></image> |
401 | <!-- <text style='position:absolute;font-size:20px;color:#fff;float:right;top:0;right:100rpx' bindtap='closeModalImg'>x</text> --> | 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 | <image style='width:30rpx;height:30rpx;' src='/images/close.png'></image> | 403 | <image style='width:30rpx;height:30rpx;' src='/images/close.png'></image> |
404 | </view> | 404 | </view> |
405 | + | ||
405 | </view> | 406 | </view> |
406 | 407 | ||
407 | <!-- 扣除类型 --> | 408 | <!-- 扣除类型 --> |
1 | + | ||
2 | + | ||
1 | // pages/main/advancepayment/home.js | 3 | // pages/main/advancepayment/home.js |
2 | var format = require('../../../utils/util.js'); | 4 | var format = require('../../../utils/util.js'); |
3 | var app = getApp(); | 5 | var app = getApp(); |
4 | var baseUrl = app.globalData.baseUrl; | 6 | var baseUrl = app.globalData.baseUrl; |
5 | -const Sub_taxation_method = {"0101":'正常工资薪金', "0107": "内退一次性补偿" ,"0108": "解除劳动合同一次性补偿", "0109": "个人股票期权行权收入", "0110": "企业年金", "0111": "提前退休一次性补贴", "0103": "全年一次性奖金收入"} | 7 | +const Sub_taxation_method = { "0101": '正常工资薪金', "0107": "内退一次性补偿", "0108": "解除劳动合同一次性补偿", "0109": "个人股票期权行权收入", "0110": "企业年金", "0111": "提前退休一次性补贴", "0103": "全年一次性奖金收入" } |
6 | Page({ | 8 | Page({ |
7 | - loadCount:0, | 9 | + loadCount: 0, |
8 | timestamp: 0, | 10 | timestamp: 0, |
9 | Authorization: null, | 11 | Authorization: null, |
10 | data: { | 12 | data: { |
@@ -14,13 +16,13 @@ Page({ | @@ -14,13 +16,13 @@ Page({ | ||
14 | taxDatas: [], | 16 | taxDatas: [], |
15 | salaryDatas: {}, | 17 | salaryDatas: {}, |
16 | choosed_date: '', | 18 | choosed_date: '', |
17 | - hascompleted_tax:false, | 19 | + hascompleted_tax: false, |
18 | hascompleted_sal: false | 20 | hascompleted_sal: false |
19 | }, | 21 | }, |
20 | - onLoad: function(options) { | 22 | + onLoad: function (options) { |
21 | var mydate = new Date(); | 23 | var mydate = new Date(); |
22 | this.setData({ | 24 | this.setData({ |
23 | - choosed_date: mydate.getFullYear() + "年" + (mydate.getMonth()+1)+"月", | 25 | + choosed_date: mydate.getFullYear() + "年" + (mydate.getMonth() + 1) + "月", |
24 | }) | 26 | }) |
25 | this.timestamp = (mydate.getTime() / 1000).toFixed(0) | 27 | this.timestamp = (mydate.getTime() / 1000).toFixed(0) |
26 | this.loadData(this.timestamp); | 28 | this.loadData(this.timestamp); |
@@ -43,7 +45,7 @@ Page({ | @@ -43,7 +45,7 @@ Page({ | ||
43 | taxDatas: taxDatas | 45 | taxDatas: taxDatas |
44 | }) | 46 | }) |
45 | } | 47 | } |
46 | - | 48 | + |
47 | 49 | ||
48 | }, | 50 | }, |
49 | fail: function (res) { | 51 | fail: function (res) { |
@@ -91,7 +93,7 @@ Page({ | @@ -91,7 +93,7 @@ Page({ | ||
91 | for (var i = 0; i < items.length; ++i) { | 93 | for (var i = 0; i < items.length; ++i) { |
92 | var item = items[i] | 94 | var item = items[i] |
93 | var method | 95 | var method |
94 | - if (item.taxation_method == '0101'){ | 96 | + if (item.taxation_method == '0101') { |
95 | method = '工资薪金' | 97 | method = '工资薪金' |
96 | // if (item.sub_taxation_method && Sub_taxation_method[item.sub_taxation_method]){ | 98 | // if (item.sub_taxation_method && Sub_taxation_method[item.sub_taxation_method]){ |
97 | // method = '工资薪金-' + Sub_taxation_method[item.sub_taxation_method] | 99 | // method = '工资薪金-' + Sub_taxation_method[item.sub_taxation_method] |
@@ -100,10 +102,10 @@ Page({ | @@ -100,10 +102,10 @@ Page({ | ||
100 | method = '劳务报酬' | 102 | method = '劳务报酬' |
101 | } else if (item.taxation_method == '0103') { | 103 | } else if (item.taxation_method == '0103') { |
102 | method = '全年一次性奖金' | 104 | method = '全年一次性奖金' |
103 | - } | ||
104 | - if (item.taxpayer_type == 'non-resident'){//非居民 | 105 | + } |
106 | + if (item.taxpayer_type == 'non-resident') {//非居民 | ||
105 | item.method = '外籍人' + method | 107 | item.method = '外籍人' + method |
106 | - }else{ | 108 | + } else { |
107 | item.method = method | 109 | item.method = method |
108 | } | 110 | } |
109 | } | 111 | } |
@@ -125,15 +127,15 @@ Page({ | @@ -125,15 +127,15 @@ Page({ | ||
125 | // } | 127 | // } |
126 | // }, | 128 | // }, |
127 | 129 | ||
128 | - datePickerChange: function(e) { | ||
129 | - console.log("e",e) | ||
130 | - var timestamp = Date.parse(new Date(e.detail.value))/1000 | 130 | + datePickerChange: function (e) { |
131 | + console.log("e", e) | ||
132 | + var timestamp = Date.parse(new Date(e.detail.value)) / 1000 | ||
131 | this.setData({ | 133 | this.setData({ |
132 | - choosed_date: format.yearFormString(timestamp) + "年" + format.monthFormString(timestamp)+"月" | 134 | + choosed_date: format.yearFormString(timestamp) + "年" + format.monthFormString(timestamp) + "月" |
133 | }) | 135 | }) |
134 | this.dateStamp = timestamp | 136 | this.dateStamp = timestamp |
135 | this.loadData(timestamp); | 137 | this.loadData(timestamp); |
136 | - }, | 138 | + }, |
137 | 139 | ||
138 | /** | 140 | /** |
139 | * 点击tab切换 | 141 | * 点击tab切换 |
@@ -150,16 +152,16 @@ Page({ | @@ -150,16 +152,16 @@ Page({ | ||
150 | } | 152 | } |
151 | }, | 153 | }, |
152 | 154 | ||
153 | - /** | ||
154 | - * 滑动切换tab | ||
155 | - */ | 155 | + /** |
156 | + * 滑动切换tab | ||
157 | + */ | ||
156 | bindChange: function (e) { | 158 | bindChange: function (e) { |
157 | 159 | ||
158 | var that = this; | 160 | var that = this; |
159 | that.setData({ currentTab: e.detail.current }); | 161 | that.setData({ currentTab: e.detail.current }); |
160 | }, | 162 | }, |
161 | 163 | ||
162 | - gospan:function(e){ | 164 | + gospan: function (e) { |
163 | console.log(e) | 165 | console.log(e) |
164 | var item = this.data.salaryDatas[e.currentTarget.id] | 166 | var item = this.data.salaryDatas[e.currentTarget.id] |
165 | item.isshow = !item.isshow | 167 | item.isshow = !item.isshow |
@@ -187,22 +189,22 @@ Page({ | @@ -187,22 +189,22 @@ Page({ | ||
187 | // }, | 189 | // }, |
188 | // complete: function () { | 190 | // complete: function () { |
189 | // wx.hideLoading() | 191 | // wx.hideLoading() |
190 | - | 192 | + |
191 | // } | 193 | // } |
192 | // }) | 194 | // }) |
193 | }, | 195 | }, |
194 | 196 | ||
195 | - handleDetailsData: function (data) { | 197 | + handleDetailsData: function (data) { |
196 | 198 | ||
197 | - let titles = JSON.parse(data['slip_titles']) | 199 | + let titles = JSON.parse(data['slip_titles']) |
198 | let detail = JSON.parse(data['detail']) | 200 | let detail = JSON.parse(data['detail']) |
199 | - let mapping_keys = data["mapping_keys"] ? data["mapping_keys"]:[] | 201 | + let mapping_keys = data["mapping_keys"] ? data["mapping_keys"] : [] |
200 | var details = [] | 202 | var details = [] |
201 | for (var i = 0; i < titles.length; ++i) { | 203 | for (var i = 0; i < titles.length; ++i) { |
202 | var titleData = titles[i] | 204 | var titleData = titles[i] |
203 | var value = detail[titleData['key']] | 205 | var value = detail[titleData['key']] |
204 | var title = titleData['title'] | 206 | var title = titleData['title'] |
205 | - if (!title){ | 207 | + if (!title) { |
206 | title = titleData['original_column'] | 208 | title = titleData['original_column'] |
207 | } | 209 | } |
208 | if (!value) { | 210 | if (!value) { |
@@ -210,22 +212,23 @@ Page({ | @@ -210,22 +212,23 @@ Page({ | ||
210 | if (value != undefined) { | 212 | if (value != undefined) { |
211 | value += 'tax_rate' == titleData['key'] ? '%' : '' | 213 | value += 'tax_rate' == titleData['key'] ? '%' : '' |
212 | } | 214 | } |
213 | - } | 215 | + } |
214 | if (!title || !value) continue; | 216 | if (!title || !value) continue; |
215 | - if (mapping_keys.indexOf(titleData['key']) == -1 && value == '0') continue; | 217 | + if (mapping_keys.indexOf(titleData['key']) == -1 && (value == '0' || value == 0)) continue; |
216 | details.push({ | 218 | details.push({ |
217 | title: title, | 219 | title: title, |
218 | value: value | 220 | value: value |
219 | }) | 221 | }) |
220 | } | 222 | } |
221 | - console.log('details', details) | ||
222 | - return details | 223 | + console.log('details', details) |
224 | + return details | ||
223 | }, | 225 | }, |
224 | 226 | ||
225 | goItemDetails: function (e) { | 227 | goItemDetails: function (e) { |
226 | - var item = this.data.taxDatas[e.currentTarget.id] | 228 | + var item = this.data.taxDatas[e.currentTarget.id] |
227 | wx.navigateTo({ | 229 | wx.navigateTo({ |
228 | url: "adPayDetails/adPayDetails?id=" + item.id + "&date=" + this.data.choosed_date + "&taxpayer_type=" + item.taxpayer_type | 230 | url: "adPayDetails/adPayDetails?id=" + item.id + "&date=" + this.data.choosed_date + "&taxpayer_type=" + item.taxpayer_type |
229 | }) | 231 | }) |
230 | }, | 232 | }, |
231 | -}) | ||
233 | +}) | ||
234 | + |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | <view class="swiper-box page" style="height:100%;margin-top:20rpx" bindchange="bindChange"> | 16 | <view class="swiper-box page" style="height:100%;margin-top:20rpx" bindchange="bindChange"> |
17 | <view wx:if="{{currentTab==0}}"> | 17 | <view wx:if="{{currentTab==0}}"> |
18 | <view wx:if="{{hascompleted_tax&&taxDatas.length<1}}" style='background:#fff;width:100%; align-items: center;'> | 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 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>还没有企业为您申报个税哦~</view> | 20 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>还没有企业为您申报个税哦~</view> |
21 | </view> | 21 | </view> |
22 | <view wx:for="{{taxDatas}}" style='margin-bottom:20rpx'> | 22 | <view wx:for="{{taxDatas}}" style='margin-bottom:20rpx'> |
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | </view> | 35 | </view> |
36 | <view wx:else> <!-- 工资明细 --> | 36 | <view wx:else> <!-- 工资明细 --> |
37 | <view wx:if="{{hascompleted_sal&&salaryDatas.length<1}}" style='background:#fff;'> | 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 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>您还没有工资条哦~</view> | 39 | <view style='width:100%; font-family: PingFang-SC-Medium;font-size: 14px;color: #999999;letter-spacing: 0;text-align: center;'>您还没有工资条哦~</view> |
40 | </view> | 40 | </view> |
41 | <view wx:for="{{salaryDatas}}" style='margin-bottom:20rpx'> | 41 | <view wx:for="{{salaryDatas}}" style='margin-bottom:20rpx'> |
1 | // pages/main/guide/guide.js | 1 | // pages/main/guide/guide.js |
2 | var baseUrl = getApp().globalData.baseUrl; | 2 | var baseUrl = getApp().globalData.baseUrl; |
3 | +let Authorization = ''; | ||
3 | Page({ | 4 | Page({ |
4 | 5 | ||
5 | /** | 6 | /** |
@@ -7,14 +8,15 @@ Page({ | @@ -7,14 +8,15 @@ Page({ | ||
7 | */ | 8 | */ |
8 | data: { | 9 | data: { |
9 | isshow: false, | 10 | isshow: false, |
10 | - mobile:"" | 11 | + onresume: false, |
12 | + has_verify: true | ||
11 | }, | 13 | }, |
12 | 14 | ||
13 | /** | 15 | /** |
14 | * 生命周期函数--监听页面加载 | 16 | * 生命周期函数--监听页面加载 |
15 | */ | 17 | */ |
16 | onLoad: function(options) { | 18 | onLoad: function(options) { |
17 | - | 19 | + |
18 | }, | 20 | }, |
19 | 21 | ||
20 | /** | 22 | /** |
@@ -28,40 +30,93 @@ Page({ | @@ -28,40 +30,93 @@ Page({ | ||
28 | * 生命周期函数--监听页面显示 | 30 | * 生命周期函数--监听页面显示 |
29 | */ | 31 | */ |
30 | onShow: function() { | 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() { | ||
41 | var that = this; | 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 | console.log("Authorization", Authorization) | 46 | console.log("Authorization", Authorization) |
44 | if (Authorization && Authorization.length > 10) { | 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 | ||
58 | - }) | ||
59 | - } | ||
60 | - } | ||
61 | - }) | 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(); | ||
57 | + } else { | ||
58 | + that.setData({ | ||
59 | + has_verify: false | ||
60 | + }) | ||
61 | + } | ||
62 | + // wx.request({ | ||
63 | + // url: baseUrl + 'socialwork/v1/employees/verify', | ||
64 | + // data: {}, | ||
65 | + // header: { | ||
66 | + // 'content-type': 'application/json', | ||
67 | + // "Authorization": Authorization | ||
68 | + // }, | ||
69 | + // success: function(res) { | ||
70 | + // if (res.statusCode && res.statusCode >= 300) { | ||
71 | + // wx.showToast({ | ||
72 | + // title: res.data.message, | ||
73 | + // icon: 'none', | ||
74 | + // duration: 1000 | ||
75 | + // }) | ||
76 | + // } else { | ||
77 | + // // that.setData({ | ||
78 | + // // has_verify: false | ||
79 | + // // }) | ||
80 | + // if (!res.data.need_verify) { //不需要再实名认证 | ||
81 | + // that.setData({ | ||
82 | + // has_verify: true | ||
83 | + // }) | ||
84 | + // that.taxconfirm(); | ||
85 | + // } else { | ||
86 | + // that.setData({ | ||
87 | + // has_verify: false | ||
88 | + // }) | ||
89 | + // } | ||
90 | + // } | ||
91 | + // } | ||
92 | + // }) | ||
62 | } | 93 | } |
63 | }, | 94 | }, |
64 | 95 | ||
96 | + taxconfirm: function() { | ||
97 | + var that = this; | ||
98 | + Authorization = getApp().globalData.Authorization; | ||
99 | + | ||
100 | + wx.request({ | ||
101 | + url: baseUrl + 'persontax/v1/personal-taxes-confirm', | ||
102 | + header: { | ||
103 | + 'content-type': 'application/json', | ||
104 | + "Authorization": Authorization | ||
105 | + }, | ||
106 | + success: function(res) { | ||
107 | + console.log("taxconfirm", res) | ||
108 | + if (res.statusCode == 200 && !that.data.isshow && res.data.status != '0') { //未完善 | ||
109 | + that.showModal(res.data) | ||
110 | + } else { | ||
111 | + that.setData({ | ||
112 | + isshow: false | ||
113 | + }) | ||
114 | + } | ||
115 | + } | ||
116 | + }) | ||
117 | + | ||
118 | + }, | ||
119 | + | ||
65 | showModal: function(data) { | 120 | showModal: function(data) { |
66 | var that = this | 121 | var that = this |
67 | that.setData({ | 122 | that.setData({ |
@@ -126,13 +181,13 @@ Page({ | @@ -126,13 +181,13 @@ Page({ | ||
126 | }) | 181 | }) |
127 | }, | 182 | }, |
128 | 183 | ||
129 | - loginout:function(){ | 184 | + loginout: function() { |
130 | wx.showModal({ | 185 | wx.showModal({ |
131 | title: '退出登录', | 186 | title: '退出登录', |
132 | content: '确认要退出登录吗?', | 187 | content: '确认要退出登录吗?', |
133 | confirmText: '确定', | 188 | confirmText: '确定', |
134 | showCancel: true, | 189 | showCancel: true, |
135 | - cancelText:"取消", | 190 | + cancelText: "取消", |
136 | confirmColor: '#357aeb', | 191 | confirmColor: '#357aeb', |
137 | success(res) { | 192 | success(res) { |
138 | console.log("loginout", res) | 193 | console.log("loginout", res) |
@@ -146,18 +201,34 @@ Page({ | @@ -146,18 +201,34 @@ Page({ | ||
146 | }) | 201 | }) |
147 | }, | 202 | }, |
148 | 203 | ||
204 | + | ||
205 | + go_verify_idcard: function() { //身份证认证 | ||
206 | + wx.navigateTo({ | ||
207 | + url: '../verify/verify_info?foreigner=false', | ||
208 | + }) | ||
209 | + }, | ||
210 | + | ||
211 | + go_verify: function() { //外籍人员信息认证 | ||
212 | + wx.navigateTo({ | ||
213 | + url: '../verify/verify_info?foreigner=true', | ||
214 | + }) | ||
215 | + }, | ||
216 | + | ||
149 | /** | 217 | /** |
150 | * 生命周期函数--监听页面隐藏 | 218 | * 生命周期函数--监听页面隐藏 |
151 | */ | 219 | */ |
152 | onHide: function() { | 220 | onHide: function() { |
153 | - | 221 | + console.log("onhide") |
222 | + this.setData({ | ||
223 | + onresume: false | ||
224 | + }) | ||
154 | }, | 225 | }, |
155 | 226 | ||
156 | /** | 227 | /** |
157 | * 生命周期函数--监听页面卸载 | 228 | * 生命周期函数--监听页面卸载 |
158 | */ | 229 | */ |
159 | onUnload: function() { | 230 | onUnload: function() { |
160 | - | 231 | + |
161 | }, | 232 | }, |
162 | 233 | ||
163 | /** | 234 | /** |
1 | + | ||
2 | + | ||
1 | <!--pages/main/guide/guide.wxml--> | 3 | <!--pages/main/guide/guide.wxml--> |
2 | 4 | ||
3 | -<view class='' wx:if="{{mobile.length==11}}"> | 5 | +<view class=''> |
4 | <scroll-view> | 6 | <scroll-view> |
5 | <view class="bg_wrap"> | 7 | <view class="bg_wrap"> |
6 | 8 | ||
@@ -56,14 +58,26 @@ | @@ -56,14 +58,26 @@ | ||
56 | <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image> | 58 | <image class='arrow_wrap float_right' src='/images/arrow_right.png'></image> |
57 | </view> --> | 59 | </view> --> |
58 | 60 | ||
59 | - <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> --> | 61 | + <!-- <text style="font-size:34rpx;color:#999;text-align:center;padding:20rpx;margin:80rpx 0" bindtap='loginout'>退出登录</text> --> |
60 | </view> | 62 | </view> |
61 | </scroll-view> | 63 | </scroll-view> |
62 | 64 | ||
63 | - <!-- <image class='chat-img' bindtap='gochat' src='/images/icon_chat.png'></image> --> | 65 | + <image class='logout-img' bindtap='gochat' src='/images/icon_chat.png'></image> |
66 | + | ||
67 | + <!-- <image class='logout-img' bindtap='loginout' src='/images/icon_logout.png'></image> --> | ||
64 | 68 | ||
65 | - <!-- <image class='logout-img' bindtap='loginout' src='/images/icon_logout.png'></image> --> | 69 | + <view class="mask" wx:if="{{!has_verify&&onresume}}"></view> |
66 | 70 | ||
67 | - <image class='logout-img' bindtap='gochat' src='/images/icon_chat.png'></image> | 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> | ||
68 | 81 | ||
69 | </view> | 82 | </view> |
83 | + |
@@ -74,3 +74,24 @@ text_wrap_sub_999 { | @@ -74,3 +74,24 @@ text_wrap_sub_999 { | ||
74 | right: 40rpx; | 74 | right: 40rpx; |
75 | bottom: 40rpx; | 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 | +} |
@@ -405,8 +405,10 @@ Page({ | @@ -405,8 +405,10 @@ Page({ | ||
405 | this.data.name = tax_info.name | 405 | this.data.name = tax_info.name |
406 | this.data.other_name = tax_info.other_name | 406 | this.data.other_name = tax_info.other_name |
407 | if (tax_info.certification_status == 'active' && tax_info.id_card_no.length) {//已通过拍摄身份证认证过,不能修改 | 407 | if (tax_info.certification_status == 'active' && tax_info.id_card_no.length) {//已通过拍摄身份证认证过,不能修改 |
408 | - this.data.genderData.disabled = true | ||
409 | - this.data.birthDate.disabled = true | 408 | + if (tax_info.id_card_type=='居民身份证'){ |
409 | + this.data.genderData.disabled = true | ||
410 | + this.data.birthDate.disabled = true | ||
411 | + } | ||
410 | this.data.cardtypeData.disabled = true | 412 | this.data.cardtypeData.disabled = true |
411 | } | 413 | } |
412 | 414 | ||
@@ -420,7 +422,9 @@ Page({ | @@ -420,7 +422,9 @@ Page({ | ||
420 | 422 | ||
421 | this.data.other_card_number = tax_info.other_id_card_no | 423 | this.data.other_card_number = tax_info.other_id_card_no |
422 | this.data.overseas = tax_info.is_overseas_personnel | 424 | this.data.overseas = tax_info.is_overseas_personnel |
423 | - this.data.countryData.selected = tax_info.native | 425 | + if (tax_info.native){ |
426 | + this.data.countryData.selected = tax_info.native | ||
427 | + } | ||
424 | this.data.birthCountryData.selected = tax_info.birth_native | 428 | this.data.birthCountryData.selected = tax_info.birth_native |
425 | if (tax_info.taxpayer_type == 'non-resident') { | 429 | if (tax_info.taxpayer_type == 'non-resident') { |
426 | this.data.taxpayerTypeData.selected = '非居民' | 430 | this.data.taxpayerTypeData.selected = '非居民' |
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 | +}) |
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> |
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 | +} |
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 | +}) |
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> |
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 | +} |
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 | +}) |
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 | +} |
@@ -4,11 +4,12 @@ | @@ -4,11 +4,12 @@ | ||
4 | "ignore": [] | 4 | "ignore": [] |
5 | }, | 5 | }, |
6 | "setting": { | 6 | "setting": { |
7 | - "urlCheck": true, | 7 | + "urlCheck": false, |
8 | "es6": true, | 8 | "es6": true, |
9 | "postcss": true, | 9 | "postcss": true, |
10 | "minified": true, | 10 | "minified": true, |
11 | - "newFeature": true | 11 | + "newFeature": true, |
12 | + "checkInvalidKey": true | ||
12 | }, | 13 | }, |
13 | "compileType": "miniprogram", | 14 | "compileType": "miniprogram", |
14 | "libVersion": "2.4.2", | 15 | "libVersion": "2.4.2", |
请
注册
或
登录
后发表评论