login.vue 1.4 KB

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