login.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 {
  15. toast
  16. } from "@/utils/common";
  17. import {
  18. onLoad
  19. } from "@dcloudio/uni-app";
  20. import {
  21. getAppConfig,
  22. login,
  23. queryCert
  24. } from '@/api/login.js'
  25. import cacheManager from '@/utils/cacheManager.js'
  26. import JSEncrypt from 'jsencrypt';
  27. import {
  28. ref
  29. } from 'vue';
  30. const name = ref('')
  31. const idcard = ref('')
  32. onLoad(() => {
  33. })
  34. function zhengshuSearch() {
  35. if (!name.value) {
  36. toast('请输入姓名')
  37. return false;
  38. }
  39. if (!idcard.value) {
  40. toast('请输入身份证号')
  41. return false;
  42. }
  43. let req = {
  44. name: name.value,
  45. idcard: idcard.value
  46. };
  47. queryCert(req).then(res => {
  48. console.log(res);
  49. if (res.code == 0) {
  50. if (cacheManager.get('qrCode')) {
  51. cacheManager.remove('qrCode')
  52. }
  53. cacheManager.set('qrCode', JSON.stringify({
  54. base64: res.data
  55. }));
  56. uni.redirectTo({
  57. url: '/pages/showZhengshu'
  58. });
  59. } else {
  60. Toast('无对应证书信息!');
  61. return false
  62. }
  63. })
  64. }
  65. </script>