hookehuyr

feat(打卡): 扩大打卡范围至5公里并优化定位提示

调整打卡距离限制从1公里到5公里以提供更灵活的范围
移除未使用的定位按钮组件,改为直接使用路由参数获取位置
更新定位提示文字为"请先获取定位权限"更准确
<!--
* @Date: 2024-09-15 22:08:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-08-28 13:35:08
* @LastEditTime: 2025-08-28 15:22:23
* @FilePath: /map-demo/src/views/checkin/info.vue
* @Description: 文件描述
-->
......@@ -503,7 +503,8 @@ const onStatusAudioList = (status) => { // 音频列表组件,状态改变
const checkInRange = (current_lng, current_lat, point_range) => {
if (!point_range) return false;
let distance = AMap.GeometryUtil.distance([current_lng, current_lat], point_range);
return distance < 1000;
// 5km范围内可以打卡
return distance < 5000;
}
......
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-08-27 23:07:35
* @LastEditTime: 2025-08-28 15:21:10
* @FilePath: /map-demo/src/views/checkin/map.vue
* @Description: 公众地图主体页面
-->
......@@ -61,14 +61,14 @@
关闭步行导航
</div>
<van-dialog v-model:show="dialog_show" title="温馨提示">
<van-dialog v-model:show="dialog_show" title="温馨提示" confirm-button-text="知道了">
<div style="padding: 1rem; text-align: center;">{{ dialog_text }}</div>
</van-dialog>
<!-- 背景音乐控制 -->
<!-- <audioBackground1></audioBackground1> -->
<div class="operate-bar-wrapper">
<!-- <div class="operate-bar-wrapper">
<div class="box-wrapper">
<div v-if="open_current_location" class="item" @click="handleLocation(true)">
<van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem"
......@@ -79,7 +79,7 @@
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" />
</div>
</div>
</div>
</div> -->
<van-toast v-model:show="show_toast" style="padding: 0">
<template #message>
......@@ -307,6 +307,7 @@ export default {
[117.044223,26.835105], [117.044227,26.842448], [117.0552,26.842452], [117.055195,26.8351]
],
walking: '',
is_get_location: false,
}
},
async mounted() {
......@@ -505,15 +506,17 @@ export default {
this.itemInfo = updatedInfo;
// 写入用户经纬度
if (this.current_lng && this.current_lat) {
this.itemInfo.current_lng = this.current_lng;
this.itemInfo.current_lat = this.current_lat;
const current_lng = this.$route.query?.current_lng || '';
const current_lat = this.$route.query?.current_lat || '';
if (current_lng && current_lat) {
this.itemInfo.current_lng = current_lng;
this.itemInfo.current_lat = current_lat;
} else {
this.itemInfo.current_lng = '';
this.itemInfo.current_lat = '';
// 提示用户获取定位
this.show_toast = true;
this.toast_text = '请先点击左侧按钮获取定位'
this.toast_text = '请先获取定位权限'
}
// 详情为空提示
......@@ -686,6 +689,8 @@ export default {
// 提示获取经纬度成功
this.show_toast = true;
this.toast_text = '获取经纬度成功';
//
this.is_get_location = true;
// }
},
complete: () => {
......