Commit a5bf384394745c47aac4a17e8f471be66ecbc170

Authored by 夏洋涛
1 parent 4cbdac62
Exists in master

feat: 身份证认证

src/common/area.json 0 → 100644
... ... @@ -0,0 +1,613 @@
  1 +[{
  2 + "area_code": "3301",
  3 + "area_name": "杭州市",
  4 + "areaList": [{
  5 + "area_code": "330102",
  6 + "area_name": "上城区",
  7 + "areaList": null,
  8 + "is_check": null
  9 + },
  10 + {
  11 + "area_code": "330103",
  12 + "area_name": "下城区",
  13 + "areaList": null,
  14 + "is_check": null
  15 + },
  16 + {
  17 + "area_code": "330104",
  18 + "area_name": "江干区",
  19 + "areaList": null,
  20 + "is_check": null
  21 + },
  22 + {
  23 + "area_code": "330105",
  24 + "area_name": "拱墅区",
  25 + "areaList": null,
  26 + "is_check": null
  27 + },
  28 + {
  29 + "area_code": "330106",
  30 + "area_name": "西湖区",
  31 + "areaList": null,
  32 + "is_check": null
  33 + },
  34 + {
  35 + "area_code": "330108",
  36 + "area_name": "滨江区",
  37 + "areaList": null,
  38 + "is_check": null
  39 + },
  40 + {
  41 + "area_code": "330109",
  42 + "area_name": "萧山区",
  43 + "areaList": null,
  44 + "is_check": null
  45 + },
  46 + {
  47 + "area_code": "330110",
  48 + "area_name": "余杭区",
  49 + "areaList": null,
  50 + "is_check": null
  51 + },
  52 + {
  53 + "area_code": "330122",
  54 + "area_name": "桐庐县",
  55 + "areaList": null,
  56 + "is_check": null
  57 + },
  58 + {
  59 + "area_code": "330127",
  60 + "area_name": "淳安县",
  61 + "areaList": null,
  62 + "is_check": null
  63 + },
  64 + {
  65 + "area_code": "330182",
  66 + "area_name": "建德市",
  67 + "areaList": null,
  68 + "is_check": null
  69 + },
  70 + {
  71 + "area_code": "330183",
  72 + "area_name": "富阳市",
  73 + "areaList": null,
  74 + "is_check": null
  75 + },
  76 + {
  77 + "area_code": "330185",
  78 + "area_name": "临安市",
  79 + "areaList": null,
  80 + "is_check": null
  81 + }
  82 + ],
  83 + "is_check": null
  84 + },
  85 + {
  86 + "area_code": "3302",
  87 + "area_name": "宁波市",
  88 + "areaList": [{
  89 + "area_code": "330203",
  90 + "area_name": "海曙区",
  91 + "areaList": null,
  92 + "is_check": null
  93 + },
  94 + {
  95 + "area_code": "330204",
  96 + "area_name": "江东区",
  97 + "areaList": null,
  98 + "is_check": null
  99 + },
  100 + {
  101 + "area_code": "330205",
  102 + "area_name": "江北区",
  103 + "areaList": null,
  104 + "is_check": null
  105 + },
  106 + {
  107 + "area_code": "330206",
  108 + "area_name": "北仑区",
  109 + "areaList": null,
  110 + "is_check": null
  111 + },
  112 + {
  113 + "area_code": "330211",
  114 + "area_name": "镇海区",
  115 + "areaList": null,
  116 + "is_check": null
  117 + },
  118 + {
  119 + "area_code": "330212",
  120 + "area_name": "鄞州区",
  121 + "areaList": null,
  122 + "is_check": null
  123 + },
  124 + {
  125 + "area_code": "330225",
  126 + "area_name": "象山县",
  127 + "areaList": null,
  128 + "is_check": null
  129 + },
  130 + {
  131 + "area_code": "330226",
  132 + "area_name": "宁海县",
  133 + "areaList": null,
  134 + "is_check": null
  135 + },
  136 + {
  137 + "area_code": "330281",
  138 + "area_name": "余姚市",
  139 + "areaList": null,
  140 + "is_check": null
  141 + },
  142 + {
  143 + "area_code": "330282",
  144 + "area_name": "慈溪市",
  145 + "areaList": null,
  146 + "is_check": null
  147 + },
  148 + {
  149 + "area_code": "330283",
  150 + "area_name": "奉化市",
  151 + "areaList": null,
  152 + "is_check": null
  153 + }
  154 + ],
  155 + "is_check": null
  156 + },
  157 + {
  158 + "area_code": "3303",
  159 + "area_name": "温州市",
  160 + "areaList": [{
  161 + "area_code": "330302",
  162 + "area_name": "鹿城区",
  163 + "areaList": null,
  164 + "is_check": null
  165 + },
  166 + {
  167 + "area_code": "330303",
  168 + "area_name": "龙湾区",
  169 + "areaList": null,
  170 + "is_check": null
  171 + },
  172 + {
  173 + "area_code": "330304",
  174 + "area_name": "瓯海区",
  175 + "areaList": null,
  176 + "is_check": null
  177 + },
  178 + {
  179 + "area_code": "330322",
  180 + "area_name": "洞头县",
  181 + "areaList": null,
  182 + "is_check": null
  183 + },
  184 + {
  185 + "area_code": "330324",
  186 + "area_name": "永嘉县",
  187 + "areaList": null,
  188 + "is_check": null
  189 + },
  190 + {
  191 + "area_code": "330326",
  192 + "area_name": "平阳县",
  193 + "areaList": null,
  194 + "is_check": null
  195 + },
  196 + {
  197 + "area_code": "330327",
  198 + "area_name": "苍南县",
  199 + "areaList": null,
  200 + "is_check": null
  201 + },
  202 + {
  203 + "area_code": "330328",
  204 + "area_name": "文成县",
  205 + "areaList": null,
  206 + "is_check": null
  207 + },
  208 + {
  209 + "area_code": "330329",
  210 + "area_name": "泰顺县",
  211 + "areaList": null,
  212 + "is_check": null
  213 + },
  214 + {
  215 + "area_code": "330381",
  216 + "area_name": "瑞安市",
  217 + "areaList": null,
  218 + "is_check": null
  219 + },
  220 + {
  221 + "area_code": "330382",
  222 + "area_name": "乐清市",
  223 + "areaList": null,
  224 + "is_check": null
  225 + },
  226 + {
  227 + "area_code": "330305",
  228 + "area_name": "龙港区",
  229 + "areaList": null,
  230 + "is_check": null
  231 + }
  232 + ],
  233 + "is_check": null
  234 + },
  235 + {
  236 + "area_code": "3304",
  237 + "area_name": "嘉兴市",
  238 + "areaList": [{
  239 + "area_code": "330402",
  240 + "area_name": "南湖区",
  241 + "areaList": null,
  242 + "is_check": null
  243 + },
  244 + {
  245 + "area_code": "330411",
  246 + "area_name": "秀洲区",
  247 + "areaList": null,
  248 + "is_check": null
  249 + },
  250 + {
  251 + "area_code": "330421",
  252 + "area_name": "嘉善县",
  253 + "areaList": null,
  254 + "is_check": null
  255 + },
  256 + {
  257 + "area_code": "330424",
  258 + "area_name": "海盐县",
  259 + "areaList": null,
  260 + "is_check": null
  261 + },
  262 + {
  263 + "area_code": "330481",
  264 + "area_name": "海宁市",
  265 + "areaList": null,
  266 + "is_check": null
  267 + },
  268 + {
  269 + "area_code": "330482",
  270 + "area_name": "平湖市",
  271 + "areaList": null,
  272 + "is_check": null
  273 + },
  274 + {
  275 + "area_code": "330483",
  276 + "area_name": "桐乡市",
  277 + "areaList": null,
  278 + "is_check": null
  279 + }
  280 + ],
  281 + "is_check": null
  282 + },
  283 + {
  284 + "area_code": "3305",
  285 + "area_name": "湖州市",
  286 + "areaList": [{
  287 + "area_code": "330502",
  288 + "area_name": "吴兴区",
  289 + "areaList": null,
  290 + "is_check": null
  291 + },
  292 + {
  293 + "area_code": "330503",
  294 + "area_name": "南浔区",
  295 + "areaList": null,
  296 + "is_check": null
  297 + },
  298 + {
  299 + "area_code": "330521",
  300 + "area_name": "德清县",
  301 + "areaList": null,
  302 + "is_check": null
  303 + },
  304 + {
  305 + "area_code": "330522",
  306 + "area_name": "长兴县",
  307 + "areaList": null,
  308 + "is_check": null
  309 + },
  310 + {
  311 + "area_code": "330523",
  312 + "area_name": "安吉县",
  313 + "areaList": null,
  314 + "is_check": null
  315 + }
  316 + ],
  317 + "is_check": null
  318 + },
  319 + {
  320 + "area_code": "3306",
  321 + "area_name": "绍兴市",
  322 + "areaList": [{
  323 + "area_code": "330602",
  324 + "area_name": "越城区",
  325 + "areaList": null,
  326 + "is_check": null
  327 + },
  328 + {
  329 + "area_code": "330621",
  330 + "area_name": "柯桥区",
  331 + "areaList": null,
  332 + "is_check": null
  333 + },
  334 + {
  335 + "area_code": "330624",
  336 + "area_name": "新昌县",
  337 + "areaList": null,
  338 + "is_check": null
  339 + },
  340 + {
  341 + "area_code": "330681",
  342 + "area_name": "诸暨市",
  343 + "areaList": null,
  344 + "is_check": null
  345 + },
  346 + {
  347 + "area_code": "330682",
  348 + "area_name": "上虞市",
  349 + "areaList": null,
  350 + "is_check": null
  351 + },
  352 + {
  353 + "area_code": "330683",
  354 + "area_name": "嵊州市",
  355 + "areaList": null,
  356 + "is_check": null
  357 + }
  358 + ],
  359 + "is_check": null
  360 + },
  361 + {
  362 + "area_code": "3307",
  363 + "area_name": "金华市",
  364 + "areaList": [{
  365 + "area_code": "330702",
  366 + "area_name": "婺城区",
  367 + "areaList": null,
  368 + "is_check": null
  369 + },
  370 + {
  371 + "area_code": "330703",
  372 + "area_name": "金东区",
  373 + "areaList": null,
  374 + "is_check": null
  375 + },
  376 + {
  377 + "area_code": "330723",
  378 + "area_name": "武义县",
  379 + "areaList": null,
  380 + "is_check": null
  381 + },
  382 + {
  383 + "area_code": "330726",
  384 + "area_name": "浦江县",
  385 + "areaList": null,
  386 + "is_check": null
  387 + },
  388 + {
  389 + "area_code": "330727",
  390 + "area_name": "磐安县",
  391 + "areaList": null,
  392 + "is_check": null
  393 + },
  394 + {
  395 + "area_code": "330781",
  396 + "area_name": "兰溪市",
  397 + "areaList": null,
  398 + "is_check": null
  399 + },
  400 + {
  401 + "area_code": "330782",
  402 + "area_name": "义乌市",
  403 + "areaList": null,
  404 + "is_check": null
  405 + },
  406 + {
  407 + "area_code": "330783",
  408 + "area_name": "东阳市",
  409 + "areaList": null,
  410 + "is_check": null
  411 + },
  412 + {
  413 + "area_code": "330784",
  414 + "area_name": "永康市",
  415 + "areaList": null,
  416 + "is_check": null
  417 + }
  418 + ],
  419 + "is_check": null
  420 + },
  421 + {
  422 + "area_code": "3308",
  423 + "area_name": "衢州市",
  424 + "areaList": [{
  425 + "area_code": "330802",
  426 + "area_name": "柯城区",
  427 + "areaList": null,
  428 + "is_check": null
  429 + },
  430 + {
  431 + "area_code": "330803",
  432 + "area_name": "衢江区",
  433 + "areaList": null,
  434 + "is_check": null
  435 + },
  436 + {
  437 + "area_code": "330822",
  438 + "area_name": "常山县",
  439 + "areaList": null,
  440 + "is_check": null
  441 + },
  442 + {
  443 + "area_code": "330824",
  444 + "area_name": "开化县",
  445 + "areaList": null,
  446 + "is_check": null
  447 + },
  448 + {
  449 + "area_code": "330825",
  450 + "area_name": "龙游县",
  451 + "areaList": null,
  452 + "is_check": null
  453 + },
  454 + {
  455 + "area_code": "330881",
  456 + "area_name": "江山市",
  457 + "areaList": null,
  458 + "is_check": null
  459 + }
  460 + ],
  461 + "is_check": null
  462 + },
  463 + {
  464 + "area_code": "3309",
  465 + "area_name": "舟山市",
  466 + "areaList": [{
  467 + "area_code": "330902",
  468 + "area_name": "定海区",
  469 + "areaList": null,
  470 + "is_check": null
  471 + },
  472 + {
  473 + "area_code": "330903",
  474 + "area_name": "普陀区",
  475 + "areaList": null,
  476 + "is_check": null
  477 + },
  478 + {
  479 + "area_code": "330921",
  480 + "area_name": "岱山县",
  481 + "areaList": null,
  482 + "is_check": null
  483 + },
  484 + {
  485 + "area_code": "330922",
  486 + "area_name": "嵊泗县",
  487 + "areaList": null,
  488 + "is_check": null
  489 + }
  490 + ],
  491 + "is_check": null
  492 + },
  493 + {
  494 + "area_code": "3310",
  495 + "area_name": "台州市",
  496 + "areaList": [{
  497 + "area_code": "331002",
  498 + "area_name": "椒江区",
  499 + "areaList": null,
  500 + "is_check": null
  501 + },
  502 + {
  503 + "area_code": "331003",
  504 + "area_name": "黄岩区",
  505 + "areaList": null,
  506 + "is_check": null
  507 + },
  508 + {
  509 + "area_code": "331004",
  510 + "area_name": "路桥区",
  511 + "areaList": null,
  512 + "is_check": null
  513 + },
  514 + {
  515 + "area_code": "331021",
  516 + "area_name": "玉环县",
  517 + "areaList": null,
  518 + "is_check": null
  519 + },
  520 + {
  521 + "area_code": "331022",
  522 + "area_name": "三门县",
  523 + "areaList": null,
  524 + "is_check": null
  525 + },
  526 + {
  527 + "area_code": "331023",
  528 + "area_name": "天台县",
  529 + "areaList": null,
  530 + "is_check": null
  531 + },
  532 + {
  533 + "area_code": "331024",
  534 + "area_name": "仙居县",
  535 + "areaList": null,
  536 + "is_check": null
  537 + },
  538 + {
  539 + "area_code": "331081",
  540 + "area_name": "温岭市",
  541 + "areaList": null,
  542 + "is_check": null
  543 + },
  544 + {
  545 + "area_code": "331082",
  546 + "area_name": "临海市",
  547 + "areaList": null,
  548 + "is_check": null
  549 + }
  550 + ],
  551 + "is_check": null
  552 + },
  553 + {
  554 + "area_code": "3311",
  555 + "area_name": "丽水市",
  556 + "areaList": [{
  557 + "area_code": "331102",
  558 + "area_name": "莲都区",
  559 + "areaList": null,
  560 + "is_check": null
  561 + },
  562 + {
  563 + "area_code": "331121",
  564 + "area_name": "青田县",
  565 + "areaList": null,
  566 + "is_check": null
  567 + },
  568 + {
  569 + "area_code": "331122",
  570 + "area_name": "缙云县",
  571 + "areaList": null,
  572 + "is_check": null
  573 + },
  574 + {
  575 + "area_code": "331123",
  576 + "area_name": "遂昌县",
  577 + "areaList": null,
  578 + "is_check": null
  579 + },
  580 + {
  581 + "area_code": "331124",
  582 + "area_name": "松阳县",
  583 + "areaList": null,
  584 + "is_check": null
  585 + },
  586 + {
  587 + "area_code": "331125",
  588 + "area_name": "云和县",
  589 + "areaList": null,
  590 + "is_check": null
  591 + },
  592 + {
  593 + "area_code": "331126",
  594 + "area_name": "庆元县",
  595 + "areaList": null,
  596 + "is_check": null
  597 + },
  598 + {
  599 + "area_code": "331127",
  600 + "area_name": "景宁畲族自治县",
  601 + "areaList": null,
  602 + "is_check": null
  603 + },
  604 + {
  605 + "area_code": "331181",
  606 + "area_name": "龙泉市",
  607 + "areaList": null,
  608 + "is_check": null
  609 + }
  610 + ],
  611 + "is_check": null
  612 + }
  613 +]
0 614 \ No newline at end of file
... ...
src/views/Home/component/AddChildPopupGroup.vue
1 1 <template>
2 2 <div>
3   - <div class="addchild_group" v-if="step==2">
4   - <img class="bg" src="@/assets/home/bg2.png" alt="">
  3 + <div class="addchild_group" v-if="step == 2">
  4 + <img class="bg" src="@/assets/home/bg2.png" alt="" />
5 5 <p class="title">学校激活认证</p>
6 6 <p class="des">认证通过后,学生研学记录可同步到学校!</p>
7 7 <div class="phone_content">
8   - <div class="item">
9   - <p class="phone_title">手机号</p>
10   - <div class="flex">
11   - <input class="code phone" type="tel" maxlength="11" v-model="phone" placeholder="请输入家校联系预留手机号">
12   - <span class="getcode" @click="getCode">{{codeText}}</span>
  8 + <template v-if="cardAuth">
  9 + <div class="item">
  10 + <p class="phone_title">姓名</p>
  11 + <input class="code" type="text" v-model="cardName" placeholder="请输入证件姓名" />
13 12 </div>
14   - </div>
15   - <div class="item">
16   - <p class="phone_title">验证码</p>
17   - <input class="code" type="text" v-model="code" placeholder="请输入验证码">
18   - </div>
19   - <button class="submit" @click="checkPhoneAndCode">完成</button>
  13 + <div class="item">
  14 + <p class="phone_title">身份证号码</p>
  15 + <input class="code" type="text" v-model="cardId" placeholder="请输入身份证号码" />
  16 + </div>
  17 + <button class="submit" @click="checkCard">完成</button>
  18 + <p class="change-btn" @click="cardAuth = false">使用手机号码认证</p>
  19 + </template>
  20 + <template v-else>
  21 + <div class="item">
  22 + <p class="phone_title">手机号</p>
  23 + <div class="flex">
  24 + <input class="code phone" type="tel" maxlength="11" v-model="phone" placeholder="请输入家校联系预留手机号" />
  25 + <span class="getcode" @click="getCode">{{ codeText }}</span>
  26 + </div>
  27 + </div>
  28 + <div class="item">
  29 + <p class="phone_title">验证码</p>
  30 + <input class="code" type="text" v-model="code" placeholder="请输入验证码" />
  31 + </div>
  32 + <button class="submit" @click="checkPhoneAndCode">完成</button>
  33 + <p class="change-btn" @click="cardAuth = true">使用身份证件认证</p>
  34 + </template>
20 35 </div>
21 36 </div>
22   - <div class="addchild_group" v-if="step==1">
23   - <img class="bg" src="@/assets/home/bg2.png" alt="">
  37 + <div class="addchild_group" v-if="step == 1">
  38 + <img class="bg" src="@/assets/home/bg2.png" alt="" />
24 39 <p class="title">添加学生信息</p>
25 40 <p class="des">完善相关信息可帮助获得最佳使用体验</p>
26 41 <div class="content">
27 42 <div class="name">学生信息</div>
28 43 <div class="item" style="width:48%;display:inline-flex;margin-right:4%;">
29   - <input type="text" placeholder="请输入学生姓名" v-model="studentName">
  44 + <input type="text" placeholder="请输入学生姓名" v-model="studentName" />
30 45 </div>
31 46 <div class="item" @click="handleYear" style="width:48%;display:inline-flex;">
32   - <p :class="!year||yearDisable?'nodata':''">{{year?year:'入学年份'}}</p>
33   - <img src="@/assets/more.png" alt="">
  47 + <p :class="!year || yearDisable ? 'nodata' : ''">{{ year ? year : '入学年份' }}</p>
  48 + <img src="@/assets/more.png" alt="" />
34 49 </div>
35   - <div class="item" @click="showUserTypeSelect=true" style="width:48%;display:inline-flex;margin-right:4%;">
36   - <p :class="!userType?'nodata':''">{{userType?userType:'当前阶段'}}</p>
37   - <img src="@/assets/more.png" alt="">
  50 + <div class="item" @click="showUserTypeSelect = true" style="width:48%;display:inline-flex;margin-right:4%;">
  51 + <p :class="!userType ? 'nodata' : ''">{{ userType ? userType : '当前阶段' }}</p>
  52 + <img src="@/assets/more.png" alt="" />
38 53 </div>
39   - <div class="item" @click="showUserClassSelect=true" style="width:48%;display:inline-flex;">
40   - <p :class="!classType?'nodata':''">{{classType?classType:'班级'}}</p>
41   - <img src="@/assets/more.png" alt="">
  54 + <div class="item" @click="showUserClassSelect = true" style="width:48%;display:inline-flex;">
  55 + <p :class="!classType ? 'nodata' : ''">{{ classType ? classType : '班级' }}</p>
  56 + <img src="@/assets/more.png" alt="" />
42 57 </div>
43 58  
44   - <div class="item" @click="showAreaSelect=true">
45   - <p :class="!area?'nodata':''">{{area?area:'请选择地区'}}</p>
46   - <img src="@/assets/more.png" alt="">
  59 + <div class="item" @click="handleSelectArea">
  60 + <p :class="!area ? 'nodata' : ''">{{ area ? area : '请选择地区' }}</p>
  61 + <img src="@/assets/more.png" alt="" />
47 62 </div>
48 63 <div class="item">
49   - <input type="text" placeholder="请选择学校" readonly v-model="school">
  64 + <input type="text" placeholder="请选择学校" readonly v-model="school" />
50 65 <button type="info" class="btn" @click="chooseSchool">选择学校</button>
51 66 </div>
52 67 <button class="submit" @click="submit">完成</button>
53 68 </div>
54 69 </div>
55 70 <van-popup v-model="showUserTypeSelect" round position="bottom" get-container="body" :safe-area-inset-bottom="true">
56   - <van-picker title="当前阶段" show-toolbar :columns="userTypeArr" value-key="label" @cancel="showUserTypeSelect = false" @confirm="selectUserTypeOver" />
  71 + <van-picker
  72 + title="当前阶段"
  73 + show-toolbar
  74 + :columns="userTypeArr"
  75 + value-key="label"
  76 + @cancel="showUserTypeSelect = false"
  77 + @confirm="selectUserTypeOver"
  78 + />
57 79 </van-popup>
58 80 <van-popup v-model="showYearSelect" round position="bottom" get-container="body" :safe-area-inset-bottom="true">
59   - <van-picker title="入学年份" show-toolbar :columns="yearArr" value-key="label" @cancel="showYearSelect = false" @confirm="selectYearOver" />
  81 + <van-picker
  82 + title="入学年份"
  83 + show-toolbar
  84 + :columns="yearArr"
  85 + value-key="label"
  86 + @cancel="showYearSelect = false"
  87 + @confirm="selectYearOver"
  88 + />
60 89 </van-popup>
61 90 <van-popup v-model="showAreaSelect" round position="bottom" get-container="body" :safe-area-inset-bottom="true">
62   - <van-area title="地区" :area-list="areaList" @cancel="showAreaSelect = false" @confirm="selectAreaOver" />
  91 + <van-cascader
  92 + v-model="area"
  93 + title="请选择所在地区"
  94 + :options="areaList"
  95 + :field-names="fieldNames"
  96 + @close="showAreaSelect = false"
  97 + @finish="selectAreaOver"
  98 + />
63 99 </van-popup>
64 100 <van-popup v-model="showUserClassSelect" round position="bottom" get-container="body" :safe-area-inset-bottom="true">
65   - <van-picker title="班级" show-toolbar :columns="classTypeArr" value-key="label" @cancel="showUserClassSelect = false" @confirm="selectClassTypeOver" />
  101 + <van-picker
  102 + title="班级"
  103 + show-toolbar
  104 + :columns="classTypeArr"
  105 + value-key="label"
  106 + @cancel="showUserClassSelect = false"
  107 + @confirm="selectClassTypeOver"
  108 + />
66 109 </van-popup>
67 110  
68 111 <van-popup v-model="chooseSchoolisShow" round get-container="body" :safe-area-inset-bottom="true">
69 112 <div v-if="chooseSchoolisShow">
70   - <chooseSchool v-model="chooseSchoolisShow" @schoolData='schoolData'></chooseSchool>
  113 + <chooseSchool v-model="chooseSchoolisShow" @schoolData="schoolData"></chooseSchool>
71 114 </div>
72 115 </van-popup>
73 116 </div>
74 117 </template>
75 118  
76 119 <script>
77   -
78 120 import chooseSchool from '@/views/Service/component/chooseSchool'
79   -var codeInterval;
  121 +import areaList from '@/common/area.json'
  122 +var codeInterval
80 123 export default {
81 124 components: { chooseSchool },
82 125 props: ['step', 'travelerNum'],
83   - data () {
  126 + data() {
84 127 return {
85 128 phone: '',
86   - codeText: '获取验证码',//获取验证码按钮文字
87   - code: '',//验证码
  129 + codeText: '获取验证码', //获取验证码按钮文字
  130 + code: '', //验证码
88 131 studentName: '',
89 132 showDialog: true,
90 133  
91   - year: '',//入学年份
  134 + year: '', //入学年份
92 135 yearDisable: false,
93 136 showYearSelect: false,
94 137 yearArr: [],
95 138  
96 139 userType: '',
97   - userTypeVal: '',//所处阶段1-小学 2-初中 3-高中
  140 + userTypeVal: '', //所处阶段1-小学 2-初中 3-高中
98 141 showUserTypeSelect: false,
99 142 userTypeArr: [
100 143 {
101 144 label: '幼儿园',
102   - value: 0
103   - }, {
  145 + value: 0,
  146 + },
  147 + {
104 148 label: '小学',
105   - value: 1
106   - }, {
  149 + value: 1,
  150 + },
  151 + {
107 152 label: '初中',
108   - value: 2
109   - }, {
  153 + value: 2,
  154 + },
  155 + {
110 156 label: '高中',
111   - value: 3
112   - }],
  157 + value: 3,
  158 + },
  159 + ],
113 160  
114 161 classType: '',
115   - classTypeVal: '',//班级
  162 + classTypeVal: '', //班级
116 163 showUserClassSelect: false,
117   - classTypeArr: [{
118   - label: '1班',
119   - value: '1班'
120   - }, {
121   - label: '2班',
122   - value: '2班'
123   - }, {
124   - label: '3班',
125   - value: '3班'
126   - }, {
127   - label: '4班',
128   - value: '4班'
129   - }, {
130   - label: '5班',
131   - value: '5班'
132   - }, {
133   - label: '6班',
134   - value: '6班'
135   - }, {
136   - label: '7班',
137   - value: '7班'
138   - }, {
139   - label: '8班',
140   - value: '8班'
141   - }, {
142   - label: '9班',
143   - value: '9班'
144   - }, {
145   - label: '10班',
146   - value: '10班'
147   - }, {
148   - label: '11班',
149   - value: '11班'
150   - }, {
151   - label: '12班',
152   - value: '12班'
153   - }, {
154   - label: '13班',
155   - value: '13班'
156   - }, {
157   - label: '14班',
158   - value: '14班'
159   - }, {
160   - label: '15班',
161   - value: '15班'
162   - }, {
163   - label: '16班',
164   - value: '16班'
165   - }, {
166   - label: '17班',
167   - value: '17班'
168   - }, {
169   - label: '18班',
170   - value: '18班'
171   - }, {
172   - label: '19班',
173   - value: '19班'
174   - }, {
175   - label: '20班',
176   - value: '20班'
177   - }, {
178   - label: '21班',
179   - value: '21班'
180   - }, {
181   - label: '22班',
182   - value: '22班'
183   - }, {
184   - label: '23班',
185   - value: '23班'
186   - }, {
187   - label: '24班',
188   - value: '24班'
189   - }, {
190   - label: '25班',
191   - value: '25班'
192   - }, {
193   - label: '26班',
194   - value: '26班'
195   - }, {
196   - label: '27班',
197   - value: '27班'
198   - }, {
199   - label: '28班',
200   - value: '28班'
201   - }, {
202   - label: '29班',
203   - value: '29班'
204   - }, {
205   - label: '30班',
206   - value: '30班'
207   - }, {
208   - label: '31班',
209   - value: '31班'
210   - }, {
211   - label: '32班',
212   - value: '32班'
213   - }, {
214   - label: '33班',
215   - value: '33班'
216   - }, {
217   - label: '34班',
218   - value: '34班'
219   - }, {
220   - label: '35班',
221   - value: '35班'
222   - }, {
223   - label: '36班',
224   - value: '36班'
225   - }, {
226   - label: '37班',
227   - value: '37班'
228   - }, {
229   - label: '38班',
230   - value: '38班'
231   - }, {
232   - label: '39班',
233   - value: '39班'
234   - }, {
235   - label: '40班',
236   - value: '40班'
237   - }, {
238   - label: '41班',
239   - value: '41班'
240   - }, {
241   - label: '42班',
242   - value: '42班'
243   - }, {
244   - label: '43班',
245   - value: '43班'
246   - }, {
247   - label: '44班',
248   - value: '44班'
249   - }, {
250   - label: '45班',
251   - value: '45班'
252   - }, {
253   - label: '46班',
254   - value: '46班'
255   - }, {
256   - label: '47班',
257   - value: '47班'
258   - }, {
259   - label: '48班',
260   - value: '48班'
261   - }, {
262   - label: '49班',
263   - value: '49班'
264   - }, {
265   - label: '50班',
266   - value: '50班'
267   - }
  164 + classTypeArr: [
  165 + {
  166 + label: '1班',
  167 + value: '1班',
  168 + },
  169 + {
  170 + label: '2班',
  171 + value: '2班',
  172 + },
  173 + {
  174 + label: '3班',
  175 + value: '3班',
  176 + },
  177 + {
  178 + label: '4班',
  179 + value: '4班',
  180 + },
  181 + {
  182 + label: '5班',
  183 + value: '5班',
  184 + },
  185 + {
  186 + label: '6班',
  187 + value: '6班',
  188 + },
  189 + {
  190 + label: '7班',
  191 + value: '7班',
  192 + },
  193 + {
  194 + label: '8班',
  195 + value: '8班',
  196 + },
  197 + {
  198 + label: '9班',
  199 + value: '9班',
  200 + },
  201 + {
  202 + label: '10班',
  203 + value: '10班',
  204 + },
  205 + {
  206 + label: '11班',
  207 + value: '11班',
  208 + },
  209 + {
  210 + label: '12班',
  211 + value: '12班',
  212 + },
  213 + {
  214 + label: '13班',
  215 + value: '13班',
  216 + },
  217 + {
  218 + label: '14班',
  219 + value: '14班',
  220 + },
  221 + {
  222 + label: '15班',
  223 + value: '15班',
  224 + },
  225 + {
  226 + label: '16班',
  227 + value: '16班',
  228 + },
  229 + {
  230 + label: '17班',
  231 + value: '17班',
  232 + },
  233 + {
  234 + label: '18班',
  235 + value: '18班',
  236 + },
  237 + {
  238 + label: '19班',
  239 + value: '19班',
  240 + },
  241 + {
  242 + label: '20班',
  243 + value: '20班',
  244 + },
  245 + {
  246 + label: '21班',
  247 + value: '21班',
  248 + },
  249 + {
  250 + label: '22班',
  251 + value: '22班',
  252 + },
  253 + {
  254 + label: '23班',
  255 + value: '23班',
  256 + },
  257 + {
  258 + label: '24班',
  259 + value: '24班',
  260 + },
  261 + {
  262 + label: '25班',
  263 + value: '25班',
  264 + },
  265 + {
  266 + label: '26班',
  267 + value: '26班',
  268 + },
  269 + {
  270 + label: '27班',
  271 + value: '27班',
  272 + },
  273 + {
  274 + label: '28班',
  275 + value: '28班',
  276 + },
  277 + {
  278 + label: '29班',
  279 + value: '29班',
  280 + },
  281 + {
  282 + label: '30班',
  283 + value: '30班',
  284 + },
  285 + {
  286 + label: '31班',
  287 + value: '31班',
  288 + },
  289 + {
  290 + label: '32班',
  291 + value: '32班',
  292 + },
  293 + {
  294 + label: '33班',
  295 + value: '33班',
  296 + },
  297 + {
  298 + label: '34班',
  299 + value: '34班',
  300 + },
  301 + {
  302 + label: '35班',
  303 + value: '35班',
  304 + },
  305 + {
  306 + label: '36班',
  307 + value: '36班',
  308 + },
  309 + {
  310 + label: '37班',
  311 + value: '37班',
  312 + },
  313 + {
  314 + label: '38班',
  315 + value: '38班',
  316 + },
  317 + {
  318 + label: '39班',
  319 + value: '39班',
  320 + },
  321 + {
  322 + label: '40班',
  323 + value: '40班',
  324 + },
  325 + {
  326 + label: '41班',
  327 + value: '41班',
  328 + },
  329 + {
  330 + label: '42班',
  331 + value: '42班',
  332 + },
  333 + {
  334 + label: '43班',
  335 + value: '43班',
  336 + },
  337 + {
  338 + label: '44班',
  339 + value: '44班',
  340 + },
  341 + {
  342 + label: '45班',
  343 + value: '45班',
  344 + },
  345 + {
  346 + label: '46班',
  347 + value: '46班',
  348 + },
  349 + {
  350 + label: '47班',
  351 + value: '47班',
  352 + },
  353 + {
  354 + label: '48班',
  355 + value: '48班',
  356 + },
  357 + {
  358 + label: '49班',
  359 + value: '49班',
  360 + },
  361 + {
  362 + label: '50班',
  363 + value: '50班',
  364 + },
268 365 ],
269 366  
270 367 area: '',
271 368 areaCode: '',
272 369 showAreaSelect: false,
273   - areaList: [],
  370 + areaList: areaList,
  371 + fieldNames: {
  372 + text: 'area_name',
  373 + value: 'area_name',
  374 + children: 'areaList',
  375 + },
274 376  
275 377 searchSchool: '',
276 378 school: '',
277 379 schoolId: '',
278 380  
279   - chooseSchoolisShow: false
  381 + chooseSchoolisShow: false,
  382 + cardAuth: false, //是否身份证认证
  383 + cardName: '',
  384 + cardId: '',
280 385 }
281 386 },
282 387  
283   - mounted () {
  388 + mounted() {
284 389 let userInfo = localStorage.getItem('userInfo')
285   - this.userInfo = JSON.parse(userInfo);
  390 + this.userInfo = JSON.parse(userInfo)
286 391 this.initYearArr()
287   - this.GetSysAreaList()
288 392 },
289 393 methods: {
290 394 // 获取验证码
291   - getCode () {
292   - if (this.codeText != '获取验证码') return;
  395 + getCode() {
  396 + if (this.codeText != '获取验证码') return
293 397 if (!this.phone) {
294 398 this.$toast('请输入手机号')
295   - return;
  399 + return
296 400 }
297 401 if (!this.checkPhone(this.phone)) {
298 402 this.$toast('请输入正确的手机号')
299   - return;
  403 + return
300 404 }
301 405 this.$toast.loading({
302 406 message: '加载中',
303 407 duration: 0,
304   - forbidClick: true
  408 + forbidClick: true,
305 409 })
306 410 this.mgop({
307 411 api: 'mgop.sz.hswsy.getMsg', // 必须
... ... @@ -313,48 +417,48 @@ export default {
313 417 // 'isTestUrl': '1'
314 418 },
315 419 data: {
316   - "phone": this.phone
  420 + phone: this.phone,
317 421 },
318   - onSuccess: res => {
  422 + onSuccess: (res) => {
319 423 this.$toast.clear()
320   - if (res.data.code == 200||res.data.success) {
321   - let i = 60;
  424 + if (res.data.code == 200 || res.data.success) {
  425 + let i = 60
322 426 codeInterval = setInterval(() => {
323 427 if (i == 0) {
324   - this.codeText = `获取验证码`;
325   - clearInterval(codeInterval);
326   - return;
  428 + this.codeText = `获取验证码`
  429 + clearInterval(codeInterval)
  430 + return
327 431 }
328   - this.codeText = `重试(${i})`;
  432 + this.codeText = `重试(${i})`
329 433 i--
330 434 }, 1000)
331 435 } else {
332 436 this.$toast.fail(res.data?.message)
333 437 }
334 438 },
335   - onFail: err => {
  439 + onFail: (err) => {
336 440 console.log('err', err)
337   - }
338   - });
  441 + },
  442 + })
339 443 },
340   - // 获取手机号白名单信息
341   - checkPhoneAndCode () {
  444 + // 获取手机号白名单信息,激活认证
  445 + checkPhoneAndCode() {
342 446 if (!this.phone) {
343 447 this.$toast('请输入手机号')
344   - return;
  448 + return
345 449 }
346 450 if (!this.checkPhone(this.phone)) {
347 451 this.$toast('请输入正确的手机号')
348   - return;
  452 + return
349 453 }
350 454 if (!this.code) {
351 455 this.$toast('请输入验证码')
352   - return;
  456 + return
353 457 }
354 458 this.$toast.loading({
355 459 message: '加载中',
356 460 duration: 0,
357   - forbidClick: true
  461 + forbidClick: true,
358 462 })
359 463 this.mgop({
360 464 api: 'mgop.sz.hswsy.checkPhone', // 必须
... ... @@ -366,11 +470,11 @@ export default {
366 470 // 'isTestUrl': '1'
367 471 },
368 472 data: {
369   - "code": this.code,
370   - "phone": this.phone,
371   - "travelerNum": this.travelerNum
  473 + code: this.code,
  474 + phone: this.phone,
  475 + travelerNum: this.travelerNum,
372 476 },
373   - onSuccess: res => {
  477 + onSuccess: (res) => {
374 478 this.$toast.clear()
375 479 if (res.data.code == 200) {
376 480 this.$toast.success('认证成功')
... ... @@ -379,18 +483,59 @@ export default {
379 483 this.$toast.fail(res.data?.message)
380 484 }
381 485 },
382   - onFail: err => {
  486 + onFail: (err) => {
383 487 console.log('err', err)
384   - }
385   - });
  488 + },
  489 + })
  490 + },
  491 + // 获取身份证认证
  492 + checkCard() {
  493 + if (!this.cardName) {
  494 + this.$toast('请输入证件姓名')
  495 + return
  496 + }
  497 + if (!this.cardId) {
  498 + this.$toast('请输入身份证号')
  499 + return
  500 + }
  501 + this.$toast.loading({
  502 + message: '加载中',
  503 + duration: 0,
  504 + forbidClick: true,
  505 + })
  506 + this.mgop({
  507 + api: 'mgop.sz.hswsy.checkIdCard', // 必须
  508 + host: 'https://mapi.zjzwfw.gov.cn/',
  509 + dataType: 'JSON',
  510 + type: 'POST',
  511 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  512 + headers: {
  513 + // 'isTestUrl': '1'
  514 + },
  515 + data: {
  516 + idCard: this.cardId,
  517 + travelerNum: this.travelerNum,
  518 + },
  519 + onSuccess: (res) => {
  520 + this.$toast.clear()
  521 + if (res.data.code == 200) {
  522 + this.$toast.success('认证成功')
  523 + this.$emit('complete')
  524 + } else {
  525 + this.$toast.fail(res.data?.message)
  526 + }
  527 + },
  528 + onFail: (err) => {
  529 + console.log('err', err)
  530 + },
  531 + })
386 532 },
387   -
388 533 // 初始化入学年份选项
389   - initYearArr () {
  534 + initYearArr() {
390 535 // 页面创建时执行
391 536 let year = new Date().getFullYear(),
392 537 Month = new Date().getMonth() + 1,
393   - yearArr = [];
  538 + yearArr = []
394 539 if (Month > 8) {
395 540 // 如果月份大于8,那么当年的学年的高考年份要+1,如果月份小于7,那么当前的年份就是今年高考的年份
396 541 year = year
... ... @@ -400,120 +545,62 @@ export default {
400 545 }
401 546 this.yearArr = yearArr
402 547 },
403   - selectYearOver (value) {
404   - this.year = value.label;
405   - this.showYearSelect = false;
  548 + selectYearOver(value) {
  549 + this.year = value.label
  550 + this.showYearSelect = false
406 551 },
407   - handleYear () {
  552 + handleYear() {
408 553 if (!this.yearDisable) {
409   - this.showYearSelect = true;
  554 + this.showYearSelect = true
410 555 }
411 556 },
412   - selectUserTypeOver (value) {
413   - this.userType = value.label;
414   - this.userTypeVal = value.value;
415   - this.showUserTypeSelect = false;
  557 + selectUserTypeOver(value) {
  558 + this.userType = value.label
  559 + this.userTypeVal = value.value
  560 + this.showUserTypeSelect = false
416 561 },
417 562 //班级选择
418   - selectClassTypeOver (value) {
419   - this.classType = value.label;
420   - this.classTypeVal = value.value;
421   - this.showUserClassSelect = false;
422   - },
423   - // 获取地区列表
424   - GetSysAreaList () {
425   - this.mgop({
426   - api: 'mgop.sz.hswsy.GetSysAreaList', // 必须
427   - host: 'https://mapi.zjzwfw.gov.cn/',
428   - dataType: 'JSON',
429   - type: 'GET',
430   - appKey: 'fuxgnukl+2001895516+edccpx', // 必须
431   - headers: {
432   - // 'isTestUrl': '1'
433   - },
434   - data: {
435   - "areaCode": 33
436   - },
437   - onSuccess: res => {
438   - console.log('获取地区列表', res)
439   - if (res.data.success) {
440   - let data = res.data.data;
441   - let obj = {
442   - province_list: {
443   - 330000: '浙江省'
444   - },
445   - city_list: {},
446   - county_list: {}
447   - };
448   - if (data) {
449   - data.forEach((n, i) => {
450   - obj.city_list[n.area_code + '00'] = n.area_name;
451   - if (n.areaList.length > 0) {
452   - n.areaList.forEach((k, j) => {
453   - obj.county_list[k.area_code] = k.area_name;
454   - })
455   - }
456   - });
457   - this.areaList = obj;
458   - }
459   - } else {
460   - this.$toast.fail(res.message)
461   - }
462   - },
463   - onFail: err => {
464   - console.log('err', err)
465   - }
466   - });
  563 + selectClassTypeOver(value) {
  564 + this.classType = value.label
  565 + this.classTypeVal = value.value
  566 + this.showUserClassSelect = false
467 567 },
468   - selectAreaOver (value) {
469   - let data = value;
470   - var city = data[1].code;
471   - city = city.substring(0, city.length - 2);
472   - // console.log(city)
473   - this.area = data[0].name + ',' + data[1].name + ',' + data[2].name;
474   - this.areaCode = [data[0].code, city, data[2].code];
475   - this.quCode = data[2].code;
476   - this.school = '',
477   - this.schoolId = '',
478   - this.showAreaSelect = false
  568 + selectAreaOver(value) {
  569 + this.area = '浙江省,' + value.selectedOptions[0].area_name + ',' + value.selectedOptions[1].area_name
  570 + this.showAreaSelect = false
479 571 },
480 572  
481   - submit () {
  573 + submit() {
482 574 if (!this.studentName) {
483   - this.$toast('请输入姓名');
484   - }
485   - else if (!this.userType) {
486   - this.$toast('请选择阶段');
487   - }
488   - else if (!this.classType) {
489   - this.$toast('请选择班级');
490   - }
491   - else if (!this.year) {
492   - this.$toast('请选择入学年份');
493   - }
494   - else if (!this.area) {
495   - this.$toast('请选择地区');
496   - }
497   - else if (!this.school) {
498   - this.$toast('请选择学校');
  575 + this.$toast('请输入姓名')
  576 + } else if (!this.userType) {
  577 + this.$toast('请选择阶段')
  578 + } else if (!this.classType) {
  579 + this.$toast('请选择班级')
  580 + } else if (!this.year) {
  581 + this.$toast('请选择入学年份')
  582 + } else if (!this.area) {
  583 + this.$toast('请选择地区')
  584 + } else if (!this.school) {
  585 + this.$toast('请选择学校')
499 586 } else {
500 587 let postData = {
501 588 contactsName: this.studentName,
502 589 contactsMobile: this.userInfo?.phone,
503 590 contactsType: 1,
504   - province: this.area.split(',')[0],//省份
505   - city: this.area.split(',')[1],//城市
506   - area: this.area.split(',')[2],//地区
507   - schoolName: this.school,//学校名称
508   - enrollYear: this.year,//入学年份
509   - travelerType: this.userTypeVal,//1-小学 2-初中 3-高中
  591 + province: this.area.split(',')[0], //省份
  592 + city: this.area.split(',')[1], //城市
  593 + area: this.area.split(',')[2], //地区
  594 + schoolName: this.school, //学校名称
  595 + enrollYear: this.year, //入学年份
  596 + travelerType: this.userTypeVal, //0 幼儿园 1-小学 2-初中 3-高中
510 597 loginMobile: this.userInfo?.phone,
511   - className: this.classType //班级
  598 + className: this.classType, //班级
512 599 }
513 600 this.$toast.loading({
514 601 message: '加载中',
515 602 duration: 0,
516   - forbidClick: true
  603 + forbidClick: true,
517 604 })
518 605 this.mgop({
519 606 api: 'mgop.sz.hswsy.addStudent', // 必须
... ... @@ -525,7 +612,7 @@ export default {
525 612 // 'isTestUrl': '1'
526 613 },
527 614 data: postData,
528   - onSuccess: res => {
  615 + onSuccess: (res) => {
529 616 console.log('添加学生:', res)
530 617 this.$toast.clear()
531 618 if (res.data.code == 200) {
... ... @@ -535,31 +622,31 @@ export default {
535 622 this.$toast.fail(res.data?.message)
536 623 }
537 624 },
538   - onFail: err => {
  625 + onFail: (err) => {
539 626 console.log('err', err)
540   - }
541   - });
  627 + },
  628 + })
542 629 }
543 630 },
544 631 //选择学校
545   - chooseSchool () {
  632 + chooseSchool() {
546 633 // this.$router.push({name: 'chooseSchool'})
547 634 this.chooseSchoolisShow = true
548 635 },
549   - schoolData (val) {
550   - this.school = val.text;
551   - this.schoolId = val.id;
  636 + schoolData(val) {
  637 + this.school = val.text
  638 + this.schoolId = val.id
552 639 },
553   - checkPhone (phone) {
554   - if ((/^1[3456789]\d{9}$/.test(phone))) {
  640 + checkPhone(phone) {
  641 + if (/^1[3456789]\d{9}$/.test(phone)) {
555 642 return true
556 643 } else {
557 644 return false
558 645 }
559 646 },
560 647 },
561   - destroyed () {
562   - clearInterval(codeInterval);
  648 + destroyed() {
  649 + clearInterval(codeInterval)
563 650 },
564 651 }
565 652 </script>
... ... @@ -646,8 +733,7 @@ export default {
646 733 float: right;
647 734 font-size: 28px;
648 735 background: linear-gradient(135deg, #cdf8cf 0%, #8af36f 100%);
649   - box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5),
650   - 0px 8px 12px 0px rgba(89, 199, 171, 0.5);
  736 + box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5), 0px 8px 12px 0px rgba(89, 199, 171, 0.5);
651 737 border-radius: 34px;
652 738 border: transparent;
653 739 color: #333333;
... ... @@ -663,8 +749,7 @@ export default {
663 749 height: 72px;
664 750 border: 0;
665 751 background: linear-gradient(135deg, #99c2ff 0%, #1f59ff 100%);
666   - box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5),
667   - 0px 8px 12px 0px rgba(87, 137, 255, 0.5);
  752 + box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5), 0px 8px 12px 0px rgba(87, 137, 255, 0.5);
668 753 border-radius: 34px;
669 754 font-size: 34px;
670 755 color: #ffffff;
... ... @@ -760,10 +845,17 @@ export default {
760 845 font-size: 34px;
761 846 color: #ffffff;
762 847 margin: 0 auto;
763   - margin-top: 120px;
  848 + margin-top: 80px;
764 849 display: block;
765 850 }
766 851 }
  852 + .change-btn {
  853 + color: #5789ff;
  854 + font-size: 28px;
  855 + text-align: center;
  856 + text-decoration: underline;
  857 + margin-top: 40px;
  858 + }
767 859 }
768 860 ::v-deep .van-search {
769 861 background: transparent;
... ...