修复二次重复返回的bug

This commit is contained in:
WindowBird 2025-10-17 17:38:09 +08:00
parent 3ceca28094
commit a1a23e2231
2 changed files with 8 additions and 14 deletions

View File

@ -117,6 +117,12 @@ export default {
//
uni.navigateBack({
delta: 1,
fail: () => {
//
uni.reLaunch({
url: "/pages/index/index", //
});
},
});
}
},

View File

@ -2,11 +2,7 @@
<view class="page">
<base-background />
<!-- 使用自定义导航栏组件 -->
<custom-navbar
ref="customNavbar"
title="往生大殿"
@back="handleNavbarBack"
/>
<custom-navbar ref="customNavbar" title="往生大殿" />
<view class="header">
<!-- 搜索框 -->
<search-box
@ -22,7 +18,7 @@
<!-- 顶部信息 -->
<view class="memorial-header">
<view class="location"
>{{ memorialDetail ? memorialDetail.name : "加载中..." }}
>{{ memorialDetail ? memorialDetail.code : "加载中..." }}
</view>
<view
:class="['collection-btn', { collected: isCollected }]"
@ -152,7 +148,6 @@ import OfferingModal from "./compositons/offeringModal.vue";
import { getIdBySN, getPackageList } from "../../api/memorial/memorial";
import { ordersEnshrined } from "../../api/order/order";
import { checkLogin } from "../../composables/goToLogin";
import { navigateBack } from "../../utils/router.js";
export default {
components: {
@ -507,13 +502,6 @@ export default {
console.log("滚动位置:", e.detail.scrollTop);
this.scrollTop = e.detail.scrollTop;
},
//
handleNavbarBack() {
console.log("@@@@@如果没有上一页会自动跳转到首页");
// 使
navigateBack();
},
},
};
</script>