index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="content">
  3. <view style="height: 190rpx;"></view>
  4. <view class="a-title">
  5. <view class="title">本人实名认证</view>
  6. <view class="text">用于身份实名核验,反洗钱,资料将严格保密</view>
  7. </view>
  8. <view class="a-idcard-box">
  9. <view class="front" v-if="frontImg!=''" @click="chooseImage(1)">
  10. <image :src="frontImg" mode=""></image>
  11. </view>
  12. <view class="front bg-image" @click="chooseImage(1)" v-else>
  13. <zzx-icon name="upload" size="30"></zzx-icon>
  14. <view class="">上传人像面</view>
  15. </view>
  16. <view class="flip-side" v-if="flipSideImg!=''" @click="chooseImage(2)">
  17. <image :src="flipSideImg" mode=""></image>
  18. </view>
  19. <view class="flip-side bg-image" v-else @click="chooseImage(2)">
  20. <zzx-icon name="upload" size="30"></zzx-icon>
  21. <view class="">上传国徽面</view>
  22. </view>
  23. </view>
  24. <view class="a-form">
  25. <view class="form-item">
  26. <view class="">真实姓名</view>
  27. <input type="text" v-model="formData.fullName" placeholder="请输入本人姓名" />
  28. </view>
  29. <view class="form-item">
  30. <view class="">身份证号</view>
  31. <input type="idcard" v-model="formData.identityCard" placeholder="请输入本人身份证号" />
  32. </view>
  33. <view class="form-item">
  34. <view class="">手机号码</view>
  35. <input type="number" v-model="formData.phone" placeholder="请输入手机号" />
  36. </view>
  37. <view class="form-tips">老人或无手机号,可填写亲友手机号</view>
  38. </view>
  39. <view class="u-select-btn">
  40. <button hover-class="hover-btn" @click="submit">下一步</button>
  41. </view>
  42. </view>
  43. </template>
  44. <script lang="ts" setup>
  45. import { ref, onMounted } from 'vue';
  46. import { http } from '@/utils/http';
  47. import { RouterUtils,TipsUtils } from '@/utils/util';
  48. const formData = ref({
  49. fullName: '',
  50. identityCard: '',
  51. phone: ''
  52. })
  53. const frontImg = ref('')
  54. const flipSideImg=ref('')
  55. const chooseImage = (e) => {
  56. uni.chooseImage({
  57. count: 1,
  58. sizeType: ['original', 'compressed'],
  59. sourceType: ['album', 'camera'],
  60. success: function (res) {
  61. if(e==1){
  62. frontImg.value=res.tempFilePaths;
  63. }else{
  64. flipSideImg.value=res.tempFilePaths;
  65. }
  66. }
  67. });
  68. }
  69. const submit = () => {
  70. http.post('/my/familyMembers/addFamilyMembers',{...formData.value},{loading:true}).then((res)=>{
  71. TipsUtils.tips_toast(res.message)
  72. formData.value.fullName = ''
  73. formData.value.identityCard = ''
  74. formData.value.phone = ''
  75. })
  76. // uni.navigateTo({
  77. // url: '/pages/index/identityCertifying/index'
  78. // })
  79. // uni.checkIsSupportSoterAuthentication({
  80. // success: (res) => {
  81. // wx.startFacialRecognitionVerify({
  82. // name: '',
  83. // idCardNumber: '',
  84. // success: (res) => {
  85. // if (res.errMsg == 'startFacialRecognitionVerify:ok') {
  86. // console.log(res,'人脸识别结果:success');
  87. // }
  88. // },
  89. // fail: (err) => {
  90. // console.log(err,'人脸识别结果:fail')
  91. // uni.showToast({
  92. // title: '人脸识别失败',
  93. // icon: 'none',
  94. // duration: 20000,
  95. // });
  96. // }
  97. // })
  98. // },
  99. // fail: (err) => {
  100. // console.log(err)
  101. // }
  102. // })
  103. }
  104. </script>
  105. <style lang="less" scoped>
  106. .content {
  107. background: #fff;
  108. height: 1300rpx;
  109. .a-title {
  110. text-align: center;
  111. .title {
  112. font-weight: 800;
  113. font-size: 36rpx;
  114. color: #222222;
  115. }
  116. .text {
  117. margin-top: 20rpx;
  118. font-size: 24rpx;
  119. color: #AAAAAA;
  120. }
  121. }
  122. .a-idcard-box{
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-around;
  126. font-size: 28rpx;
  127. color: #222222;
  128. margin-top: 40rpx;
  129. .front{
  130. width: 332rpx;
  131. height: 204rpx;
  132. border-radius: 16rpx;
  133. background-image: url('@/static/idcard-front.png');
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. flex-direction: column;
  138. &>image{
  139. width: 100%;
  140. height: 100%;
  141. border-radius: 16rpx;
  142. }
  143. }
  144. .flip-side{
  145. width: 332rpx;
  146. height: 204rpx;
  147. border-radius: 16rpx;
  148. background-image: url('@/static/idcard-flipSide.png');
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. flex-direction: column;
  153. &>image{
  154. width: 100%;
  155. height: 100%;
  156. border-radius: 16rpx;
  157. }
  158. }
  159. }
  160. .a-form {
  161. margin-top: 20rpx;
  162. .form-item {
  163. height: 110rpx;
  164. display: flex;
  165. align-items: center;
  166. gap: 20rpx;
  167. border-bottom: 1rpx solid #F0F0F0;
  168. font-weight: bold;
  169. font-size: 28rpx;
  170. color: #222222;
  171. &>input {
  172. font-weight: normal;
  173. }
  174. }
  175. .form-tips{
  176. margin-top: 20rpx;
  177. font-size: 24rpx;
  178. color: #AAAAAA;
  179. }
  180. }
  181. .u-select-btn {
  182. position: fixed;
  183. width: 100%;
  184. height: 300rpx;
  185. left: 0;
  186. bottom: 0;
  187. background: #fff;
  188. &>button {
  189. width: 95%;
  190. height: 100rpx;
  191. line-height: 100rpx;
  192. background: #D3FD76;
  193. border-radius: 60rpx;
  194. font-weight: bold;
  195. font-size: 32rpx;
  196. color: #222222;
  197. }
  198. &>button::after {
  199. border: none;
  200. }
  201. .hover-btn {
  202. background: #ccf371;
  203. color: #999999;
  204. }
  205. }
  206. }
  207. </style>