From 4e6f18dfa08e2f2f4f02aaa1b8e8e51852b7a9a1 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期五, 13 三月 2026 17:46:03 +0800
Subject: [PATCH] 考点核验

---
 src/views/h5/signup/index.vue |   80 +++++++++++++++++++++++++++++++++------
 1 files changed, 67 insertions(+), 13 deletions(-)

diff --git a/src/views/h5/signup/index.vue b/src/views/h5/signup/index.vue
index 3d549eb..7a6f83d 100644
--- a/src/views/h5/signup/index.vue
+++ b/src/views/h5/signup/index.vue
@@ -2,8 +2,8 @@
   <div class="p-4 signin">
     <div>
       <el-row class="px-7" justify="space-between">
-        <el-text class="text-lg">濮撳悕锛�<span class="font-bold">寮犱笁</span></el-text>
-        <el-text class="text-lg">韬唤璇佸熬鍙凤細<span class="font-bold">8888</span></el-text>
+        <el-text class="text-lg">濮撳悕锛�<span class="font-bold">{{ userInfo.name }}</span></el-text>
+        <el-text class="text-lg">韬唤璇佸熬鍙凤細<span class="font-bold">{{ userInfo.idCard?.slice(-4) }}</span></el-text>
       </el-row>
       <el-row justify="center" class="m-4">
         <div style="position: relative;">
@@ -13,7 +13,7 @@
               :center="centerPoint"
               @getUserPositionStatus="(evt) => userPositionStatus = evt"
               @getMapStatus="(evt) => mapStatus = evt"
-              @getDistance="(evt) => distance = evt"
+              @getDistance="getDistance"
             />
           </div>
           <div class="center-sign">
@@ -37,18 +37,18 @@
           </div>
         </div>
       </el-row>
-      <el-row justify="center">
+      <!-- <el-row justify="center">
         <el-text class="text-lg font-bold">{{ positionName }}</el-text>
-      </el-row>
+      </el-row> -->
       <el-row justify="center" class="mt-1">
         <el-text class="text-lg text-info">{{ positionAddress }}</el-text>
       </el-row>
     </div>
     <el-row justify="center" class="mt-7">
-      <div class="signin-button" :style="getSigninButtonStyle">
+      <div class="signin-button" :style="getSigninButtonStyle" @click="signinConfirm()">
         <span class="ripple" v-if="!positionError"></span>
         <el-row justify="center">
-          <el-text class="text-lg  text-white">绛惧埌</el-text>
+          <el-text class="text-lg text-white">绛惧埌</el-text>
         </el-row>
         <el-row justify="center" class="mt-1">
           <el-text class="text-lg text-white">{{ currentTimeText }}</el-text>
@@ -60,29 +60,37 @@
 
 <script>
 import BaiduMap from '@/views/h5/signup/BaiduMap.vue'
+import { useSessionStore } from '@/stores/session.js'
+import { storeToRefs } from 'pinia';
 export default {
   components: {
     BaiduMap
+  },
+  setup() {
+    const { userInfo } = storeToRefs(useSessionStore()) 
+    return { userInfo } 
   },
   data() {
     return {
       userPositionStatus: 'loading', // loading銆乫ail銆乻uccess
       mapStatus: 'loading', //loading銆乫ail銆乻uccess
-      distance: 0,
+      distance: null,
       positionError: false,
-      failMsg: '瓒呭嚭绛惧埌鑼冨洿锛屼笉鍙鍒�',
-      positionName: '涓囩浜戝煄',
+      positionName: '',
       positionAddress: '鍗楀北鍖烘墦鐭充簩璺崡118鍙�',
       currentTimeText: '',
       centerPoint: {
-        lat:22.580372,
+        lat: 22.580372,
         lng: 113.946530
       }
     }
   },
   computed: {
+    canSignup() {
+      return this.mapStatus == 'success' && this.userPositionStatus == 'success' && !this.positionError
+    },
     getSigninButtonStyle() {
-      if (this.positionStatus == 'success') {
+      if (this.canSignup) {
         return {
           'background': '#66d06c',
           'border-color': '#e7f7eb'
@@ -93,21 +101,67 @@
           'border-color': '#f8f8f8'
         }
       }
+    },
+    appId() {
+      return this.$route.query.appId
     }
+  },
+  created() {
+    this.getSignupAddress()
   },
   async mounted() {
     this.currentTimeText = this.$dayjs().format('HH:mm')
   },
   methods: {
+    getSignupAddress() {
+      const params = { applicationId: this.appId }
+      this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
+        if (res.data.code == 0) {
+          const resData = res.data.data || {}
+          // this.centerPoint = {
+          //   lat: resData.examSite?.locationLat,
+          //   lng: resData.examSite?.locationLng
+          // }
+          this.positionAddress = resData.examSite?.address
+        } else {
+          this.$message.error(res.data.msg)
+        }
+      })
+    },
     getUserPositionStatus(evt) {
       this.userPositionStatus = evt
+    },
+    getDistance(evt) {
+      this.distance = evt
+      if (this.distance && this.distance <= 500) {
+        this.positionError = false
+      } else {
+        this.positionError = true
+      }
+    },
+    signinConfirm() {
+      if (!this.canSignup) {
+        return
+      }
+      this.$message.success('绛惧埌鎴愬姛')
+      localStorage.setItem('isSignup', true)
+      setTimeout(() => {
+        if (this.getIsFace()) {
+          this.$router.replace({ path: '/h5/face', query: { appId: this.appId }})
+        } else {
+          this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
+        }
+      }, 500)
+    },
+    getIsFace() {
+      return Boolean(localStorage.getItem('isFace'))
     }
   }
 }
 </script>
 <style lang="scss" scoped>
 .signin {
-  height: 100%;
+  height: 100vh;
   display: flex;
   flex-direction: column;
   justify-content: space-between;

--
Gitblit v1.8.0