login.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="mobile-login-page">
  3. <view class="icon-title-navBar-box">
  4. <text class="nav-bar-title">录取通知书</text>
  5. </view>
  6. <view>
  7. <input class="uni-input" v-model="name" focus placeholder="请输入姓名" />
  8. <input class="uni-input" v-model="idcard" type="idcard" placeholder="请输入身份证号" />
  9. </view>
  10. <view @click="zhengshuSearch">
  11. 搜索
  12. </view>
  13. </view>
  14. </template>
  15. <script setup>
  16. import CryptoJS from 'crypto-js';
  17. import {
  18. toast
  19. } from "@/utils/common";
  20. import {
  21. onLoad
  22. } from "@dcloudio/uni-app";
  23. import {
  24. getAppConfig,
  25. login,
  26. queryCert
  27. } from '@/api/login.js'
  28. import cacheManager from '@/utils/cacheManager.js'
  29. import JSEncrypt from 'jsencrypt';
  30. import {
  31. ref
  32. } from 'vue';
  33. const name = ref('')
  34. const idcard = ref('')
  35. onLoad(() => {
  36. })
  37. function zhengshuSearch() {
  38. if (!name.value) {
  39. toast('请输入姓名')
  40. return false;
  41. }
  42. if (!idcard.value) {
  43. toast('请输入身份证号')
  44. return false;
  45. }
  46. let req = {
  47. name: name.value,
  48. idcard: idcard.value
  49. };
  50. queryCert(req).then(res => {
  51. console.log(res);
  52. if (res.code == 0) {
  53. if (cacheManager.get('qrCode')) {
  54. cacheManager.remove('qrCode')
  55. }
  56. cacheManager.set('qrCode', JSON.stringify({
  57. base64: res.data
  58. }));
  59. uni.redirectTo({
  60. url: '/pages/showZhengshu'
  61. });
  62. } else {
  63. Toast('无对应证书信息!');
  64. return false
  65. }
  66. })
  67. }
  68. </script>