Index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <app-view class="g-form">
  3. <template #header>
  4. <app-navbar :title="$t('user.authentication.title')" />
  5. </template>
  6. <div class="g-form__container" v-if="userInfo">
  7. <CellGroup inset>
  8. <Cell :title="$t('user.authentication.customername')" :value="userInfo.customername" />
  9. <Cell :title="$t('user.authentication.cardtype')"
  10. :value="getCertificateTypeCodeName(userInfo.cardtypeid)" />
  11. <Cell :title="$t('user.authentication.cardnum')" :value="userInfo.cardnum" />
  12. <Cell :title="$t('user.authentication.cardfrontphoto')">
  13. <Image fit="contain" :src="getFileUrl(userInfo.cardfrontphotourl)" width="100" height="100" />
  14. </Cell>
  15. <Cell :title="$t('user.authentication.cardbackphoto')" v-if="showCardBackPhoto === '1'">
  16. <Image fit="contain" :src="getFileUrl(userInfo.cardbackphotourl)" width="100" height="100" />
  17. </Cell>
  18. <Cell :title="halfBodyPhotoTitle" v-if="showHalfBodyPhoto === '1'">
  19. <Image fit="contain" :src="getFileUrl(userInfo.halfbodyphotourl)" width="100" height="100" />
  20. </Cell>
  21. <Cell :title="$t('user.authentication.authstatus')"
  22. :value="getAuthStatusName(userStore.userAccount.hasauth)" />
  23. </CellGroup>
  24. </div>
  25. <Empty :description="$t('common.nodatas')" v-else />
  26. </app-view>
  27. </template>
  28. <script lang="ts" setup>
  29. import { shallowRef } from 'vue'
  30. import { CellGroup, Cell, Image, Empty } from 'vant'
  31. import { getAuthStatusName } from '@/constants/account'
  32. import { queryWrDraftUserInfo } from '@/services/api/account'
  33. import { useRequest } from '@/hooks/request'
  34. import { getCertificateTypeCodeName } from '@/constants/account'
  35. import { getFileUrl } from '@/filters'
  36. import { decryptAES } from '@/services/websocket/package/crypto'
  37. import { getWskhOpenAccountConfigs } from '@/services/api/account'
  38. import { i18n, useUserStore } from "@/stores"
  39. const { t } = i18n.global
  40. const userStore = useUserStore()
  41. const userInfo = shallowRef<Model.UserInfo>()
  42. const showHalfBodyPhoto = shallowRef('0')
  43. const showCardBackPhoto = shallowRef('0')
  44. const halfBodyPhotoTitle = shallowRef(t('user.authentication.halfbodyphoto'))
  45. /// 查询托管银行信息
  46. useRequest(queryWrDraftUserInfo, {
  47. onSuccess: (res) => {
  48. /// 签约状态
  49. userInfo.value = res.data[0] ?? {
  50. ...userStore.userInfo,
  51. cardnum: decryptAES(userStore.userInfo.cardnum)
  52. }
  53. }
  54. })
  55. // 获取网上开户配置
  56. useRequest(getWskhOpenAccountConfigs, {
  57. params: {
  58. configs: '53,54,78'
  59. },
  60. onSuccess: (res) => {
  61. /// 是否显示半身照和 证件背面照
  62. showCardBackPhoto.value = res.data.filter(e => e.configid === 53)[0].configvalue ?? '0'
  63. showHalfBodyPhoto.value = res.data.filter(e => e.configid === 54)[0].configvalue ?? '0'
  64. halfBodyPhotoTitle.value = res.data.filter(e => e.configid === 78)[0].configvalue ?? t('user.authentication.halfbodyphoto')
  65. }
  66. })
  67. </script>