| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <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 />
- <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 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()
- })
- onShow(() => {
- updateRoute()
- })
- </script>
- <style lang="scss" scoped>
- @import "@/uni.scss";
- .page-wrapper {
- 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;
- overflow-y: auto;
- }
- </style>
|