groupPenson.vue
11.4 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<template>
<div>
<div class="addchild_group" v-if="step==1">
<img class="bg" src="@/assets/home/bg2.png" alt="">
<p class="title">集团管理人员认证</p>
<p class="des">认证完成后可发起集团定制研学活动</p>
<div class="phone_content">
<div class="item">
<p class="phone_title">手机号</p>
<div class="flex">
<input class="code phone" type="tel" maxlength="11" v-model="phone" placeholder="请输入您的手机号">
<span class="getcode" @click="getCode">{{codeText}}</span>
</div>
</div>
<div class="item">
<p class="phone_title">验证码</p>
<input class="code" type="text" v-model="code" placeholder="请输入验证码">
</div>
<button class="submit" @click="checkPhoneAndCode">下一步(1/2)</button>
</div>
</div>
<div class="addchild_group" v-if="step==2">
<img class="bg" src="@/assets/home/bg2.png" alt="">
<p class="title">已查询到相关信息</p>
<p class="des">请仔细确认个人信息后再认领</p>
<div class="child_content">
<div class="school_box">
<div class="box" v-for="(v,i) in schoolList" :key="i">
<div class="box_list">
<div class="box_name" style="margin:0 0 20px">
<div class="greyFont">学校:</div>
<div>{{v.schoolName}}</div>
</div>
<!-- <div class="box_name" style="margin:12px 0 40px">
<div class="greyFont">所在地区:</div>
<div>浙江绍兴 越城区</div>
</div> -->
</div>
<div class="box_check">
<van-checkbox v-model="v.isAuth" shape="square"></van-checkbox>
</div>
</div>
</div>
<button class="submit" @click="claimChild">完成</button>
</div>
</div>
<div class="addchild_group" v-if="step==3">
<img class="bg" src="@/assets/home/bg2.png" alt="">
<p class="title">暂无相关信息</p>
<p class="des">请确认预留手机号码是否正确</p>
<div class="content">
<div class="pic">
<img style="width:100%;height:100%" src="@/assets/Travel/noSchool.png" alt="">
</div>
<button class="submit" style="margin-top:50px" @click="handleClose">完成</button>
</div>
</div>
</div>
</template>
<script>
import chooseSchool from '@/views/Home/component/chooseSchool'
var codeInterval;
export default {
components: { chooseSchool },
data () {
return {
step: 1,
phone: '',
codeText: '获取验证码',//获取验证码按钮文字
code: '',//验证码
studentName: '',
showDialog: true,
claimChildList: [],
appId: '',
chooseSchoolisShow: false,
checked: '',
schoolList: [
]
}
},
mounted () {
let userInfo = localStorage.getItem('userInfo')
this.userInfo = JSON.parse(userInfo);
},
methods: {
// 获取验证码
getCode () {
if (this.codeText != '获取验证码') return;
if (!this.phone) {
this.$toast('请输入手机号')
return;
}
if (!this.checkPhone(this.phone)) {
this.$toast('请输入正确的手机号')
return;
}
this.$toast.loading({
message: '加载中',
duration: 0,
forbidClick: true
})
this.http.getMsg({
phone: this.phone
}).then((res) => {
this.$toast.clear()
if (res.success) {
let i = 60;
codeInterval = setInterval(() => {
if (i == 0) {
this.codeText = `获取验证码`;
clearInterval(codeInterval);
return;
}
this.codeText = `重试(${i})`;
i--
}, 1000)
} else {
this.$toast.fail(res.message)
}
})
},
// 获取手机号白名单信息
checkPhoneAndCode () {
if (!this.phone) {
this.$toast('请输入手机号')
return;
}
if (!this.checkPhone(this.phone)) {
this.$toast('请输入正确的手机号')
return;
}
if (!this.code) {
this.$toast('请输入验证码')
return;
}
this.$toast.loading({
message: '加载中',
duration: 0,
forbidClick: true
})
const userInfo = JSON.parse(localStorage.getItem('userInfo'))
this.yxAxios.post(`${this.baseUrl}/prod/user/info/checkPhoneAndCode`, {
"code": this.code,
"phone": this.phone,
"unionId": userInfo.unionId,
'requestFlag': 2
}).then((res) => {
this.$toast.clear()
if (res.data.code == 200) {
if (res.data.data.length == 0) {
// 白名单无用户
this.step = 3;
} else {
// 白名单有用户
this.schoolList = res.data.data
this.step = 2;
}
} else if(res.data.code == 200222) {
// 白名单无用户
this.step = 3;
}
else{
this.$toast.fail(res.data?.message)
}
})
},
// 完成
claimChild () {
const schoolList = this.schoolList
let dataList = ''
schoolList.forEach(item => {
if(item.isAuth) {
dataList = dataList + item.schoolName + ','
}
})
if(dataList) {
dataList = dataList.substring(0 , dataList.length-1);
}
console.log(dataList )
this.$toast.loading({
message: '加载中...',
duration: 0,
forbidClick: true
})
this.yxAxios.post(`${this.baseUrl}/prod/user/info/claimSchool?loginMobile=${this.phone}&schoolNames=${dataList}`).then((res) => {
this.$toast.clear()
console.log(res.data)
if (res.data.code == 200) {
this.$toast.success('认证成功')
this.$emit('closeJT')
} else {
this.$toast.fail(res.data?.message)
}
})
},
handleClose () {
this.$emit('closeJT')
},
checkPhone (phone) {
if ((/^1[3456789]\d{9}$/.test(phone))) {
return true
} else {
return false
}
},
},
destroyed () {
clearInterval(codeInterval);
},
}
</script>
<style lang="scss" scoped>
.addchild_group {
width: 638px;
height: 836px;
background: #ffffff;
border-radius: 24px;
position: relative;
.bg {
width: 100%;
position: absolute;
top: 0;
left: 0;
}
.title {
position: relative;
width: 100%;
padding-top: 70px;
padding-bottom: 8px;
text-align: center;
font-size: 34px;
font-weight: bold;
color: #0857ff;
}
.des {
position: relative;
width: 100%;
box-sizing: border-box;
padding: 0 15%;
text-align: center;
font-size: 24px;
color: #6596ff;
}
.content {
width: 100%;
box-sizing: border-box;
padding: 0 40px;
position: absolute;
top: 236px;
left: 0;
.name {
width: 558px;
height: 50px;
font-size: 28px;
color: #000;
padding-left: 20px;
box-sizing: border-box;
}
.item {
width: 558px;
height: 72px;
border-radius: 36px;
background: #f7f7f7;
box-sizing: border-box;
font-size: 28px;
padding: 0 32px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 28px;
p {
color: #333333;
&.nodata {
color: #999999;
}
}
img {
width: 40px;
}
input {
width: 100%;
background: transparent;
border: 0;
color: #333333;
padding: 0;
&::-webkit-input-placeholder {
color: #999999;
}
}
.btn {
width: 240px;
height: 55px;
float: right;
font-size: 28px;
background: linear-gradient(135deg, #cdf8cf 0%, #8af36f 100%);
box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5),
0px 8px 12px 0px rgba(89, 199, 171, 0.5);
border-radius: 34px;
border: transparent;
color: #333333;
}
}
.school_select {
font-size: 28px;
padding: 0 32px;
margin-bottom: 28px;
}
.submit {
width: 294px;
height: 72px;
border: 0;
background: linear-gradient(135deg, #99c2ff 0%, #1f59ff 100%);
box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5),
0px 8px 12px 0px rgba(87, 137, 255, 0.5);
border-radius: 34px;
font-size: 34px;
color: #ffffff;
margin: 0 auto;
display: block;
}
.pic {
width: 350px;
height: 350px;
margin: auto
}
}
.child_content {
position: relative;
margin-top: 40px;
.child_box {
height: 500px;
overflow: auto;
padding-left: 100px;
.child_item {
position: relative;
margin-bottom: 50px;
p {
font-size: 28px;
padding: 8px 0;
span {
display: inline-block;
width: 140px;
margin-right: 28px;
color: #999;
}
}
.checkbox {
position: absolute;
top: 115px;
right: 20px;
}
}
}
.school_box {
width: 100%;
height: 500px;
overflow: auto;
font-size: 3.7vw;
padding: 20px 60px 20px 90px ;
box-sizing: border-box;
.box {
display: flex;
justify-content: space-between;
.box_list {
.box_name {
display: flex;
.greyFont {
// width: 160px;
width: 110px;
color: #999999;
}
}
}
.box_check {
}
}
}
.submit {
width: 438px;
height: 78px;
background: #3385ff;
border-radius: 37px;
border-radius: 39px;
border: 0;
font-size: 34px;
color: #ffffff;
margin: 0 auto;
display: block;
}
}
.phone_content {
width: 100%;
position: absolute;
top: 180px;
left: 0;
box-sizing: border-box;
padding: 40px;
.item {
border-bottom: 1px solid #e2e2e2;
margin-bottom: 30px;
}
.phone_title {
font-size: 34px;
font-weight: bold;
margin-bottom: 28px;
}
.flex {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 22px;
}
.code {
border: 0;
background: transparent;
font-size: 28px;
margin-bottom: 32px;
width: 100%;
}
.phone {
width: 50%;
margin: 0;
}
.getcode {
color: #5789ff;
font-size: 28px;
padding: 10px;
}
.submit {
width: 438px;
height: 78px;
background: #3385ff;
border-radius: 37px;
border-radius: 39px;
border: 0;
font-size: 34px;
color: #ffffff;
margin: 0 auto;
margin-top: 120px;
display: block;
}
}
}
/deep/.van-search {
background: transparent;
padding: 0;
width: 100%;
}
/deep/.van-search__content {
padding: 0;
}
.schoolBoxF {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
background-color: #fff;
}
</style>