login.vue 1.4 KB

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