1. 保留当前页面,可跳转到非 tabBar 页面,使用uni.navigateBack可以返回到原页面(可传参)
uni.navigateTo({
url: 'test?id=1&name=uniapp'
});
2. 关闭当前页面,跳转到应用内的某个页面。不可打开tabbar页面 (可传参)
uni.redirectTo({
url: 'test?id=1'
});
3. 关闭所有页面,打开到应用内的某个页面。可打开tabbar页面(可传参)
//页面会全部出栈,只留下新的页面
uni.reLaunch({
url: 'test?id=1'
});
4. 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。(不可传参)
uni.switchTab({
url: '/pages/index/index'
});