af-mobile-client-vue3 1.3.17 → 1.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.3.17",
4
+ "version": "1.3.18",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -140,7 +140,7 @@ const currInst = getCurrentInstance()
140
140
  // 配置中心->表单项变更触发函数
141
141
  async function dataChangeFunc() {
142
142
  if (attr.dataChangeFunc) {
143
- await executeStrFunctionByContext(currInst, attr.dataChangeFunc, [props.form, (formData: any) => emits('setForm', formData), attr, null, mode])
143
+ await executeStrFunctionByContext(currInst, attr.dataChangeFunc, [props.form, (formData: any) => emits('setForm', formData), attr, null, mode, runLogic, getConfigByNameAsync])
144
144
  }
145
145
  }
146
146
  const dataChangeFuncdebounce = debounce(dataChangeFunc, 300)
@@ -5,7 +5,7 @@ import { showToast } from 'vant'
5
5
  // 不需要登录拦截的路由配置
6
6
  const loginIgnore = {
7
7
  names: ['404', '403', 'user-appointment', 'appointment-form', 'appointment-history'], // 根据路由名称匹配
8
- paths: ['/login', '/XReportFormIframeView', '/invoiceShow'], // 根据路由fullPath匹配
8
+ paths: ['/login', '/XReportFormIframeView', '/invoiceShow', '/register'], // 根据路由fullPath匹配
9
9
  /**
10
10
  * 判断路由是否包含在该配置中
11
11
  * @param route vue-router 的 route 对象
@@ -23,6 +23,7 @@ import XRequestView from '@af-mobile-client-vue3/views/component/XRequestView/in
23
23
  import XSignatureView from '@af-mobile-client-vue3/views/component/XSignatureView/index.vue'
24
24
  import login from '@af-mobile-client-vue3/views/user/login/index.vue'
25
25
  import my from '@af-mobile-client-vue3/views/user/my/index.vue'
26
+ import register from '@af-mobile-client-vue3/views/user/register/index.vue'
26
27
  import AbnormalAlarmRecords from '@af-mobile-client-vue3/views/userRecords/AbnormalAlarmRecords.vue'
27
28
  import CardReplacementRecords from '@af-mobile-client-vue3/views/userRecords/CardReplacementRecords.vue'
28
29
  import ChangeRecords from '@af-mobile-client-vue3/views/userRecords/ChangeRecords.vue'
@@ -331,6 +332,11 @@ const routes: Array<RouteRecordRaw> = [
331
332
  name: 'userProfile',
332
333
  component: my,
333
334
  },
335
+ {
336
+ path: '/register/:strategyId?/:openId?',
337
+ name: 'register',
338
+ component: register,
339
+ },
334
340
  {
335
341
  path: '/404',
336
342
  name: '404',
@@ -19,6 +19,7 @@ export interface WebConfig {
19
19
  systemLogo: string
20
20
  homeAppList: Array<any>
21
21
  slideshowList: Array<any>
22
+ registerRequire: boolean
22
23
  }
23
24
 
24
25
  // 存放 webConfig 中的 setting 配置
@@ -0,0 +1,910 @@
1
+ <script setup lang="ts">
2
+ import { openApiLogic } from '@af-mobile-client-vue3/services/api/common'
3
+ import { useSettingStore } from '@af-mobile-client-vue3/stores/modules/setting'
4
+ import {
5
+ showFailToast,
6
+ showSuccessToast,
7
+ showToast,
8
+ Button as VanButton,
9
+ Empty as VanEmpty,
10
+ Field as VanField,
11
+ Form as VanForm,
12
+ Icon as VanIcon,
13
+ Loading as VanLoading,
14
+ NavBar as VanNavBar,
15
+ Popup as VanPopup,
16
+ Radio as VanRadio,
17
+ RadioGroup as VanRadioGroup,
18
+ } from 'vant'
19
+ import { onMounted, ref } from 'vue'
20
+
21
+ import { useRoute, useRouter } from 'vue-router'
22
+
23
+ interface FormData {
24
+ name: string
25
+ phone: string
26
+ gender: string
27
+ email: string
28
+ username: string
29
+ password: string
30
+ confirmPassword: string
31
+ roles: string
32
+ dept_name: string
33
+ org_name: string
34
+ strategyId: string
35
+ openId: string
36
+ }
37
+ interface Errors {
38
+ [key: string]: string | undefined
39
+ name?: string
40
+ phone?: string
41
+ gender?: string
42
+ email?: string
43
+ username?: string
44
+ password?: string
45
+ confirmPassword?: string
46
+ }
47
+
48
+ interface OrganizationInfo {
49
+ roles: string
50
+ dept_name: string
51
+ org_name: string
52
+ }
53
+
54
+ type UsernameStatus = 'initial' | 'checking' | 'available' | 'unavailable'
55
+
56
+ const route = useRoute()
57
+ const router = useRouter()
58
+ const setting = useSettingStore()
59
+
60
+ // 表单数据
61
+ const formData = ref<FormData>({
62
+ name: '',
63
+ phone: '',
64
+ gender: '',
65
+ email: '',
66
+ username: '',
67
+ password: '',
68
+ confirmPassword: '',
69
+ roles: '',
70
+ dept_name: '',
71
+ org_name: '',
72
+ strategyId: '',
73
+ openId: '',
74
+ })
75
+ const initSuccess = ref(false)
76
+ const showPassword = ref(false)
77
+ const showConfirmPassword = ref(false)
78
+ const openId = ref('')
79
+ // 错误信息
80
+ const errors = ref<Errors>({})
81
+
82
+ // 状态管理
83
+ const isSubmitting = ref<boolean>(false)
84
+ const showSuccess = ref<boolean>(false)
85
+ const usernameStatus = ref<UsernameStatus>('initial')
86
+
87
+ // 组织信息(从策略获取)
88
+ const organizationInfo = ref<OrganizationInfo>({
89
+ roles: '',
90
+ dept_name: '',
91
+ org_name: '',
92
+ })
93
+ // 防抖检查用户名
94
+ let usernameCheckTimeout = null
95
+
96
+ // 验证函数
97
+ function validateName(): boolean {
98
+ if (!formData.value.name.trim()) {
99
+ errors.value.name = '员工姓名不能为空'
100
+ return false
101
+ }
102
+ if (formData.value.name.length < 2) {
103
+ errors.value.name = '员工姓名至少2个字符'
104
+ return false
105
+ }
106
+ delete errors.value.name
107
+ return true
108
+ }
109
+
110
+ function validatePhone(): boolean {
111
+ const phoneRegex = /^1[3-9]\d{9}$/
112
+ if (!formData.value.phone.trim()) {
113
+ errors.value.phone = '手机号码不能为空'
114
+ return false
115
+ }
116
+ if (!phoneRegex.test(formData.value.phone)) {
117
+ errors.value.phone = '请输入正确的手机号码'
118
+ return false
119
+ }
120
+ delete errors.value.phone
121
+ return true
122
+ }
123
+
124
+ function validateEmail(): boolean {
125
+ if (formData.value.email.trim()) {
126
+ const emailRegex = /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/
127
+ if (!emailRegex.test(formData.value.email)) {
128
+ errors.value.email = '请输入正确的邮箱地址'
129
+ return false
130
+ }
131
+ }
132
+ delete errors.value.email
133
+ return true
134
+ }
135
+
136
+ function validateUsername(): boolean {
137
+ if (!formData.value.username.trim()) {
138
+ errors.value.username = '登录名不能为空'
139
+ return false
140
+ }
141
+ if (formData.value.username.length < 3) {
142
+ errors.value.username = '登录名至少3个字符'
143
+ return false
144
+ }
145
+ if (!/^\w+$/.test(formData.value.username)) {
146
+ errors.value.username = '登录名只能包含字母、数字和下划线'
147
+ return false
148
+ }
149
+
150
+ if (usernameStatus.value === 'unavailable') {
151
+ errors.value.username = '该登录名已被使用,请选择其他登录名'
152
+ return false
153
+ }
154
+
155
+ if (usernameStatus.value === 'checking') {
156
+ errors.value.username = '正在检查登录名可用性,请稍候'
157
+ return false
158
+ }
159
+
160
+ if (usernameStatus.value === 'initial') {
161
+ checkUsernameAvailability()
162
+ errors.value.username = '正在检查登录名可用性,请稍候'
163
+ return false
164
+ }
165
+
166
+ delete errors.value.username
167
+ return true
168
+ }
169
+
170
+ function validatePassword(): boolean {
171
+ if (!formData.value.password) {
172
+ errors.value.password = '登录密码不能为空'
173
+ return false
174
+ }
175
+ if (formData.value.password.length < 6) {
176
+ errors.value.password = '登录密码至少6个字符'
177
+ return false
178
+ }
179
+ delete errors.value.password
180
+ return true
181
+ }
182
+
183
+ function validateConfirmPassword(): boolean {
184
+ if (!formData.value.confirmPassword) {
185
+ errors.value.confirmPassword = '确认密码不能为空'
186
+ return false
187
+ }
188
+ if (formData.value.password !== formData.value.confirmPassword) {
189
+ errors.value.confirmPassword = '两次输入的密码不一致'
190
+ return false
191
+ }
192
+ delete errors.value.confirmPassword
193
+ return true
194
+ }
195
+
196
+ function validateGender(): boolean {
197
+ if (!formData.value.gender) {
198
+ errors.value.gender = '请选择性别'
199
+ return false
200
+ }
201
+ delete errors.value.gender
202
+ return true
203
+ }
204
+
205
+ function validateAll(): boolean {
206
+ const validations = [
207
+ validateName(),
208
+ validatePhone(),
209
+ validateEmail(),
210
+ validateUsername(),
211
+ validatePassword(),
212
+ validateConfirmPassword(),
213
+ validateGender(),
214
+ ]
215
+ return validations.every(v => v)
216
+ }
217
+
218
+ // 检查用户名可用性
219
+ async function checkUsernameAvailability(): Promise<void> {
220
+ usernameStatus.value = 'checking'
221
+
222
+ try {
223
+ const response = await openApiLogic({ username: formData.value.username }, 'checkUserName', 'af-system')
224
+ console.log('response', response)
225
+ if (response.success) {
226
+ usernameStatus.value = 'available'
227
+ delete errors.value.username
228
+ }
229
+ else {
230
+ errors.value.username = '该登录名已被使用,请选择其他登录名'
231
+ usernameStatus.value = 'unavailable'
232
+ }
233
+ }
234
+ catch (error) {
235
+ // 模拟检查逻辑
236
+ const existingUsernames = ['admin', 'user001', 'zhangsan', 'lisi', 'wangwu']
237
+ if (existingUsernames.includes(formData.value.username.toLowerCase())) {
238
+ errors.value.username = '该登录名已被使用,请选择其他登录名'
239
+ usernameStatus.value = 'unavailable'
240
+ }
241
+ else {
242
+ usernameStatus.value = 'available'
243
+ delete errors.value.username
244
+ }
245
+ }
246
+ }
247
+
248
+ // 获取组织信息
249
+ async function fetchOrganizationInfo(strategyId: any): Promise<void> {
250
+ try {
251
+ const response = await openApiLogic({ strategyId }, 'getOrganizationInfo', 'af-system')
252
+ if (response.success) {
253
+ initSuccess.value = true
254
+ Object.assign(organizationInfo.value, response.data)
255
+ // 更新表单数据
256
+ formData.value.roles = organizationInfo.value.roles
257
+ formData.value.dept_name = organizationInfo.value.dept_name
258
+ formData.value.org_name = organizationInfo.value.org_name
259
+ formData.value.strategyId = strategyId
260
+ }
261
+ else {
262
+ showFailToast(response.msg)
263
+ }
264
+ }
265
+ catch (error) {
266
+ console.error('获取组织信息失败:', error)
267
+ showToast('获取组织信息失败')
268
+ }
269
+ }
270
+
271
+ // 提交注册
272
+ async function submitRegistration(): Promise<void> {
273
+ if (usernameStatus.value === 'checking') {
274
+ showToast('请等待登录名检查完成')
275
+ return
276
+ }
277
+
278
+ if (!validateAll()) {
279
+ showToast('请填写必填信息!')
280
+ return
281
+ }
282
+
283
+ isSubmitting.value = true
284
+
285
+ try {
286
+ console.log('formData', formData.value)
287
+ const response = await openApiLogic(formData.value, 'registrationUser', 'af-system')
288
+ console.log('response', response)
289
+ isSubmitting.value = false
290
+ showSuccess.value = true
291
+ showSuccessToast('注册成功')
292
+ }
293
+ catch (error) {
294
+ isSubmitting.value = false
295
+ showToast('注册失败,请重试')
296
+ }
297
+ }
298
+
299
+ // 重置表单
300
+ function resetForm(): void {
301
+ Object.assign(formData.value, {
302
+ name: '',
303
+ phone: '',
304
+ gender: '',
305
+ email: '',
306
+ username: '',
307
+ password: '',
308
+ confirmPassword: '',
309
+ })
310
+ Object.keys(errors.value).forEach(key => delete errors.value[key])
311
+ showPassword.value = false
312
+ showConfirmPassword.value = false
313
+ showSuccess.value = false
314
+ usernameStatus.value = 'initial'
315
+ }
316
+
317
+ function debounceUsernameCheck() {
318
+ if (usernameCheckTimeout) {
319
+ clearTimeout(usernameCheckTimeout)
320
+ }
321
+
322
+ // 重置状态
323
+ usernameStatus.value = 'initial'
324
+ delete errors.value.username
325
+
326
+ // 基本验证
327
+ if (!formData.value.username.trim()) {
328
+ return
329
+ }
330
+ if (formData.value.username.length < 3) {
331
+ return
332
+ }
333
+ if (!/^\w+$/.test(formData.value.username)) {
334
+ return
335
+ }
336
+
337
+ // 设置新的定时器
338
+ usernameCheckTimeout = setTimeout(() => {
339
+ checkUsernameAvailability()
340
+ }, 500) // 500ms 防抖延迟
341
+ }
342
+
343
+ // 提交注册
344
+ async function handleSubmit() {
345
+ if (usernameStatus.value === 'checking') {
346
+ showToast('请等待登录名检查完成')
347
+ return
348
+ }
349
+
350
+ await submitRegistration()
351
+ }
352
+
353
+ // 返回上一页
354
+ function goBack() {
355
+ router.push('/login')
356
+ }
357
+
358
+ // 组件挂载时获取组织信息
359
+ onMounted(async () => {
360
+ const strategyId = route.query.strategyId || route.params.strategyId
361
+ openId.value = route.query.openId as string || route.params.openId as string
362
+ formData.value.openId = openId.value
363
+ if (strategyId) {
364
+ await fetchOrganizationInfo(strategyId)
365
+ }
366
+ else {
367
+ if (setting.getSetting()?.registerRequire) {
368
+ showFailToast('缺少组织信息,请确二维码准确性')
369
+ }
370
+ }
371
+ })
372
+ </script>
373
+
374
+ <template>
375
+ <div class="employee-registration">
376
+ <!-- 顶部导航栏 -->
377
+ <VanNavBar
378
+ title="员工注册"
379
+
380
+ placeholder fixed
381
+ />
382
+ <div v-show="!initSuccess">
383
+ <VanEmpty image="error" description="推广码无效/已过期" />
384
+ </div>
385
+ <!-- 主要内容区域 -->
386
+ <div v-show="initSuccess" class="main-content">
387
+ <div class="form-container">
388
+ <!-- 表单标题 -->
389
+ <div class="form-header">
390
+ <h2 class="form-title">
391
+ 员工信息录入
392
+ </h2>
393
+ <p class="form-subtitle">
394
+ 请填写员工基本信息完成账号注册
395
+ </p>
396
+ </div>
397
+
398
+ <!-- 注册表单 -->
399
+ <VanForm @submit="submitRegistration">
400
+ <!-- 基本信息 -->
401
+ <div class="form-section">
402
+ <div class="section-header">
403
+ <span class="section-title">基本信息</span>
404
+ </div>
405
+
406
+ <!-- 员工姓名 -->
407
+ <VanField
408
+ v-model="formData.name"
409
+ label="员工姓名"
410
+ placeholder="请输入员工姓名"
411
+ :error="!!errors.name"
412
+ :error-message="errors.name"
413
+ label-align="top"
414
+ :border="true"
415
+ @blur="validateName"
416
+ >
417
+ <template #label>
418
+ <i class="i-material-symbols-person text-blue-500" />
419
+ 员工姓名 <span class="required">*</span>
420
+ </template>
421
+ </VanField>
422
+
423
+ <!-- 手机号码 -->
424
+ <VanField
425
+ v-model="formData.phone"
426
+ label="手机号码"
427
+ type="tel"
428
+ placeholder="请输入手机号码"
429
+ :error="!!errors.phone"
430
+ :error-message="errors.phone"
431
+ label-align="top"
432
+ @blur="validatePhone"
433
+ >
434
+ <template #label>
435
+ <i class="i-flowbite-mobile-phone-solid text-green-500" />
436
+ 手机号码 <span class="required">*</span>
437
+ </template>
438
+ </VanField>
439
+
440
+ <!-- 性别 -->
441
+ <VanField
442
+ label="性别"
443
+ :error="!!errors.gender"
444
+ :error-message="errors.gender"
445
+ label-align="top"
446
+ >
447
+ <template #label>
448
+ <i class="i-fa6-solid-venus-mars text-pink-500" />
449
+ 性别 <span class="required">*</span>
450
+ </template>
451
+ <template #input>
452
+ <VanRadioGroup v-model="formData.gender" @change="validateGender">
453
+ <VanRadio name="male">
454
+
455
+ </VanRadio>
456
+ <VanRadio name="female">
457
+
458
+ </VanRadio>
459
+ </VanRadioGroup>
460
+ </template>
461
+ </VanField>
462
+
463
+ <!-- 邮箱 -->
464
+ <VanField
465
+ v-model="formData.email"
466
+ label="邮箱"
467
+ type="email"
468
+ placeholder="请输入邮箱地址(可选)"
469
+ :error="!!errors.email"
470
+ :error-message="errors.email"
471
+ label-align="top"
472
+ @blur="validateEmail"
473
+ >
474
+ <template #label>
475
+ <i class="i-material-symbols-mail text-purple-500" />
476
+ 邮箱
477
+ </template>
478
+ </VanField>
479
+ </div>
480
+
481
+ <!-- 账号信息 -->
482
+ <div class="form-section">
483
+ <div class="section-header">
484
+ <span class="section-title">账号信息</span>
485
+ </div>
486
+
487
+ <!-- 登录名 -->
488
+ <VanField
489
+ v-model="formData.username"
490
+ label="登录名"
491
+ placeholder="请输入登录名"
492
+ :error="!!errors.username"
493
+ :error-message="errors.username"
494
+ label-align="top"
495
+ @blur="validateUsername"
496
+ @input="debounceUsernameCheck"
497
+ >
498
+ <template #label>
499
+ <i class="i-material-symbols-id-card text-indigo-500" />
500
+ 登录名 <span class="required">*</span>
501
+ </template>
502
+ <template #right-icon>
503
+ <!-- 检查中状态 -->
504
+ <VanLoading v-if="usernameStatus === 'checking'" size="16px" />
505
+ <!-- 可用状态 -->
506
+ <i v-else-if="usernameStatus === 'available'" class="i-material-symbols-check-circle text-green-500" />
507
+ <i v-else-if="usernameStatus === 'unavailable'" class="i-iconamoon-sign-times-circle text-red-500" />
508
+ </template>
509
+ </VanField>
510
+
511
+ <!-- 登录密码 -->
512
+ <VanField
513
+ v-model="formData.password"
514
+ label="登录密码"
515
+ :type="showPassword ? 'text' : 'password'"
516
+ placeholder="请输入登录密码"
517
+ :error="!!errors.password"
518
+ :error-message="errors.password"
519
+ label-align="top"
520
+ @blur="validatePassword"
521
+ >
522
+ <template #label>
523
+ <i class="i-material-symbols-lock text-orange-500" />
524
+ 登录密码 <span class="required">*</span>
525
+ </template>
526
+ <template #right-icon>
527
+ <VanIcon
528
+ :name="showPassword ? 'eye-o' : 'closed-eye'"
529
+ @click="showPassword = !showPassword"
530
+ />
531
+ </template>
532
+ </VanField>
533
+
534
+ <!-- 确认密码 -->
535
+ <VanField
536
+ v-model="formData.confirmPassword"
537
+ label="确认密码"
538
+ :type="showConfirmPassword ? 'text' : 'password'"
539
+ placeholder="请再次输入登录密码"
540
+ :error="!!errors.confirmPassword"
541
+ :error-message="errors.confirmPassword"
542
+ label-align="top"
543
+ @blur="validateConfirmPassword"
544
+ >
545
+ <template #label>
546
+ <i class="i-bxs-shield-alt-2 text-teal-500" />
547
+ 确认密码 <span class="required">*</span>
548
+ </template>
549
+ <template #right-icon>
550
+ <VanIcon
551
+ :name="showConfirmPassword ? 'eye-o' : 'closed-eye'"
552
+ @click="showConfirmPassword = !showConfirmPassword"
553
+ />
554
+ </template>
555
+ </VanField>
556
+ </div>
557
+
558
+ <!-- 组织信息 -->
559
+ <div class="form-section">
560
+ <div class="section-header">
561
+ <span class="section-title">组织信息</span>
562
+ </div>
563
+
564
+ <!-- 所属角色 -->
565
+ <VanField
566
+ v-model="formData.roles"
567
+ label="所属角色"
568
+ readonly
569
+ disabled
570
+ label-align="top"
571
+ >
572
+ <template #label>
573
+ <i class="i-fa6-solid-user-tag text-blue-600" />
574
+ 所属角色
575
+ </template>
576
+ </VanField>
577
+ <div class="field-hint">
578
+ 系统默认分配,不可修改
579
+ </div>
580
+
581
+ <!-- 所属部门 -->
582
+ <VanField
583
+ v-model="formData.dept_name"
584
+ label="所属部门"
585
+ readonly
586
+ disabled
587
+ label-align="top"
588
+ >
589
+ <template #label>
590
+ <i class="i-material-symbols-home-work text-gray-600" />
591
+ 所属部门
592
+ </template>
593
+ </VanField>
594
+ <div class="field-hint">
595
+ 系统默认分配,不可修改
596
+ </div>
597
+
598
+ <!-- 所属分公司 -->
599
+ <VanField
600
+ v-model="formData.org_name"
601
+ label="所属分公司"
602
+ readonly
603
+ disabled
604
+ label-align="top"
605
+ >
606
+ <template #label>
607
+ <i class="i-line-md-map-marker-alt-filled text-red-500" />
608
+ 所属分公司
609
+ </template>
610
+ </VanField>
611
+ <div class="field-hint">
612
+ 系统默认分配,不可修改
613
+ </div>
614
+ </div>
615
+
616
+ <!-- 提交按钮 -->
617
+ <div class="form-actions">
618
+ <VanButton
619
+ type="default"
620
+ size="large"
621
+ :disabled="isSubmitting"
622
+ class="reset-btn"
623
+ @click="resetForm"
624
+ >
625
+ <i class="i-hugeicons-redo" />
626
+ 重置
627
+ </VanButton>
628
+ <VanButton
629
+ type="primary"
630
+ size="large"
631
+ native-type="submit"
632
+ :loading="isSubmitting"
633
+ :disabled="isSubmitting"
634
+ class="submit-btn"
635
+ @click="handleSubmit"
636
+ >
637
+ <i class="i-iconoir-user-plus" />
638
+ {{ isSubmitting ? '注册中...' : '提交注册' }}
639
+ </VanButton>
640
+ </div>
641
+ </VanForm>
642
+ </div>
643
+ </div>
644
+
645
+ <!-- 注册成功弹窗 -->
646
+ <VanPopup
647
+ v-model:show="showSuccess"
648
+ round
649
+ closeable
650
+ class="success-popup"
651
+ >
652
+ <div class="success-content">
653
+ <VanIcon name="success" class="success-icon" />
654
+ <h3 class="success-title">
655
+ 注册成功
656
+ </h3>
657
+ <p class="success-message">
658
+ 员工账号已成功创建,请等待管理员审核。
659
+ </p>
660
+ <div class="success-info">
661
+ <p><strong>员工姓名:</strong>{{ formData.name }}</p>
662
+ <p><strong>登录名:</strong>{{ formData.username }}</p>
663
+ <p><strong>手机号码:</strong>{{ formData.phone }}</p>
664
+ </div>
665
+ <div class="success-actions">
666
+ <VanButton type="default" @click="resetForm">
667
+ 继续注册
668
+ </VanButton>
669
+ <VanButton type="primary" @click="goBack">
670
+ 去登录
671
+ </VanButton>
672
+ </div>
673
+ </div>
674
+ </VanPopup>
675
+ </div>
676
+ </template>
677
+
678
+ <style scoped lang="less">
679
+ .employee-registration {
680
+ min-height: 100vh;
681
+ background-color: #f5f5f5;
682
+ }
683
+
684
+ .main-content {
685
+ padding: 16px;
686
+ padding-bottom: 80px;
687
+ }
688
+
689
+ .form-container {
690
+ background: white;
691
+ border-radius: 8px;
692
+ overflow: hidden;
693
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
694
+ }
695
+
696
+ /* 表单标题样式 */
697
+ .form-header {
698
+ padding: 20px 16px 16px;
699
+ border-bottom: 1px solid #e9ecef;
700
+ }
701
+
702
+ .form-title {
703
+ font-size: 18px;
704
+ font-weight: 600;
705
+ color: #333;
706
+ margin: 0 0 4px 0;
707
+ }
708
+
709
+ .form-subtitle {
710
+ font-size: 14px;
711
+ color: #666;
712
+ margin: 0;
713
+ }
714
+
715
+ .form-section {
716
+ margin-bottom: 0;
717
+ }
718
+
719
+ .section-header {
720
+ display: flex;
721
+ align-items: center;
722
+ padding: 16px;
723
+ background-color: #f8f9fa;
724
+ border-bottom: 1px solid #e9ecef;
725
+ }
726
+
727
+ .section-icon {
728
+ margin-right: 8px;
729
+ color: #007bff;
730
+ font-size: 16px;
731
+ }
732
+
733
+ .section-title {
734
+ font-size: 16px;
735
+ font-weight: 500;
736
+ color: #333;
737
+ }
738
+
739
+ .field-icon {
740
+ margin-right: 4px;
741
+ color: #666;
742
+ font-size: 14px;
743
+ }
744
+
745
+ .required {
746
+ color: #ee0a24;
747
+ font-weight: 500;
748
+ }
749
+
750
+ /* 字段提示文字 */
751
+ .field-hint {
752
+ font-size: 12px;
753
+ color: #999;
754
+ padding: 0 16px 8px;
755
+ }
756
+
757
+ /* 按钮样式 */
758
+ .form-actions {
759
+ display: flex;
760
+ gap: 12px;
761
+ padding: 20px 16px;
762
+ background-color: #f8f9fa;
763
+ border-top: 1px solid #e9ecef;
764
+ }
765
+
766
+ .reset-btn {
767
+ flex: 1;
768
+ background-color: #6c757d !important;
769
+ border-color: #6c757d !important;
770
+ color: white !important;
771
+ }
772
+
773
+ .reset-btn:hover {
774
+ background-color: #5a6268 !important;
775
+ }
776
+
777
+ .submit-btn {
778
+ flex: 1;
779
+ background-color: #007bff !important;
780
+ border-color: #007bff !important;
781
+ color: white !important;
782
+ }
783
+
784
+ .submit-btn:hover {
785
+ background-color: #0056b3 !important;
786
+ }
787
+
788
+ /* 成功弹窗样式 */
789
+ .success-popup {
790
+ width: 90%;
791
+ max-width: 400px;
792
+ }
793
+
794
+ .success-content {
795
+ padding: 24px;
796
+ text-align: center;
797
+ }
798
+
799
+ .success-icon {
800
+ font-size: 48px;
801
+ color: #07c160;
802
+ margin-bottom: 16px;
803
+ }
804
+
805
+ .success-title {
806
+ font-size: 18px;
807
+ font-weight: 500;
808
+ color: #333;
809
+ margin-bottom: 8px;
810
+ }
811
+
812
+ .success-message {
813
+ color: #666;
814
+ margin-bottom: 16px;
815
+ }
816
+
817
+ .success-info {
818
+ text-align: left;
819
+ background-color: #f8f9fa;
820
+ padding: 12px;
821
+ border-radius: 4px;
822
+ margin-bottom: 16px;
823
+ }
824
+
825
+ .success-info p {
826
+ margin: 4px 0;
827
+ font-size: 14px;
828
+ }
829
+
830
+ .success-actions {
831
+ display: flex;
832
+ gap: 12px;
833
+ }
834
+
835
+ .success-actions .van-button {
836
+ flex: 1;
837
+ }
838
+
839
+ /* 自定义字段样式 */
840
+ :deep(.van-field__label) {
841
+ display: flex;
842
+ align-items: center;
843
+ font-weight: 500;
844
+ }
845
+
846
+ :deep(.van-field--error .van-field__control) {
847
+ color: #ee0a24;
848
+ }
849
+
850
+ :deep(.van-field--disabled .van-field__control) {
851
+ color: #999;
852
+ background-color: #f5f5f5;
853
+ }
854
+
855
+ :deep(.van-field--disabled .van-field__label) {
856
+ color: #666;
857
+ }
858
+
859
+ /* 单选按钮样式 */
860
+ :deep(.van-radio-group) {
861
+ display: flex;
862
+ gap: 20px;
863
+ }
864
+
865
+ :deep(.van-radio) {
866
+ margin: 0;
867
+ }
868
+
869
+ /* 导航栏样式 */
870
+ :deep(.van-nav-bar) {
871
+ background-color: #f8f9fa;
872
+ border-bottom: 1px solid #e9ecef;
873
+ }
874
+
875
+ :deep(.van-nav-bar__title) {
876
+ font-weight: 600;
877
+ color: #333;
878
+ }
879
+
880
+ /* 错误信息样式 */
881
+ :deep(.van-field__error-message) {
882
+ color: #ee0a24;
883
+ font-size: 12px;
884
+ margin-top: 4px;
885
+ }
886
+
887
+ /* 密码字段右侧图标样式 */
888
+ :deep(.van-field__right-icon) {
889
+ color: #999;
890
+ cursor: pointer;
891
+ }
892
+
893
+ :deep(.van-field__right-icon:hover) {
894
+ color: #666;
895
+ }
896
+ /* 修改整个输入框容器的样式 */
897
+ :deep(.van-field__body) {
898
+ margin: 10px 0;
899
+ padding: 10px 15px;
900
+ --tw-border-opacity: 1;
901
+ border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
902
+ border-radius: 0.375rem;
903
+ border-width: 1px;
904
+ font-size: 100%;
905
+ }
906
+
907
+ :deep(.van-field--disabled .van-field__control) {
908
+ background-color: #ffffff;
909
+ }
910
+ </style>