diff --git a/admin/src/components/link/index.ts b/admin/src/components/link/index.ts index bca179fb..58f3673e 100644 --- a/admin/src/components/link/index.ts +++ b/admin/src/components/link/index.ts @@ -7,6 +7,5 @@ export interface Link { path: string name?: string type: string - isTab: boolean query?: Record } diff --git a/admin/src/components/link/picker.vue b/admin/src/components/link/picker.vue index 83fe6c06..a486e1e3 100644 --- a/admin/src/components/link/picker.vue +++ b/admin/src/components/link/picker.vue @@ -1,14 +1,18 @@ diff --git a/app/src/pages/news/news.vue b/app/src/pages/news/news.vue index 698d6c9c..8c8f7752 100644 --- a/app/src/pages/news/news.vue +++ b/app/src/pages/news/news.vue @@ -19,6 +19,7 @@ + diff --git a/app/src/pages/user/user.vue b/app/src/pages/user/user.vue index e113a393..bf1fd9a5 100644 --- a/app/src/pages/user/user.vue +++ b/app/src/pages/user/user.vue @@ -16,6 +16,7 @@ + diff --git a/app/src/stores/app.ts b/app/src/stores/app.ts index 105483aa..822f055c 100644 --- a/app/src/stores/app.ts +++ b/app/src/stores/app.ts @@ -9,16 +9,16 @@ export const useAppStore = defineStore({ state: (): AppSate => ({ config: { website: {}, - login: {} + login: {}, + tabbar: [], + style: {} } }), getters: { - getWebsiteConfig(state) { - return state.config.website - }, - getLoginConfig(state) { - return state.config.login - } + getWebsiteConfig: (state) => state.config.website, + getLoginConfig: (state) => state.config.login, + getTabbarConfig: (state) => state.config.tabbar, + getStyleConfig: (state) => state.config.style }, actions: { getImageUrl(url: string) { diff --git a/app/src/utils/util.ts b/app/src/utils/util.ts index 1bfe679f..4653ebf4 100644 --- a/app/src/utils/util.ts +++ b/app/src/utils/util.ts @@ -28,7 +28,6 @@ export const getRect = (selector: string, all = false, context?: any) => { } /** -<<<<<<< HEAD * @description 获取当前页面实例 */ export function currentPage() { @@ -52,19 +51,16 @@ export enum LinkTypeEnum { 'SHOP_PAGES' = 'shop', 'CUSTOM_LINK' = 'custom' } -export function navigateTo(link: Link) { + +export function navigateTo(link: Link, navigateType: 'navigateTo' | 'reLaunch' = 'navigateTo') { let url: string switch (link.type) { case LinkTypeEnum.SHOP_PAGES: url = link.query ? `${link.path}?${objectToQuery(link.query)}` : link.path - if (link.isTab) { - uni.switchTab({ url }) - } else { - uni.navigateTo({ url }) - } + uni[navigateType]({ url }) break case LinkTypeEnum.CUSTOM_LINK: - uni.navigateTo({ url: `/pages/webview/webview?url=${link.path}` }) + uni[navigateType]({ url: `/pages/webview/webview?url=${link.path}` }) } }