diff --git a/src/platforms/app-plus/service/api/util.js b/src/platforms/app-plus/service/api/util.js index 2ee4b79f37c2a79a43ebe866abcaf68ee8d3d2b4..e6221cfbfe4f39ad7831f72ece98aaea3a9c9fa4 100644 --- a/src/platforms/app-plus/service/api/util.js +++ b/src/platforms/app-plus/service/api/util.js @@ -1,3 +1,7 @@ +export { + isTabBarPage +} from '../bridge' + export function callApiSync (api, args, name, alias) { const ret = api(args) if (ret && ret.errMsg) { @@ -19,31 +23,6 @@ export function getLastWebview () { } } -export function isTabBarPage (path = '') { - if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) { - return false - } - try { - if (!path) { - const pages = getCurrentPages() - if (!pages.length) { - return false - } - const page = pages[pages.length - 1] - if (!page) { - return false - } - return page.$page.meta.isTabBar - } - return __uniRoutes.find(route => route.path === path).meta.isTabBar - } catch (e) { - if (process.env.NODE_ENV !== 'production') { - console.log('getCurrentPages is not ready') - } - } - return false -} - const getRealRoute = (e, t) => { if (t.indexOf('./') === 0) return getRealRoute(e, t.substr(2), !1) let n diff --git a/src/platforms/app-plus/service/bridge.js b/src/platforms/app-plus/service/bridge.js index ae41b48500bad0c192f88e92be4cffd1971d08af..917bc07fb3cc67223f397a8c4a41d69c720638ab 100644 --- a/src/platforms/app-plus/service/bridge.js +++ b/src/platforms/app-plus/service/bridge.js @@ -37,3 +37,28 @@ export function setStatusBarStyle (statusBarStyle) { plus.navigator.setStatusBarStyle(statusBarStyle) } + +export function isTabBarPage (path = '') { + if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) { + return false + } + try { + if (!path) { + const pages = getCurrentPages() + if (!pages.length) { + return false + } + const page = pages[pages.length - 1] + if (!page) { + return false + } + return page.$page.meta.isTabBar + } + return __uniRoutes.find(route => route.path === path).meta.isTabBar + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + console.log('getCurrentPages is not ready') + } + } + return false +}