You need to sign in or sign up before continuing.
hookehuyr

登录跳转逻辑优化

1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-21 16:05:43 4 + * @LastEditTime: 2023-12-21 16:28:56
5 * @FilePath: /meihuaApp/src/pages/detail/index.vue 5 * @FilePath: /meihuaApp/src/pages/detail/index.vue
6 * @Description: 房间详情页面 6 * @Description: 房间详情页面
7 --> 7 -->
...@@ -153,7 +153,7 @@ const goToConfirm = () => { ...@@ -153,7 +153,7 @@ const goToConfirm = () => {
153 }); 153 });
154 } else { 154 } else {
155 Taro.navigateTo({ 155 Taro.navigateTo({
156 - url: `/pages/login/index`, 156 + url: `/pages/login/index?page=detail`,
157 }); 157 });
158 } 158 }
159 } 159 }
......
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-20 10:25:15 4 + * @LastEditTime: 2023-12-21 16:45:56
5 * @FilePath: /meihuaApp/src/pages/login/index.vue 5 * @FilePath: /meihuaApp/src/pages/login/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
43 import Taro from '@tarojs/taro' 43 import Taro from '@tarojs/taro'
44 import { IconFont } from '@nutui/icons-vue-taro'; 44 import { IconFont } from '@nutui/icons-vue-taro';
45 import { ref, nextTick } from "vue"; 45 import { ref, nextTick } from "vue";
46 +import { getCurrentPageParam } from "@/utils/weapp";
46 47
47 let countdownIntervalId; // 用于存储倒计时的计时器 ID 48 let countdownIntervalId; // 用于存储倒计时的计时器 ID
48 49
...@@ -119,9 +120,17 @@ const login = () => { ...@@ -119,9 +120,17 @@ const login = () => {
119 duration: 2000, 120 duration: 2000,
120 success: () => { 121 success: () => {
121 setTimeout(() => { 122 setTimeout(() => {
122 - Taro.reLaunch({ 123 + let params = getCurrentPageParam();
123 - url: '/pages/index/index' 124 + if (params.page === 'detail') { // 详情页
124 - }) 125 + Taro.navigateBack({
126 + delta: 1
127 + });
128 + }
129 + if (params.page === 'my') { // 登录页
130 + Taro.redirectTo({
131 + url: '/pages/myInfo/index'
132 + });
133 + }
125 }, 1000); 134 }, 1000);
126 } 135 }
127 }); 136 });
......
1 <!-- 1 <!--
2 * @Date: 2023-12-13 11:13:13 2 * @Date: 2023-12-13 11:13:13
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-21 16:03:09 4 + * @LastEditTime: 2023-12-21 16:34:26
5 * @FilePath: /meihuaApp/src/pages/my/index.vue 5 * @FilePath: /meihuaApp/src/pages/my/index.vue
6 * @Description: 我的页面 6 * @Description: 我的页面
7 --> 7 -->
...@@ -127,7 +127,7 @@ const goToEdit = () => { ...@@ -127,7 +127,7 @@ const goToEdit = () => {
127 }); 127 });
128 } else { 128 } else {
129 Taro.navigateTo({ 129 Taro.navigateTo({
130 - url: '/pages/login/index', 130 + url: '/pages/login/index?page=my',
131 }); 131 });
132 } 132 }
133 } 133 }
......