|
@@ -0,0 +1,74 @@
|
|
|
+<template>
|
|
|
+ <Modal v-model="faceCheckModalOpen" width="900" :mask-closable="false" :closable="false">
|
|
|
+ <div slot="header" style="display: flex; justify-content: space-between; align-items: center;">
|
|
|
+ <div class="qm-title-text">人脸识别</div>
|
|
|
+ <Icon type="ios-close" class="qm-icon-button" size="24" @click="close" />
|
|
|
+ </div>
|
|
|
+ <div style="display: grid; grid-template-columns: 200px 400px 1fr; grid-gap: 5px;">
|
|
|
+ <div class="avatar">
|
|
|
+ <img :src="userPhoto" width="200px" alt="底照" />
|
|
|
+ <div class="avatar-info" style="text-align: center; margin-top: -50px; color: white;">
|
|
|
+ <!-- FIXME: 没有底照的逻辑 -->
|
|
|
+ <span style="background-color: rgba(0, 0, 0, 0.5); display: inline-block;padding: 6px 16px; border-radius: 6px;">我的底照</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="camera">
|
|
|
+ <video id="video" width="400px" height="100%" autoplay>
|
|
|
+ </video>
|
|
|
+ <div class="avatar-info" style="text-align: center; margin-top: -50px; color: #232323;">
|
|
|
+ <span class="verify-button" style="font-size: 16px; background-color: #ffcc00; display: inline-block;padding: 6px 16px; border-radius: 6px;">开始识别</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="verify-desc">
|
|
|
+ <h4 class="font-thin m-t-none m-b text-info">操作提示:</h4>
|
|
|
+ <p class="text-sm m-b-xs">1.请先确保摄像头设备已连接并能正常工作;</p>
|
|
|
+ <p class="text-sm m-b-xs">2.请保持光源充足,不要逆光操作;</p>
|
|
|
+ <p class="text-sm m-b-xs">3.请保证脸部正面面向摄像头,并适当调整姿势保证整个脸部能够进入左侧识别画面;</p>
|
|
|
+ <p class="text-sm m-b-xs">4.系统识别通过后,将自动跳转进入考试界面;</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div slot="footer">
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { createNamespacedHelpers } from "vuex";
|
|
|
+const { mapState, mapMutations } = createNamespacedHelpers("examHomeModule");
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return { userPhoto: null };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ open: Boolean
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ const res = await this.$http.get(
|
|
|
+ "/api/ecs_core/studentFaceInfo/identityNumber",
|
|
|
+ {
|
|
|
+ params: {
|
|
|
+ identityNumber: this.$store.state.user.identityNumber,
|
|
|
+ orgId: this.$store.state.user.rootOrgId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.userPhoto = res.data.student.photoPath;
|
|
|
+ // FIXME: 以后api返回的是绝对路径
|
|
|
+ if (this.userPhoto.startsWith("http") === false) {
|
|
|
+ this.userPhoto =
|
|
|
+ "https://ecs-test-static.qmth.com.cn/student_base_photo/" +
|
|
|
+ this.userPhoto;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(["faceCheckModalOpen"])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapMutations(["toggleFaceCheckModal"]),
|
|
|
+ close() {
|
|
|
+ this.toggleFaceCheckModal(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|