From e1b028d486713eaf55aaf35fbf334aa568059c0d Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 14 四月 2026 15:46:54 +0800
Subject: [PATCH] 项目复制
---
src/views/h5/faceAuth/components/auditDialog.vue | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 156 insertions(+), 0 deletions(-)
diff --git a/src/views/h5/faceAuth/components/auditDialog.vue b/src/views/h5/faceAuth/components/auditDialog.vue
new file mode 100644
index 0000000..9662901
--- /dev/null
+++ b/src/views/h5/faceAuth/components/auditDialog.vue
@@ -0,0 +1,156 @@
+<template>
+ <el-dialog
+ v-model="dialogFlag"
+ width="80%"
+ style="max-width: 500px;"
+ align-center
+ :show-close="status!='auditing'"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ >
+ <div class="p-7 pt-0" style="display: flex; flex-direction: column; align-items: center;">
+ <div class="image_box" v-if="['unStart', 'auditing'].includes(status)">
+ <el-image :src="base64" style="width: 100%;" fit="cover"></el-image>
+ <div v-if="status=='auditing'" class="scan-line"></div>
+ </div>
+ <el-row justify="center" v-else-if="['success', 'fail'].includes(status)">
+ <el-image :src="$getImageUrl(`/h5/face_${status}.png`)"></el-image>
+ <el-row>
+ <el-text class="text-lg">浜鸿劯楠岃瘉{{ status=='success'?'':'涓�' }}閫氳繃</el-text>
+ </el-row>
+ <el-row class="mt-2">
+ <el-text v-if="status=='success'">绯荤粺宸叉垚鍔熷鏍告偍鐨勮韩浠�</el-text>
+ <el-text v-else-if="status=='fail'">璇烽噸鏂伴獙璇佹偍鐨勮韩浠�</el-text>
+ </el-row>
+ </el-row>
+ <el-row justify="center" class="mt-5" v-if="status=='auditing'">
+ <el-text>姝e湪瀹℃牳涓紝璇疯�愬績绛夊緟...</el-text>
+ </el-row>
+ <el-button
+ v-if="status=='unStart'"
+ @click="submitAudit"
+ :loading="status=='auditing'"
+ type="primary"
+ size="large" class="mt-5"
+ style="width: 100%;"
+ >
+ 鎻愪氦瀹℃牳
+ </el-button>
+ <el-button
+ v-else-if="status=='success'"
+ @click="handlerSuccess"
+ type="primary"
+ size="large" class="mt-5"
+ style="width: 100%;"
+ >
+ 瀹屾垚楠岃瘉
+ </el-button>
+ <el-button
+ v-else-if="status=='fail'"
+ @click="dialogFlag=false"
+ type="primary"
+ size="large" class="mt-5"
+ style="width: 100%;"
+ >
+ 纭畾
+ </el-button>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import { uploadByBase64 } from '@/utils/tool.js';
+
+export default {
+ components: {},
+ data() {
+ return {
+ dialogFlag: false,
+ status: '',
+ url: ''
+ }
+ },
+ props: {
+ modelValue: {
+ type: Boolean,
+ default: false
+ },
+ base64: {
+ type: String,
+ default: ''
+ }
+ },
+ computed: {
+
+ },
+ created() {
+
+ },
+ watch: {
+ modelValue(val) {
+ this.dialogFlag = val
+ if (val) {
+ this.status = 'unStart'
+ }
+ },
+ dialogFlag(val) {
+ this.$emit('update:modelValue', val)
+ }
+ },
+ methods: {
+ async submitAudit() {
+ this.status = 'auditing'
+ this.url = await uploadByBase64(this.base64 ,'浜鸿劯鐓х墖')
+ if (!this.url) {
+ this.status = 'fail'
+ return
+ }
+ const params = { faceImgPath: this.url }
+ this.$axios.get('/system/auth/staff/checkin/face-match', { params }).then(res => {
+ if (res.data.code == 0) {
+ this.status = res.data.data ? 'success' : 'fail'
+ } else {
+ this.status = 'fail'
+ this.$message.error(res.data.msg || "浜鸿劯姣斿澶辫触")
+ }
+ }).catch(() => {
+ this.status = 'fail'
+ })
+ },
+ handlerSuccess() {
+ this.dialogFlag = false
+ this.$emit('handlerSuccess', this.url)
+ }
+ }
+}
+</script>
+<style scoped lang="scss">
+.image_box {
+ position: relative;
+ width: 90%;
+ max-width: 300px;
+ aspect-ratio: 1/1;
+ border-radius: 50% 50%;
+ overflow: hidden;
+ display: flex;
+ justify-content: center;
+ border: 5px solid #5693f4;
+}
+/* 鎵弿绾� */
+.scan-line {
+ position: absolute;
+ left: 0px;
+ right: 0px;
+ height: 50px;
+ background: linear-gradient(0deg, #5693f4, transparent);
+ animation: scan 2s ease-in-out infinite;
+ /* 鍒濆浣嶇疆璁惧湪椤堕儴 */
+ top: -50px;
+}
+
+@keyframes scan {
+ 0% { top: -50px; }
+ 100% { top: 100%; } /* 绉诲姩鍒板簳閮� */
+}
+
+</style>
\ No newline at end of file
--
Gitblit v1.8.0