|
@@ -10,13 +10,6 @@ export function getLastPage() {
|
|
|
return pages[pages.length - 1]
|
|
return pages[pages.length - 1]
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function isCurrentPageTabbar() {
|
|
|
|
|
- const lastPage = getLastPage()
|
|
|
|
|
- const currRoute = (lastPage as any).$page
|
|
|
|
|
- const { fullPath } = currRoute as { fullPath: string }
|
|
|
|
|
- return tabbarList.some(item => `/${item.path}` === fullPath)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取当前页面路由的 path 路径和 redirectPath 路径
|
|
* 获取当前页面路由的 path 路径和 redirectPath 路径
|
|
|
* path 如 '/pages/login/index'
|
|
* path 如 '/pages/login/index'
|
|
@@ -100,6 +93,23 @@ export function getAllPages(key = 'needLogin') {
|
|
|
return result
|
|
return result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+export function isCurrentPageTabbar() {
|
|
|
|
|
+ const routeObj = currRoute()
|
|
|
|
|
+ return tabbarList.some(item => `/${item.pagePath}` === routeObj.path)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function getCurrentPageI18nKey() {
|
|
|
|
|
+ const routeObj = currRoute()
|
|
|
|
|
+ const currPage = pages.find(page => `/${page.path}` === routeObj.path)
|
|
|
|
|
+ if (!currPage) {
|
|
|
|
|
+ console.warn('路由不正确')
|
|
|
|
|
+ return ''
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(currPage)
|
|
|
|
|
+ console.log(currPage.style.navigationBarTitleText)
|
|
|
|
|
+ return currPage.style.navigationBarTitleText
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 得到所有的需要登录的 pages,包括主包和分包的
|
|
* 得到所有的需要登录的 pages,包括主包和分包的
|
|
|
* 只得到 path 数组
|
|
* 只得到 path 数组
|