yfs/common/gotopage.js
2025-03-14 11:01:58 +08:00

55 lines
983 B
JavaScript

// import config from '../config.js'
/*导航菜单白名单*/
const tabBarLinks = [
'/pages/index/index',
'/pages/product/category',
'/pages/cart/cart',
'/pages/user/index/index',
'/pages/shop/index'
];
/*分享页面白名单*/
const shareLinks = [
'/pages/plus/assemble/fight-group-detail/fight-group-detail',
'/pages/plus/bargain/haggle/haggle',
'/pages/user/invite/invite',
'/pages/product/detail/detail',
'/pages/plus/seckill/detail/detail',
'/pages/plus/assemble/detail/detail',
'/pages/plus/bargain/detail/detail',
'/pages/plus/points/detail/detail'
]
/*
* 跳转页面
*/
export const gotopage = (url, type) => {
if (!url || url.length == 0) {
return false;
}
// tabBar页面
if (type == 'switch') {
uni.reLaunch({
url: url
});
} else {
if(type == 'redirect'){
uni.redirectTo({
url: url
});
}
if(type == 'reLaunch'){
uni.reLaunch({
url: url
});
}
// 普通页面
uni.navigateTo({
url: url
});
}
}