|
|
@@ -1,34 +1,36 @@
|
|
|
<template>
|
|
|
- <view class="page-wrapper">
|
|
|
- <match-media :min-width="991" v-if="!isLoginPage">
|
|
|
+ <view :class="['page-wrapper', { dark: isDark }]">
|
|
|
+ <cwg-match-media :min-width="991" v-if="!isLoginPage">
|
|
|
<view class="left-sidebar">
|
|
|
<cwg-sidebar />
|
|
|
- <cwg-submenu v-if="sidebarVisible" :items="submenuItems" @submenu-click="onSubmenuClick" />
|
|
|
+ <cwg-submenu v-if="sidebarVisible" @submenu-click="onSubmenuClick" />
|
|
|
</view>
|
|
|
- </match-media>
|
|
|
+ </cwg-match-media>
|
|
|
<cwg-progress />
|
|
|
<view class="page-content">
|
|
|
- <match-media :min-width="991" v-if="!isLoginPage">
|
|
|
+ <cwg-match-media :min-width="991" v-if="!isLoginPage">
|
|
|
<cwg-pc-header @toggle-sidebar="toggleSidebar" />
|
|
|
- </match-media>
|
|
|
- <match-media :max-width="991">
|
|
|
+ </cwg-match-media>
|
|
|
+ <cwg-match-media :max-width="991">
|
|
|
<cwg-header v-if="!isHeaderFixed" />
|
|
|
- </match-media>
|
|
|
+ </cwg-match-media>
|
|
|
<view class="content-wrapper">
|
|
|
<slot />
|
|
|
</view>
|
|
|
<view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
|
|
|
</view>
|
|
|
- <match-media :max-width="991">
|
|
|
+ <cwg-match-media :max-width="991">
|
|
|
<cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
|
|
|
- </match-media>
|
|
|
+ </cwg-match-media>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from "vue";
|
|
|
+import { ref, watch, computed } from "vue";
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
|
import { updateRoute } from '@/hooks/useRoute'
|
|
|
+import useGlobalStore from '@/stores/use-global-store'
|
|
|
+const globalStore = useGlobalStore()
|
|
|
interface MenuItem {
|
|
|
key: string;
|
|
|
label: string;
|
|
|
@@ -37,27 +39,21 @@ interface MenuItem {
|
|
|
}
|
|
|
|
|
|
const props = defineProps({
|
|
|
+ // 是否固定顶部导航栏
|
|
|
isHeaderFixed: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
+ // 是否登录页,登录页不显示侧边栏和顶部导航,注册忘记密码等页面
|
|
|
isLoginPage: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
}
|
|
|
})
|
|
|
+const isDark = computed(() => globalStore.theme === 'dark')
|
|
|
const isTabBarPage = ref(false)
|
|
|
-const submenuItems = ref<MenuItem[]>([{ key: 'client', label: 'Client Zone', icon: 'icon-client' },
|
|
|
-{ key: 'promotion', label: 'Promotion Center', icon: 'icon-promotion' },
|
|
|
-{ key: 'deposit', label: 'Deposit', icon: 'icon-deposit' },
|
|
|
-{ key: 'withdrawal', label: 'Withdrawal', icon: 'icon-withdrawal' },
|
|
|
-{ key: 'payment', label: 'Payment History', icon: 'icon-payment' },
|
|
|
-{ key: 'transfer', label: 'Internal Transfer', icon: 'icon-transfer' },
|
|
|
-{ key: 'application', label: 'Application History', icon: 'icon-application' },
|
|
|
-{ key: 'ib', label: 'IB Zone', icon: 'icon-ib' },
|
|
|
-{ key: 'copy', label: 'Copy Trading', icon: 'icon-copy' },
|
|
|
-{ key: 'platform', label: 'Trading Platform', icon: 'icon-platform' },
|
|
|
-{ key: 'chat', label: 'Online Chat', icon: 'icon-chat' },])
|
|
|
+
|
|
|
+
|
|
|
const sidebarVisible = ref(true)
|
|
|
|
|
|
function toggleSidebar() {
|