| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <template>
- <header class="cwg-pc-header">
- <div class="left">
- <image class="left-img" src="/static/images/logo.png" mode="widthFix" alt="logo" @click="openLeftDrawer" />
- </div>
- <div class="right">
- <div class="lang-select">
- <image class="img flag" src="/static/flag-en.png" alt="en" />
- <text>English</text>
- <text class="arrow">▼</text>
- </div>
- <text class="icon sun" @click="toggleTheme">🌞</text>
- <text class="icon bell">🔔<text class="dot"></text></text>
- <text class="icon avatar">
- <image class="img" src="/static/avatar.png" alt="avatar" />
- </text>
- <text class="icon logo" @click="openRightDrawer">
- <image class="img" src="/static/logo.png" alt="logo" />
- </text>
- </div>
- </header>
- </template>
- <script setup lang="ts">
- // import useGlobalStore from '@/stores/use-global-store'
- // const globalStore = useGlobalStore()
- import useRouter from "@/hooks/useRouter";
- const router = useRouter();
- const props = defineProps({
- sidebarVisible: {
- type: Boolean,
- default: false
- },
- })
- const emit = defineEmits<{
- (e: 'open-right-drawer'): void
- }>()
- function toggleTheme() {
- // globalStore.setGlobalTheme(globalStore.theme === 'light' ? 'dark' : 'light');
- }
- function openRightDrawer() {
- emit('open-right-drawer');
- }
- function openLeftDrawer() {
- emit('open-left-drawer');
- }
- </script>
- <style scoped lang="scss">
- .cwg-pc-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: px2rpx(55);
- background-color: rgba(255, 255, 255, 0.9);
- border-bottom: 1px solid #f0f0f0;
- padding: 0 px2rpx(16);
- position: relative;
- z-index: 10;
- }
- .left {
- display: flex;
- align-items: center;
- }
- .back-arrow {
- color: #e74c3c;
- font-size: 22px;
- cursor: pointer;
- margin-right: 16px;
- }
- .center {
- flex: 1;
- }
- .right {
- display: flex;
- align-items: center;
- gap: 18px;
- }
- .lang-select {
- display: flex;
- align-items: center;
- background: #f5f7fa;
- border-radius: 18px;
- padding: 4px 12px;
- font-size: 14px;
- cursor: pointer;
- }
- .flag {
- width: 22px;
- height: 16px;
- margin-right: 6px;
- }
- .arrow {
- margin-left: 4px;
- font-size: 12px;
- }
- .icon {
- font-size: 20px;
- position: relative;
- cursor: pointer;
- }
- .bell .dot {
- position: absolute;
- top: 0;
- right: -2px;
- width: 7px;
- height: 7px;
- background: #27ae60;
- border-radius: 50%;
- display: inline-block;
- }
- .left-img {
- width: px2rpx(120);
- }
- .avatar .img {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- background: #eee;
- }
- .logo .img {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- background: #fff;
- }
- </style>
|