const tabBarUrls = [ 'sending/sending', 'search/search', 'mine/mine' ] const goto = (url, type = 1)=> { url = `/pages/${url}` if(tabBarUrls.indexOf(url) > -1) { return uni.switchTab({ url }); } if (type == 1){ uni.navigateTo({ url }); } else { uni.redirectTo({ url }); } } const goBack = (opt = {})=> { uni.navigateBack(opt) } const reLaunch = (opt = {})=> { uni.reLaunch(opt) } export { reLaunch, goto, goBack }