BasicVerify.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="page-container">
  3. <header class="nav-bar sticky-nav">
  4. <div class="left" @click="$router.back()">
  5. <div>
  6. <VanIcon size="19" name="arrow-left"/>
  7. </div>
  8. </div>
  9. <div class="title">基础认证</div>
  10. <div class="right"></div>
  11. </header>
  12. <div class="form-content">
  13. <div class="form-row-double">
  14. <div class="form-col">
  15. <label>法定名</label>
  16. <input type="text" placeholder="名" v-model="form.firstName" />
  17. </div>
  18. <div class="form-col">
  19. <label>法定姓</label>
  20. <input type="text" placeholder="姓" v-model="form.lastName" />
  21. </div>
  22. </div>
  23. <div class="form-item">
  24. <label>证件类型</label>
  25. <div class="input-box select-mode">
  26. <span>{{ form.idType || '身份证' }}</span>
  27. <div>
  28. <VanIcon size="15" name="arrow-down"/>
  29. </div>
  30. <!-- <span class="arrow">▼</span>-->
  31. </div>
  32. </div>
  33. <div class="form-item">
  34. <label>证件号码</label>
  35. <input type="text" placeholder="请输入证件号码" v-model="form.idNumber" />
  36. </div>
  37. <div class="form-item">
  38. <label>所在地区</label>
  39. <div class="input-box select-mode">
  40. <span :class="{ placeholder: !form.region }">{{ form.region || '请选择' }}</span>
  41. <VanIcon size="15" name="arrow-down"/>
  42. </div>
  43. </div>
  44. <div class="form-item">
  45. <label>详细地址</label>
  46. <textarea
  47. placeholder="请输入"
  48. v-model="form.address"
  49. rows="3"
  50. ></textarea>
  51. </div>
  52. <div class="upload-section">
  53. <h3 class="section-title">上传证件照</h3>
  54. <p class="section-desc">确保件照清晰可见</p>
  55. <div class="upload-card">
  56. <div class="card-content">
  57. <p class="card-tip">确保件照清晰可见</p>
  58. <h4 class="card-title">身份证人像面</h4>
  59. <div class="upload-btn">
  60. 上传 <span class="upload-icon">↑</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="upload-card">
  65. <div class="card-content">
  66. <p class="card-tip">确保件照清晰可见</p>
  67. <h4 class="card-title">身份证国徽面</h4>
  68. <div class="upload-btn">
  69. 上传 <span class="upload-icon">↑</span>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="footer-note">
  75. <p>支持小于8M的JPG、JPEG或PNG格式的图片</p>
  76. <p>上传您身份证件的完整照片,</p>
  77. <p>请确保上传图片中的所有细节都清晰可见</p>
  78. <p>请确保证件为原件并在有效期内</p>
  79. <p>请将证件置于纯色背景下</p>
  80. </div>
  81. </div>
  82. <div class="bottom-action">
  83. <button class="btn-submit" @click="handleSubmit">提交</button>
  84. </div>
  85. </div>
  86. </template>
  87. <script setup>
  88. import { reactive } from 'vue';
  89. import { useRouter } from 'vue-router';
  90. import {Icon as VanIcon } from "vant";
  91. const router = useRouter();
  92. const form = reactive({
  93. firstName: '',
  94. lastName: '',
  95. idType: '身份证',
  96. idNumber: '',
  97. region: '',
  98. address: ''
  99. });
  100. const handleSubmit = () => {
  101. console.log('提交表单', form);
  102. // 这里写提交逻辑
  103. // router.push('/success');
  104. };
  105. </script>
  106. <style scoped>
  107. /* 全局容器 */
  108. .page-container {
  109. width: 100%;
  110. max-width: 375px;
  111. min-height: 100vh;
  112. margin: 0 auto;
  113. background-color: #fff;
  114. padding-bottom: 80px; /* 给底部按钮留位置 */
  115. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  116. }
  117. /* 导航栏 */
  118. .nav-bar {
  119. display: flex;
  120. justify-content: space-between;
  121. align-items: center;
  122. height: 44px;
  123. padding: 0 16px;
  124. background: #fff;
  125. border-bottom: 1px solid #f5f5f5;
  126. }
  127. .sticky-nav { position: sticky; top: 0; z-index: 100; }
  128. .title { font-size: 17px; font-weight: 600; color: #333; }
  129. .icon-back { font-size: 20px; color: #333; cursor: pointer; }
  130. .right { width: 20px; }
  131. /* 表单内容区 */
  132. .form-content {
  133. padding: 20px 16px;
  134. }
  135. /* 通用 Input 样式 */
  136. input, textarea, .input-box {
  137. width: 100%;
  138. background-color: #F7F8FA; /* 极淡的灰色背景 */
  139. border: none;
  140. border-radius: 4px;
  141. padding: 12px;
  142. font-size: 14px;
  143. color: #333;
  144. box-sizing: border-box;
  145. outline: none;
  146. }
  147. textarea { resize: none; }
  148. input::placeholder, textarea::placeholder { color: #C2C2C2; }
  149. /* Label 样式 */
  150. label {
  151. display: block;
  152. font-size: 14px;
  153. color: #333;
  154. margin-bottom: 8px;
  155. font-weight: 500;
  156. }
  157. /* 姓名左右分栏 */
  158. .form-row-double {
  159. display: flex;
  160. gap: 15px;
  161. margin-bottom: 20px;
  162. }
  163. .form-col { flex: 1; }
  164. /* 单个表单项 */
  165. .form-item { margin-bottom: 20px; }
  166. /* 模拟 Select 下拉框 */
  167. .input-box.select-mode {
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. }
  172. .arrow { font-size: 12px; color: #999; transform: scale(0.8); }
  173. .placeholder { color: #C2C2C2; }
  174. /* 上传区域 */
  175. .upload-section { margin-top: 30px; margin-bottom: 20px; }
  176. .section-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
  177. .section-desc { font-size: 12px; color: #999; margin-bottom: 16px; }
  178. .upload-card {
  179. background-color: #F7F8FA;
  180. border-radius: 8px;
  181. height: 160px;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. margin-bottom: 16px;
  186. text-align: center;
  187. }
  188. .card-tip { font-size: 12px; color: #999; margin-bottom: 6px; }
  189. .card-title { font-size: 16px; font-weight: 600; color: #333; margin: 0 0 16px 0; }
  190. /* 上传按钮 */
  191. .upload-btn {
  192. display: inline-flex;
  193. align-items: center;
  194. justify-content: center;
  195. background-color: #EA3F54;
  196. color: #fff;
  197. padding: 8px 24px;
  198. border-radius: 20px;
  199. font-size: 14px;
  200. font-weight: 500;
  201. }
  202. .upload-icon { margin-left: 4px; font-weight: bold; }
  203. /* 底部说明 */
  204. .footer-note {
  205. font-size: 12px;
  206. color: #999;
  207. line-height: 1.6;
  208. margin-bottom: 20px;
  209. }
  210. /* 底部固定按钮 */
  211. .bottom-action {
  212. position: fixed;
  213. bottom: 0;
  214. left: 0;
  215. width: 100%;
  216. padding: 10px 16px 20px 16px;
  217. background-color: #fff;
  218. box-sizing: border-box;
  219. box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
  220. }
  221. .btn-submit {
  222. width: 100%;
  223. height: 44px;
  224. background-color: #EA3F54;
  225. color: #fff;
  226. border: none;
  227. border-radius: 22px;
  228. font-size: 16px;
  229. font-weight: 600;
  230. }
  231. </style>