修复跳转问题

This commit is contained in:
hupeng
2023-12-28 10:34:53 +08:00
parent 6f4f3ef17b
commit e69d31e5ad

View File

@ -69,14 +69,23 @@ export default {
let redirect = cookie.get('redirect').replace(/\ /g, '')
cookie.remove('redirect')
if (redirect && redirect.indexOf('/pages') != -1) {
uni.showToast({
title: '/pages' + redirect.split('/pages')[1],
icon: 'none',
duration: 2000,
})
this.$yrouter.replace({
path: '/pages' + redirect.split('/pages')[1],
})
// uni.showToast({
// title: '/pages' + redirect.split('/pages')[1],
// icon: 'none',
// duration: 2000,
// })
//此处跳转tab 得判断
let pathUrl = '/pages' + redirect.split('/pages')[1]
if(pathUrl == '/pages/home/index' || pathUrl == '/pages/shop/GoodsClass/index' || pathUrl == '/pages/shop/ShoppingCart/index' || pathUrl == '/pages/user/User/index'){
this.$yrouter.switchTab({
path: pathUrl,
})
}else{
this.$yrouter.replace({
path: pathUrl,
})
}
} else {
this.$yrouter.switchTab({
path: '/pages/home/index',