修改点击立即跳转重复跳转问题
This commit is contained in:
@@ -77,6 +77,8 @@ import { ref } from 'vue';
|
|||||||
// 当前引导步骤(0/1/2)
|
// 当前引导步骤(0/1/2)
|
||||||
const currentStep = ref(0);
|
const currentStep = ref(0);
|
||||||
const mode = ref("default")
|
const mode = ref("default")
|
||||||
|
// 防重复跳转锁
|
||||||
|
const isNavigating = ref(false)
|
||||||
|
|
||||||
// ========== 方法 ==========
|
// ========== 方法 ==========
|
||||||
// 滑动swiper切换步骤
|
// 滑动swiper切换步骤
|
||||||
@@ -90,11 +92,14 @@ const handleBtnClick = () => {
|
|||||||
if (currentStep.value < 2) {
|
if (currentStep.value < 2) {
|
||||||
currentStep.value++;
|
currentStep.value++;
|
||||||
} else {
|
} else {
|
||||||
|
// 防重复跳转:已触发过跳转则直接返回
|
||||||
|
if (isNavigating.value) return;
|
||||||
|
isNavigating.value = true;
|
||||||
// 立即体验,跳转首页
|
// 立即体验,跳转首页
|
||||||
// 1. 记录引导已完成
|
// 1. 记录引导已完成
|
||||||
uni.setStorageSync('hasShowGuide', true);
|
uni.setStorageSync('hasShowGuide', true);
|
||||||
// 2. 跳转首页
|
// 2. 跳转首页
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url: "/pageSubPack/loginSub/pwd-login"
|
url: "/pageSubPack/loginSub/pwd-login"
|
||||||
})
|
})
|
||||||
// uni.switchTab({
|
// uni.switchTab({
|
||||||
|
|||||||
Reference in New Issue
Block a user