feat(打卡): 扩大打卡范围至5公里并优化定位提示
调整打卡距离限制从1公里到5公里以提供更灵活的范围 移除未使用的定位按钮组件,改为直接使用路由参数获取位置 更新定位提示文字为"请先获取定位权限"更准确
Showing
2 changed files
with
16 additions
and
10 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-09-15 22:08:49 | 2 | * @Date: 2024-09-15 22:08:49 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-28 13:35:08 | 4 | + * @LastEditTime: 2025-08-28 15:22:23 |
| 5 | * @FilePath: /map-demo/src/views/checkin/info.vue | 5 | * @FilePath: /map-demo/src/views/checkin/info.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -503,7 +503,8 @@ const onStatusAudioList = (status) => { // 音频列表组件,状态改变 | ... | @@ -503,7 +503,8 @@ const onStatusAudioList = (status) => { // 音频列表组件,状态改变 |
| 503 | const checkInRange = (current_lng, current_lat, point_range) => { | 503 | const checkInRange = (current_lng, current_lat, point_range) => { |
| 504 | if (!point_range) return false; | 504 | if (!point_range) return false; |
| 505 | let distance = AMap.GeometryUtil.distance([current_lng, current_lat], point_range); | 505 | let distance = AMap.GeometryUtil.distance([current_lng, current_lat], point_range); |
| 506 | - return distance < 1000; | 506 | + // 5km范围内可以打卡 |
| 507 | + return distance < 5000; | ||
| 507 | } | 508 | } |
| 508 | 509 | ||
| 509 | 510 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-05-19 14:54:27 | 2 | * @Date: 2023-05-19 14:54:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-27 23:07:35 | 4 | + * @LastEditTime: 2025-08-28 15:21:10 |
| 5 | * @FilePath: /map-demo/src/views/checkin/map.vue | 5 | * @FilePath: /map-demo/src/views/checkin/map.vue |
| 6 | * @Description: 公众地图主体页面 | 6 | * @Description: 公众地图主体页面 |
| 7 | --> | 7 | --> |
| ... | @@ -61,14 +61,14 @@ | ... | @@ -61,14 +61,14 @@ |
| 61 | 关闭步行导航 | 61 | 关闭步行导航 |
| 62 | </div> | 62 | </div> |
| 63 | 63 | ||
| 64 | - <van-dialog v-model:show="dialog_show" title="温馨提示"> | 64 | + <van-dialog v-model:show="dialog_show" title="温馨提示" confirm-button-text="知道了"> |
| 65 | <div style="padding: 1rem; text-align: center;">{{ dialog_text }}</div> | 65 | <div style="padding: 1rem; text-align: center;">{{ dialog_text }}</div> |
| 66 | </van-dialog> | 66 | </van-dialog> |
| 67 | 67 | ||
| 68 | <!-- 背景音乐控制 --> | 68 | <!-- 背景音乐控制 --> |
| 69 | <!-- <audioBackground1></audioBackground1> --> | 69 | <!-- <audioBackground1></audioBackground1> --> |
| 70 | 70 | ||
| 71 | - <div class="operate-bar-wrapper"> | 71 | + <!-- <div class="operate-bar-wrapper"> |
| 72 | <div class="box-wrapper"> | 72 | <div class="box-wrapper"> |
| 73 | <div v-if="open_current_location" class="item" @click="handleLocation(true)"> | 73 | <div v-if="open_current_location" class="item" @click="handleLocation(true)"> |
| 74 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" | 74 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" |
| ... | @@ -79,7 +79,7 @@ | ... | @@ -79,7 +79,7 @@ |
| 79 | style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" /> | 79 | style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" /> |
| 80 | </div> | 80 | </div> |
| 81 | </div> | 81 | </div> |
| 82 | - </div> | 82 | + </div> --> |
| 83 | 83 | ||
| 84 | <van-toast v-model:show="show_toast" style="padding: 0"> | 84 | <van-toast v-model:show="show_toast" style="padding: 0"> |
| 85 | <template #message> | 85 | <template #message> |
| ... | @@ -307,6 +307,7 @@ export default { | ... | @@ -307,6 +307,7 @@ export default { |
| 307 | [117.044223,26.835105], [117.044227,26.842448], [117.0552,26.842452], [117.055195,26.8351] | 307 | [117.044223,26.835105], [117.044227,26.842448], [117.0552,26.842452], [117.055195,26.8351] |
| 308 | ], | 308 | ], |
| 309 | walking: '', | 309 | walking: '', |
| 310 | + is_get_location: false, | ||
| 310 | } | 311 | } |
| 311 | }, | 312 | }, |
| 312 | async mounted() { | 313 | async mounted() { |
| ... | @@ -505,15 +506,17 @@ export default { | ... | @@ -505,15 +506,17 @@ export default { |
| 505 | this.itemInfo = updatedInfo; | 506 | this.itemInfo = updatedInfo; |
| 506 | 507 | ||
| 507 | // 写入用户经纬度 | 508 | // 写入用户经纬度 |
| 508 | - if (this.current_lng && this.current_lat) { | 509 | + const current_lng = this.$route.query?.current_lng || ''; |
| 509 | - this.itemInfo.current_lng = this.current_lng; | 510 | + const current_lat = this.$route.query?.current_lat || ''; |
| 510 | - this.itemInfo.current_lat = this.current_lat; | 511 | + if (current_lng && current_lat) { |
| 512 | + this.itemInfo.current_lng = current_lng; | ||
| 513 | + this.itemInfo.current_lat = current_lat; | ||
| 511 | } else { | 514 | } else { |
| 512 | this.itemInfo.current_lng = ''; | 515 | this.itemInfo.current_lng = ''; |
| 513 | this.itemInfo.current_lat = ''; | 516 | this.itemInfo.current_lat = ''; |
| 514 | // 提示用户获取定位 | 517 | // 提示用户获取定位 |
| 515 | this.show_toast = true; | 518 | this.show_toast = true; |
| 516 | - this.toast_text = '请先点击左侧按钮获取定位' | 519 | + this.toast_text = '请先获取定位权限' |
| 517 | } | 520 | } |
| 518 | 521 | ||
| 519 | // 详情为空提示 | 522 | // 详情为空提示 |
| ... | @@ -686,6 +689,8 @@ export default { | ... | @@ -686,6 +689,8 @@ export default { |
| 686 | // 提示获取经纬度成功 | 689 | // 提示获取经纬度成功 |
| 687 | this.show_toast = true; | 690 | this.show_toast = true; |
| 688 | this.toast_text = '获取经纬度成功'; | 691 | this.toast_text = '获取经纬度成功'; |
| 692 | + // | ||
| 693 | + this.is_get_location = true; | ||
| 689 | // } | 694 | // } |
| 690 | }, | 695 | }, |
| 691 | complete: () => { | 696 | complete: () => { | ... | ... |
-
Please register or login to post a comment