移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

226 righe
6.4 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header">
  4. <div class="return_btn" @click="onClickLeft"></div>
  5. <p>身份核验</p>
  6. </div>
  7. <!-- 未认证-->
  8. <div class="list_main"v-if="responseData.isFacial ==='N'" >
  9. <p class="userName">{{responseData.memberName}}<span class="noCheck">待认证</span></p>
  10. <p class="id_card" >{{responseData.idcard}}</p>
  11. <van-uploader v-model="fileList" :max-size="20 * 1024 * 1024" @oversize="onOversize" :max-count="1" multiple :after-read="afterRead" @delete="deleteFile1" />
  12. <p class="text_block">上传或拍摄人像图进行认证</p>
  13. <p class="btn_block" @click="facialVerify">验证</p>
  14. </div>
  15. <!-- 已认证-->
  16. <div class="list_main" v-if="responseData.isFacial ==='Y'">
  17. <p class="userName" >{{responseData.memberName}}
  18. <span class="yesCheck">已认证<span class="yesTime" >{{responseData.facialAt}}</span></span>
  19. </p>
  20. <p class="id_card" >{{responseData.idcard}}</p>
  21. <img class="img_block" :src="'/api'+responseData.headSculpture" alt="" @error="setDefaultImage">
  22. <!-- <img class="img_block" src="../../assets/images/sunVillage_info/check_icon_02.png" alt="">-->
  23. <p class="text_block">您已认证,<span>{{ remainingSeconds }}</span>秒后进入页面...</p>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import Cookies from "js-cookie";
  29. import {faceVerification} from "@/api/sunVillage_info/fixedAssets";
  30. // import {attachmentUpload} from "@/api/sunVillage_info/fixedAssets";
  31. export default {
  32. name: "identityCheck",
  33. data() {
  34. return {
  35. fileList:[],
  36. responseData: null,
  37. remainingSeconds: 3, // 剩余秒数,初始值为3秒
  38. formData:null,
  39. };
  40. },
  41. created() {
  42. this.responseData = this.$route.query.responseData;
  43. // 判断是否已认证
  44. if (this.responseData.isFacial === 'Y') {
  45. const countdownInterval = setInterval(() => {
  46. if (this.remainingSeconds === 0) {
  47. clearInterval(countdownInterval); // 清除计时器
  48. this.$router.push({ path: '/sunVillage_info/index_code_rights' });
  49. } else {
  50. this.remainingSeconds--;
  51. }
  52. }, 1000); // 1000 毫秒等于1秒
  53. } else {
  54. this.formData = new FormData();
  55. this.formData.append("name", this.responseData.memberName);
  56. this.formData.append("idCard",this.responseData.idcard);
  57. this.formData.append("deptId",this.responseData.deptId);
  58. }
  59. },
  60. methods: {
  61. onOversize(file) {
  62. console.log(file);
  63. this.$toast.fail('图片大小不能超过 20MB');
  64. },
  65. setDefaultImage(event) {
  66. event.target.src = require("../../../static/images/zwtpxw.jpg");
  67. },
  68. deleteFile1(detail){
  69. this.formData.delete("file");
  70. },
  71. facialVerify(){
  72. const file = this.formData.get("file");
  73. if (!file) {
  74. this.$toast({
  75. icon: 'warning', // 找到自己需要的图标
  76. message: '请上传头像',
  77. duration: "1000"
  78. });
  79. return ;
  80. }
  81. this.$toast.loading({
  82. message: "人脸识别中",
  83. forbidClick: true,
  84. duration: 0,
  85. });
  86. faceVerification(this.formData).then((response) => {
  87. if(response.code === 200) {
  88. this.$toast.clear();
  89. this.$toast({
  90. icon: 'success',
  91. message: '人脸验证成功',
  92. duration: "1000"
  93. });
  94. this.$router.push({path: '/sunVillage_info/index_code_rights'})
  95. }
  96. })
  97. },
  98. afterRead(file) {
  99. this.$toast.loading({
  100. message: "上传中...",
  101. forbidClick: true,
  102. duration: 0,
  103. });
  104. this.formData.append("file", file.file);
  105. this.$toast.clear();
  106. },
  107. },
  108. };
  109. </script>
  110. <style scoped lang="scss">
  111. /deep/ .van-uploader{
  112. margin: 6vh 0 2vh 50%;
  113. transform: translateX(-50%);
  114. }
  115. /deep/ .van-uploader__upload{
  116. margin: 0;
  117. border-radius: 50%;
  118. overflow: hidden;
  119. }
  120. /deep/ .van-uploader__preview-image{
  121. margin: 0;
  122. border-radius: 50%;
  123. overflow: hidden;
  124. }
  125. .home_wrapper{
  126. width: 100vw;
  127. min-height: 100vh;
  128. background-image:linear-gradient(#29c379, #f1f2f2, #f1f2f2, #f1f2f2);
  129. .header{
  130. text-align: center;
  131. position: relative;
  132. height: 110px;
  133. line-height: 110px;
  134. color: #ffffff;
  135. font-size: 16PX;
  136. }
  137. .return_btn {
  138. width: 24px;
  139. height: 43.2px;
  140. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  141. background-size: 20px 36px;
  142. position: absolute;
  143. left: 38px;
  144. top: 36px;
  145. }
  146. .list_main{
  147. padding:3vh 2vh 10vh;
  148. background: #ffffff;
  149. width: 94%;
  150. margin: 25px auto 0;
  151. border-radius: 15PX;
  152. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  153. .userName{
  154. font-size: 16PX;
  155. line-height: 1;
  156. .noCheck{
  157. font-size: 14PX;
  158. color: #ffffff;
  159. padding: 2PX 10PX 2PX 20PX;
  160. border-radius: 5PX;
  161. background: #bdbdbd url("../../assets/images/sunVillage_info/check_icon_01.png") no-repeat left center;
  162. background-position-x: 5PX;
  163. background-size: 12PX;
  164. }
  165. .yesCheck{
  166. font-size: 14PX;
  167. color: #ffffff;
  168. padding: 2PX 1PX 2PX 20PX;
  169. border-radius: 5PX;
  170. background: #2fc57a url("../../assets/images/sunVillage_info/check_icon_03.png") no-repeat left center;
  171. background-position-x: 5PX;
  172. background-size: 12PX;
  173. .yesTime{
  174. padding: 1PX 10PX;
  175. background: #ccf8d6;
  176. color: #2fc57a;
  177. margin-left: 10PX;
  178. margin-top: 1PX;
  179. border-radius: 5PX;
  180. }
  181. }
  182. }
  183. .id_card{
  184. font-size: 16PX;
  185. margin-top: 15PX;
  186. }
  187. .img_block{
  188. width: 30vw;
  189. margin: 4vh auto 1vh;
  190. display: block;
  191. }
  192. .text_block{
  193. font-size: 14PX;
  194. color: #a7a6a6;
  195. text-align: center;
  196. span{
  197. font-size: 18PX;
  198. color: #30c67a;
  199. font-weight: bold;
  200. }
  201. }
  202. .btn_block{
  203. display: inline-block;
  204. font-size: 14PX;
  205. color: #ffffff;
  206. border-radius: 5vh;
  207. padding: 1vh 5vh;
  208. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  209. background-image:linear-gradient(to right,#30c67a, #51e872);
  210. margin: 4vh 0 0 50%;
  211. transform: translateX(-50%);
  212. }
  213. }
  214. }
  215. </style>