提交 82203898150ea24af503e106c9a5ef9f3d77feb2
Merge branch '机器人dev_实名认证' into 天津中天
# Conflicts: # pages/main/advancepayment/adPayHome.js # pages/main/guide/guide.js # pages/main/guide/guide.wxml
正在显示
33 个修改的文件
包含
1102 行增加
和
69 行删除
@@ -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 | <!-- 扣除类型 --> |
@@ -35,7 +35,7 @@ Page({ | @@ -35,7 +35,7 @@ Page({ | ||
35 | success: function (result) { | 35 | success: function (result) { |
36 | console.log('成功', result) | 36 | console.log('成功', result) |
37 | self.setData({ | 37 | self.setData({ |
38 | - taxDatas: that.handleTaxData(result.data) | 38 | + taxDatas: self.handleTaxData(result.data) |
39 | }) | 39 | }) |
40 | }, | 40 | }, |
41 | fail: function (res) { | 41 | fail: function (res) { |
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,7 +189,7 @@ Page({ | @@ -187,7 +189,7 @@ Page({ | ||
187 | // }, | 189 | // }, |
188 | // complete: function () { | 190 | // complete: function () { |
189 | // wx.hideLoading() | 191 | // wx.hideLoading() |
190 | - | 192 | + |
191 | // } | 193 | // } |
192 | // }) | 194 | // }) |
193 | }, | 195 | }, |
@@ -212,7 +214,7 @@ Page({ | @@ -212,7 +214,7 @@ Page({ | ||
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 |
@@ -223,9 +225,10 @@ Page({ | @@ -223,9 +225,10 @@ Page({ | ||
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,16 @@ Page({ | @@ -7,14 +8,16 @@ Page({ | ||
7 | */ | 8 | */ |
8 | data: { | 9 | data: { |
9 | isshow: false, | 10 | isshow: false, |
10 | - mobile:"" | 11 | + mobile:"", |
12 | + onresume: false, | ||
13 | + has_verify: true | ||
11 | }, | 14 | }, |
12 | 15 | ||
13 | /** | 16 | /** |
14 | * 生命周期函数--监听页面加载 | 17 | * 生命周期函数--监听页面加载 |
15 | */ | 18 | */ |
16 | onLoad: function(options) { | 19 | onLoad: function(options) { |
17 | - | 20 | + |
18 | }, | 21 | }, |
19 | 22 | ||
20 | /** | 23 | /** |
@@ -28,40 +31,94 @@ Page({ | @@ -28,40 +31,94 @@ Page({ | ||
28 | * 生命周期函数--监听页面显示 | 31 | * 生命周期函数--监听页面显示 |
29 | */ | 32 | */ |
30 | onShow: function() { | 33 | 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 | - } | 34 | + console.log("onshow") |
35 | + this.setData({ | ||
36 | + onresume:true | ||
37 | + }) | ||
38 | + this.checkUserInfo() | ||
39 | + | ||
38 | }, | 40 | }, |
39 | 41 | ||
40 | - taxconfirm: function() { | 42 | + //判断该雇员是否有姓名和身份证号 |
43 | + checkUserInfo: function() { | ||
41 | var that = this; | 44 | var that = this; |
42 | - var Authorization = getApp().globalData.Authorization; | 45 | + Authorization = getApp().globalData.Authorization; |
46 | + var real_auth_status = getApp().globalData.real_auth_status | ||
47 | + console.log("real_auth_status", real_auth_status) | ||
43 | console.log("Authorization", Authorization) | 48 | console.log("Authorization", Authorization) |
44 | if (Authorization && Authorization.length > 10) { | 49 | 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 | - }) | 50 | + // that.setData({ |
51 | + // has_verify: false | ||
52 | + // }) | ||
53 | + if (real_auth_status == 'active') { //不需要再实名认证 | ||
54 | + that.setData({ | ||
55 | + has_verify: true, | ||
56 | + onresume: false, | ||
57 | + }) | ||
58 | + that.taxconfirm(); | ||
59 | + } else { | ||
60 | + that.setData({ | ||
61 | + has_verify: false | ||
62 | + }) | ||
63 | + } | ||
64 | + // wx.request({ | ||
65 | + // url: baseUrl + 'socialwork/v1/employees/verify', | ||
66 | + // data: {}, | ||
67 | + // header: { | ||
68 | + // 'content-type': 'application/json', | ||
69 | + // "Authorization": Authorization | ||
70 | + // }, | ||
71 | + // success: function(res) { | ||
72 | + // if (res.statusCode && res.statusCode >= 300) { | ||
73 | + // wx.showToast({ | ||
74 | + // title: res.data.message, | ||
75 | + // icon: 'none', | ||
76 | + // duration: 1000 | ||
77 | + // }) | ||
78 | + // } else { | ||
79 | + // // that.setData({ | ||
80 | + // // has_verify: false | ||
81 | + // // }) | ||
82 | + // if (!res.data.need_verify) { //不需要再实名认证 | ||
83 | + // that.setData({ | ||
84 | + // has_verify: true | ||
85 | + // }) | ||
86 | + // that.taxconfirm(); | ||
87 | + // } else { | ||
88 | + // that.setData({ | ||
89 | + // has_verify: false | ||
90 | + // }) | ||
91 | + // } | ||
92 | + // } | ||
93 | + // } | ||
94 | + // }) | ||
62 | } | 95 | } |
63 | }, | 96 | }, |
64 | 97 | ||
98 | + taxconfirm: function() { | ||
99 | + var that = this; | ||
100 | + Authorization = getApp().globalData.Authorization; | ||
101 | + | ||
102 | + wx.request({ | ||
103 | + url: baseUrl + 'persontax/v1/personal-taxes-confirm', | ||
104 | + header: { | ||
105 | + 'content-type': 'application/json', | ||
106 | + "Authorization": Authorization | ||
107 | + }, | ||
108 | + success: function(res) { | ||
109 | + console.log("taxconfirm", res) | ||
110 | + if (res.statusCode == 200 && !that.data.isshow && res.data.status != '0') { //未完善 | ||
111 | + that.showModal(res.data) | ||
112 | + } else { | ||
113 | + that.setData({ | ||
114 | + isshow: false | ||
115 | + }) | ||
116 | + } | ||
117 | + } | ||
118 | + }) | ||
119 | + | ||
120 | + }, | ||
121 | + | ||
65 | showModal: function(data) { | 122 | showModal: function(data) { |
66 | var that = this | 123 | var that = this |
67 | that.setData({ | 124 | that.setData({ |
@@ -126,13 +183,13 @@ Page({ | @@ -126,13 +183,13 @@ Page({ | ||
126 | }) | 183 | }) |
127 | }, | 184 | }, |
128 | 185 | ||
129 | - loginout:function(){ | 186 | + loginout: function() { |
130 | wx.showModal({ | 187 | wx.showModal({ |
131 | title: '退出登录', | 188 | title: '退出登录', |
132 | content: '确认要退出登录吗?', | 189 | content: '确认要退出登录吗?', |
133 | confirmText: '确定', | 190 | confirmText: '确定', |
134 | showCancel: true, | 191 | showCancel: true, |
135 | - cancelText:"取消", | 192 | + cancelText: "取消", |
136 | confirmColor: '#357aeb', | 193 | confirmColor: '#357aeb', |
137 | success(res) { | 194 | success(res) { |
138 | console.log("loginout", res) | 195 | console.log("loginout", res) |
@@ -146,18 +203,34 @@ Page({ | @@ -146,18 +203,34 @@ Page({ | ||
146 | }) | 203 | }) |
147 | }, | 204 | }, |
148 | 205 | ||
206 | + | ||
207 | + go_verify_idcard: function() { //身份证认证 | ||
208 | + wx.navigateTo({ | ||
209 | + url: '../verify/verify_info?foreigner=false', | ||
210 | + }) | ||
211 | + }, | ||
212 | + | ||
213 | + go_verify: function() { //外籍人员信息认证 | ||
214 | + wx.navigateTo({ | ||
215 | + url: '../verify/verify_info?foreigner=true', | ||
216 | + }) | ||
217 | + }, | ||
218 | + | ||
149 | /** | 219 | /** |
150 | * 生命周期函数--监听页面隐藏 | 220 | * 生命周期函数--监听页面隐藏 |
151 | */ | 221 | */ |
152 | onHide: function() { | 222 | onHide: function() { |
153 | - | 223 | + console.log("onhide") |
224 | + this.setData({ | ||
225 | + onresume: false | ||
226 | + }) | ||
154 | }, | 227 | }, |
155 | 228 | ||
156 | /** | 229 | /** |
157 | * 生命周期函数--监听页面卸载 | 230 | * 生命周期函数--监听页面卸载 |
158 | */ | 231 | */ |
159 | onUnload: function() { | 232 | onUnload: function() { |
160 | - | 233 | + |
161 | }, | 234 | }, |
162 | 235 | ||
163 | /** | 236 | /** |
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('证照号码有误0'); | ||
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 | +} |
@@ -8,7 +8,8 @@ | @@ -8,7 +8,8 @@ | ||
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", |
@@ -18,6 +19,8 @@ | @@ -18,6 +19,8 @@ | ||
18 | "hidedInDevtools": [] | 19 | "hidedInDevtools": [] |
19 | }, | 20 | }, |
20 | "isGameTourist": false, | 21 | "isGameTourist": false, |
22 | + "simulatorType": "wechat", | ||
23 | + "simulatorPluginLibVersion": {}, | ||
21 | "condition": { | 24 | "condition": { |
22 | "search": { | 25 | "search": { |
23 | "current": -1, | 26 | "current": -1, |
请
注册
或
登录
后发表评论