authentication.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div v-if="authentication" class="ml-3">
  3. <div>
  4. <v-icon color="primary">mdi-check-circle</v-icon>
  5. 已通过实名认证
  6. </div>
  7. <div class="box mt-5">
  8. <div>姓名:史迪奇</div>
  9. <div class="mt-5">身份证号:4******************8</div>
  10. </div>
  11. <v-btn color="primary" class="half-button mt-5" @click="authentication = !authentication">解绑</v-btn>
  12. </div>
  13. <div v-else>
  14. <div class="topTip">为了您在平台有更好的操作体验,请进行实名认证</div>
  15. <div class="d-flex align-center justify-center flex-column">
  16. <CtForm ref="CtFormRef" :items="formItems" style="width: 300px;">
  17. <template #idCardImg1="{ item }">
  18. <div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
  19. <Img @success="val => item.value = val" @delete="item.value = ''"></Img>
  20. </template>
  21. <template #idCardImg2="{ item }">
  22. <div class="mt-5 d-flex">
  23. <div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
  24. <Img @success="val => item.value = val" @delete="item.value = ''"></Img>
  25. </div>
  26. </template>
  27. </CtForm>
  28. <v-btn class="buttons mt-5" color="primary" @click="authentication = !authentication">{{ $t('common.submit') }}</v-btn>
  29. </div>
  30. </div>
  31. </template>
  32. <script setup>
  33. defineOptions({ name: 'authentication-page'})
  34. import { ref } from 'vue'
  35. // 是否已实名
  36. const authentication = ref(true)
  37. const CtFormRef = ref()
  38. const formItems = ref({
  39. options: [
  40. {
  41. type: 'text',
  42. key: 'name',
  43. value: '',
  44. label: '真实姓名 *',
  45. rules: [v => !!v || '请输入您的真实姓名']
  46. },
  47. {
  48. type: 'text',
  49. key: 'idCardNo',
  50. value: '',
  51. label: '身份证号码 *',
  52. rules: [v => !!v || '请输入您的身份证号码']
  53. },
  54. {
  55. slotName: 'idCardImg1',
  56. value: '',
  57. label: '身份证-国徽照 *',
  58. rules: [v => !!v || '请上传']
  59. },
  60. {
  61. slotName: 'idCardImg2',
  62. value: '',
  63. label: '身份证-人像照 *',
  64. rules: [v => !!v || '请上传']
  65. }
  66. ]
  67. })
  68. </script>
  69. <style scoped lang="scss">
  70. .topTip {
  71. background-color: #fff6ec;
  72. color: var(--v-error-base);
  73. padding: 12px 20px;
  74. margin: 10px 0 40px;
  75. font-size: 14px;
  76. }
  77. .box {
  78. background-color: #f7f8fa;
  79. border-radius: 6px;
  80. color: var(--color-666);
  81. font-size: 14px;
  82. padding: 25px;
  83. }
  84. .upload {
  85. width: 120px;
  86. height: 120px;
  87. border: 1px solid #ccc;
  88. border-radius: 4px;
  89. cursor: pointer;
  90. }
  91. </style>