|
|
@@ -1,24 +1,69 @@
|
|
|
<template>
|
|
|
<view class="page-wrapper">
|
|
|
+ <match-media :min-width="991" v-if="!isLoginPage">
|
|
|
+ <view class="left-sidebar">
|
|
|
+ <cwg-sidebar />
|
|
|
+ <cwg-submenu v-if="sidebarVisible" :items="submenuItems" @submenu-click="onSubmenuClick" />
|
|
|
+ </view>
|
|
|
+ </match-media>
|
|
|
<cwg-progress />
|
|
|
- <cwg-header v-if="!isHeaderFixed" />
|
|
|
- <slot></slot>
|
|
|
- <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
|
|
|
- <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
|
|
|
+ <view class="page-content">
|
|
|
+ <match-media :min-width="991" v-if="!isLoginPage">
|
|
|
+ <cwg-pc-header @toggle-sidebar="toggleSidebar" />
|
|
|
+ </match-media>
|
|
|
+ <match-media :max-width="991">
|
|
|
+ <cwg-header v-if="!isHeaderFixed" />
|
|
|
+ </match-media>
|
|
|
+ <view class="content-wrapper">
|
|
|
+ <slot />
|
|
|
+ </view>
|
|
|
+ <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
|
|
|
+ </view>
|
|
|
+ <match-media :max-width="991">
|
|
|
+ <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
|
|
|
+ </match-media>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
+<script setup lang="ts">
|
|
|
import { ref } from "vue";
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
|
import { updateRoute } from '@/hooks/useRoute'
|
|
|
+interface MenuItem {
|
|
|
+ key: string;
|
|
|
+ label: string;
|
|
|
+ icon?: string;
|
|
|
+ children?: MenuItem[];
|
|
|
+}
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
isHeaderFixed: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ isLoginPage: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
})
|
|
|
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() {
|
|
|
+ sidebarVisible.value = !sidebarVisible.value;
|
|
|
+}
|
|
|
+
|
|
|
onLoad(() => {
|
|
|
updateRoute()
|
|
|
})
|
|
|
@@ -33,8 +78,27 @@ onShow(() => {
|
|
|
@import "@/uni.scss";
|
|
|
|
|
|
.page-wrapper {
|
|
|
- padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.left-sidebar {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+}
|
|
|
+
|
|
|
+.page-content {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.content-wrapper {
|
|
|
+ flex: 1;
|
|
|
+ // padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
|
|
|
box-sizing: border-box;
|
|
|
- border: 1px solid rgba(0, 0, 0, 0);
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
</style>
|