From 63fea2990e587837ed3dde2b9ac8f2b4ef729672 Mon Sep 17 00:00:00 2001
From: yearning <10538594+wangweifeng1999@user.noreply.gitee.com>
Date: 星期四, 28 五月 2026 10:02:01 +0800
Subject: [PATCH] 考点核验+签到
---
src/views/h5/map/index.vue | 63 +++++++++++++++++++++----------
1 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/src/views/h5/signup/index.vue b/src/views/h5/map/index.vue
similarity index 76%
rename from src/views/h5/signup/index.vue
rename to src/views/h5/map/index.vue
index f80cf0c..ded16a6 100644
--- a/src/views/h5/signup/index.vue
+++ b/src/views/h5/map/index.vue
@@ -11,7 +11,8 @@
<div class="mapBox">
<BaiduMap
:center="centerPoint"
- @getUserPositionStatus="(evt) => userPositionStatus = evt"
+ :limitDistanceFlag="limitDistanceFlag"
+ @getUserPositionStatus="getUserPositionStatus"
@getMapStatus="(evt) => mapStatus = evt"
@getDistance="getDistance"
/>
@@ -20,19 +21,21 @@
<el-image
style="width: 50px;height: 50px;"
fit="contain"
- :src="$getImageUrl(`/map/position-marker-${positionError?'red':'green'}.png`)"
+ :src="$getImageUrl(`/map/position-marker-${limitDistanceFlag&&positionError?'red':'green'}.png`)"
></el-image>
</div>
<div class="text-sign">
<el-text style="color: #8c8c8c;" v-if="userPositionStatus=='loading'">瀹氫綅涓�...</el-text>
- <el-text style="color: #e73f3f;" v-else-if="userPositionStatus=='fail'">鑾峰彇瀹氫綅澶辫触锛屽綋鍓嶈澶囩殑瀹氫綅鏈嶅姟</el-text>
+ <el-text style="color: #e73f3f;" v-else-if="userPositionStatus=='fail'">鑾峰彇瀹氫綅澶辫触锛岃妫�鏌ュ綋鍓嶈澶囩殑瀹氫綅鏈嶅姟</el-text>
<template v-else-if="userPositionStatus=='success'">
- <el-text v-if="distance>0&&distance<500" style="color: #56c16d;">
- 浣嶇疆姝e父 璺濈绛惧埌鍦扮偣{{ distance }}绫�
- </el-text>
- <el-text v-else style="color: #e73f3f;">
- 瓒呭嚭绛惧埌鑼冨洿锛屼笉鍙鍒�
- </el-text>
+ <template v-if="limitDistanceFlag">
+ <el-text v-if="distance>0&&distance<500" style="color: #56c16d;">
+ 浣嶇疆姝e父 璺濈绛惧埌鍦扮偣{{ distance }}绫�
+ </el-text>
+ <el-text v-else style="color: #e73f3f;">
+ 瓒呭嚭绛惧埌鑼冨洿锛屼笉鍙鍒�
+ </el-text>
+ </template>
</template>
</div>
</div>
@@ -40,8 +43,8 @@
<!-- <el-row justify="center">
<el-text class="text-lg font-bold">{{ positionName }}</el-text>
</el-row> -->
- <el-row justify="center" class="mt-1">
- <el-text class="text-lg text-info">{{ positionAddress }}</el-text>
+ <el-row justify="center" class="mt-7">
+ <el-text class="text-lg text-info" style="text-align: center;">{{ positionAddress }}</el-text>
</el-row>
</div>
<el-row justify="center" class="mt-7">
@@ -59,7 +62,7 @@
</template>
<script>
-import BaiduMap from '@/views/h5/signup/BaiduMap.vue'
+import BaiduMap from '@/views/h5/map/BaiduMap.vue'
import { useSessionStore } from '@/stores/session.js'
import { storeToRefs } from 'pinia';
export default {
@@ -83,7 +86,9 @@
lat: 23.135618,
lng: 113.27077
},
- clickCount: 0
+ clickCount: 0,
+ personType: 0,
+ limitDistanceFlag: false
}
},
computed: {
@@ -111,13 +116,20 @@
}
},
created() {
- this.getSignupAddress()
+ const type = localStorage.getItem('_personType')
+ this.personType = Number(type)
+ if (this.personType == 2) {
+ this.limitDistanceFlag = true
+ this.getVerifyAddress()
+ } else {
+ this.limitDistanceFlag = false
+ }
},
async mounted() {
this.currentTimeText = this.$dayjs().format('HH:mm')
},
methods: {
- getSignupAddress() {
+ getVerifyAddress() {
const params = { applicationId: this.appId }
this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
if (res.data.code == 0) {
@@ -135,7 +147,8 @@
})
},
getUserPositionStatus(evt) {
- this.userPositionStatus = evt
+ this.userPositionStatus = evt.status
+ this.positionAddress = evt.userPositionText
},
getDistance(evt) {
this.distance = evt
@@ -152,19 +165,27 @@
return
}
}
- const data = {
+ let data = {
targetId: this.appId,
- targetType: 2,
+ targetType: this.personType,
url: this.url,
- type: 0
+ type: this.url ? 0 : 2
}
this.confirmLoading = true
this.$axios.post('/exam/staff/checkin', data).then(res => {
if (res.data.code == 0) {
- this.$message.success('绛惧埌鎴愬姛')
setTimeout(() => {
- this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
+ if (data.targetType == 2) {
+ this.$message.success('绛惧埌鎴愬姛')
+ this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
+ } else {
+ this.$router.replace({ path: '/h5/signInSuccess', query: {
+ timeText: this.$dayjs().format('HH:mm:ss'),
+ address: this.positionAddress
+ }})
+ }
}, 500)
+
} else {
this.$message.error(res.data.msg)
}
--
Gitblit v1.8.0