realNameAuthentication.vue
9.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<template>
<view class="container" :style="{'background':mode?'#F2F4F3':'#fff'}">
<Navbar :title="title" canBack></Navbar>
<!-- 非居民 -->
<view class="noResident" v-if="mode == '1'">
<enterprise :optionsInfo="options" ref="noResidentInfo"></enterprise>
</view>
<!-- 居民 -->
<view class="resident" v-else>
<resident :optionsInfo="options" ref="residentInfo"></resident>
</view>
<view class="btnArea" v-if="showSubmitBtn">
<view class="flex">
<u-checkbox-group activeColor="#EA5504">
<u-checkbox name="Y"></u-checkbox>
</u-checkbox-group>
<view class="flex">
我已同意授权<view style="color: #EA5504;">相关协议</view>
</view>
</view>
<view class="margin-tb">
<u-button color="#EA5504" @click="handleSubmit">提交申请</u-button>
</view>
</view>
<u-popup :show="popupShow" :customStyle="{width:'80%',borderRadius:'15px'}" round="15" mode="center" @close="popupClose" @open="popupOpen">
<view class="popupSty">
<u-image :src="submitSuccessImgUrl" width="300rpx"
height="300rpx"></u-image>
<view class="titleOne">认证申请已提交</view>
<view class="titleTwo">以实际审核为准</view>
<u-button text="我知道了" @click="handSuccess" style="width: 80%; margin: 30px 0px 20px 0px;background-color: #ea5504;color: #ffffff;border-radius: 5px;"></u-button>
</view>
</u-popup>
</view>
</template>
<script>
import submitSuccessImg from '../../../../static/images/appList/realNameAuth/submitSucess.png'
import resident from './components/resident.vue'
import enterprise from './components/enterprise.vue'
export default {
components: {
resident,
enterprise
},
data() {
return {
mode: null,
title: "",
popupShow:false,
submitSuccessImgUrl:submitSuccessImg,
showSubmitBtn:true,
options:{},
};
},
onLoad(data) {
console.log('打印date',data);
if (data.mode) {
this.mode = parseInt(data.mode);
this.title = this.mode ? '非居民身份认证' : '居民身份认证'
}
if(data.option){
let options = JSON.parse(data.option);
this.options = options;
if(options.fRzzt == '已认证'||options.fRzzt =='认证中'){
this.showSubmitBtn = false;
}
}
},
methods: {
//提交成功后跳转到其他界面
handSuccess(){
this.popupShow = false;
uni.switchTab({
url: '/pages/mine/mine'
})
},
async handleSubmit(){
let userId = uni.getStorageSync('userId');
console.log('打印this.modex',this.mode,);
console.log('打印userId',userId);
let params = {
id:userId,
fHylx:this.mode?'非居民':'居民',
fSfzrxy:'',
fSfzghy:'',
fXm:'',
fSjh:'',
fXb:'',
fNl:'',
fSfzh:'',
fSsczID:'',
fSsczmc:'',
fSfzhyxq:'',
fYyzz:'',
fKhxkz:'',
fFrsfzrxy:'',
fFrsfzghy:'',
fSymc:'',
fShtysbm:'',
}
let formParamsObj = this.mode==0?this.$refs.residentInfo.idCardObj:this.$refs.noResidentInfo.enterpriseObj;
let pictureArrary = this.mode==0?this.$refs.residentInfo.picture:this.$refs.noResidentInfo.picture;
let fSfzrphotoList = [];
let fSfzghyphotoList = [];
let fYyzzphotoList = [];
let fKhxkzphotoList = [];
let fFrsfzrxyphotoList = [];
let fFrsfzghyphotoList =[];
pictureArrary.map(item => {
console.log('打印type',item);
if(item.type == 'fSfzrxy'){
fSfzrphotoList.push(JSON.parse(item.fileObj));
}else if(item.type == 'fSfzghy'){
fSfzghyphotoList.push(JSON.parse(item.fileObj));
}else if(item.type == 'fYyzz'){
fYyzzphotoList.push(JSON.parse(item.fileObj));
}else if(item.type == 'fKhxkz'){
fKhxkzphotoList.push(JSON.parse(item.fileObj));
}else if(item.type == 'fFrsfzrxy'){
fFrsfzrxyphotoList.push(JSON.parse(item.fileObj));
}else if(item.type == 'fFrsfzghy'){
fFrsfzghyphotoList.push(JSON.parse(item.fileObj));
}
});
if(fSfzrphotoList.length<=0){
uni.$u.toast('请上传身份证人像面');
return false;
}
if(fSfzghyphotoList.length<=0){
uni.$u.toast('请上传身份证国徽面');
return false;
}
if(this.mode == 1 ){
if(fYyzzphotoList.length<=0){
uni.$u.toast('请上传营业执照');
return false;
}
if(fKhxkzphotoList.length<=0){
uni.$u.toast('请上传开户许可证');
return false;
}
if(fFrsfzrxyphotoList.length<=0){
uni.$u.toast('请上传法人身份证正面');
return false;
}
if(fFrsfzghyphotoList.length<=0){
uni.$u.toast('请上传法人身份证反面');
return false;
}
}
if(!formParamsObj.name ){
uni.$u.toast(this.mode==0?'未输入姓名':'未输入经营者姓名');
return false;
}
if(!formParamsObj.phone ){
uni.$u.toast(this.mode==0?'未输入联系电话':'未输入经营者联系电话');
return false;
}
if(!formParamsObj.sex ){
uni.$u.toast(this.mode==0?'未选择性别':'未选择经营者性别');
return false;
}
if(!formParamsObj.age ){
uni.$u.toast(this.mode==0?'未输入年龄':'未输入经营者年龄');
return false;
}
if(!formParamsObj.idcard ){
uni.$u.toast(this.mode==0?'未输入身份证号':'未输入经营者身份证号');
return false;
}
if(!formParamsObj.termOfValidity ){
uni.$u.toast('未选择身份证号有效期');
return false;
}
if(!formParamsObj.fSsczmc ){
uni.$u.toast('未选择认证气站');
return false;
}
console.log('打印fSfzrphotoList',fSfzrphotoList);
params.fSfzrxy=JSON.stringify(fSfzrphotoList);
params.fSfzghy=JSON.stringify(fSfzghyphotoList);
params.fXm = formParamsObj.name;
params.fSjh = formParamsObj.phone;
params.fXb = formParamsObj.sex;
params.fNl = formParamsObj.age;
params.fSfzh = formParamsObj.idcard;
params.fSfzhyxq =formParamsObj.termOfValidity + ' 00:00:00';//身份证号有效期
params.fSsczID = formParamsObj.fSsczID ;//认证气站id;
params.fSsczmc = formParamsObj.fSsczmc;//认证气站名称;
switch (this.mode){
case 0:
break;
case 1:
if(!formParamsObj.industryAndCommerce ){
uni.$u.toast('未输入工/商业名称');
return false;
}
if(!formParamsObj.socialUnifiedCreditCode ){
uni.$u.toast('未输入统一社会信用代码');
return false;
}
//非居民
params.fYyzz =JSON.stringify(fYyzzphotoList); //营业执照
params.fKhxkz =JSON.stringify(fKhxkzphotoList); //开户许可证
params.fFrsfzrxy = JSON.stringify(fFrsfzrxyphotoList);//法人身份证人像
params.fFrsfzghy =JSON.stringify(fFrsfzghyphotoList);//法人身份证国徽像
params.fSymc = formParamsObj.industryAndCommerce;
params.fShtysbm = formParamsObj.socialUnifiedCreditCode;
break;
}
const reseult= await this.$api.realNameAuthApi.submitRealNameAuth(params);
if(reseult.code == 200 && reseult.state){
this.popupShow = true;
console.log('打印resulet',reseult);
}else{
uni.$u.toast(reseult.message);
}
},
popupClose(){
this.popupShow = false;
},
popupOpen(){
},
}
}
</script>
<style lang="scss">
.popupSty{
display: flex;
align-items: center;
flex-direction: column;
margin-top: 20px;
.titleOne{
font-family: '苹方 粗体', '苹方 中等', '苹方', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 26px;
margin: 20px 0px;
}
.titleTwo{
font-family: '苹方 中等', '苹方', sans-serif;
font-weight: 400;
font-style: normal;
font-size: 16px;
letter-spacing: 2px;
color: #666666;
}
}
.container {
padding-bottom: 100px;
}
.idCardWarp {
background: #F4F5F8;
border-radius: 10rpx;
padding: 0 24rpx;
}
.noCardWarp {
background: #fff;
border-radius: 10rpx;
display: flex;
padding: 24rpx;
margin: 24rpx;
}
.cardWarp {
position: relative;
width: 306rpx;
height: 226rpx;
display: flex;
justify-content: center;
background: #F0F3F7;
border-radius: 14rpx;
}
.cardBar {
position: absolute;
bottom: 0;
width: 100%;
height: 56rpx;
background: #DEE8F8;
line-height: 56rpx;
background-color: #dee8f8;
border-radius: 0 0 14rpx 14rpx;
}
.cardBarText {
text-align: center;
color: #536CAA;
font-weight: bold;
}
.btnArea {
position: fixed;
padding: 20rpx;
bottom: 0;
width: 100%;
background: #fff;
height: 188rpx;
}
</style>