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