hookehuyr

fix: 修复打卡成功后跳转页面和移除返回按钮

主要是避免参数丢失

移除不再需要的返回按钮代码
将打卡成功后的页面跳转从reLaunch改为navigateTo以保留当前页面状态
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 17:35:19 4 + * @LastEditTime: 2025-08-29 17:20:18
5 * @FilePath: /map-demo/src/views/checkin/info.vue 5 * @FilePath: /map-demo/src/views/checkin/info.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 <div class="info-page"> 9 <div class="info-page">
10 <div class="info-header-wrapper"> 10 <div class="info-header-wrapper">
11 - <div v-if="showBack && page_details.banner?.length" style="position: absolute; top: 1rem; left: 0.5rem; z-index: 9;"> 11 + <!-- <div v-if="showBack && page_details.banner?.length" style="position: absolute; top: 1rem; left: 0.5rem; z-index: 9;">
12 <van-icon name="arrow-left" color="white" size="1.75rem" @click="goBack()" /> 12 <van-icon name="arrow-left" color="white" size="1.75rem" @click="goBack()" />
13 - </div> 13 + </div> -->
14 <van-config-provider :theme-vars="themeVars"> 14 <van-config-provider :theme-vars="themeVars">
15 <van-swipe class="my-swipe" indicator-color="#DD7850" lazy-render :autoplay="5000"> 15 <van-swipe class="my-swipe" indicator-color="#DD7850" lazy-render :autoplay="5000">
16 <van-swipe-item v-for="(image, index) in page_details.banner" :key="index" style="position: relative;"> 16 <van-swipe-item v-for="(image, index) in page_details.banner" :key="index" style="position: relative;">
...@@ -523,6 +523,16 @@ const checkIn = async () => { // 打卡 ...@@ -523,6 +523,16 @@ const checkIn = async () => { // 打卡
523 return; 523 return;
524 } 524 }
525 525
526 + // 提示打卡成功
527 + showDialog({
528 + title: '温馨提示',
529 + message: `恭喜您打卡成功`,
530 + confirmButtonText: '去上传图片',
531 + }).then(() => {
532 + // 后续上传图片页面
533 + wx.miniProgram.navigateTo({ url: '/pages/UploadMedia/index' });
534 + });
535 +
526 // 判断用户时候在范围内 536 // 判断用户时候在范围内
527 if (!checkInRange(page_details.value.current_lng, page_details.value.current_lat, page_details.value?.position)) { 537 if (!checkInRange(page_details.value.current_lng, page_details.value.current_lat, page_details.value?.position)) {
528 show_toast.value = true; 538 show_toast.value = true;
...@@ -541,7 +551,7 @@ const checkIn = async () => { // 打卡 ...@@ -541,7 +551,7 @@ const checkIn = async () => { // 打卡
541 confirmButtonText: '去上传图片', 551 confirmButtonText: '去上传图片',
542 }).then(() => { 552 }).then(() => {
543 // 后续上传图片页面 553 // 后续上传图片页面
544 - wx.miniProgram.reLaunch({ url: '/pages/UploadMedia/index' }); 554 + wx.miniProgram.navigateTo({ url: '/pages/UploadMedia/index' });
545 }); 555 });
546 } else { 556 } else {
547 show_toast.value = true; 557 show_toast.value = true;
......