top-window.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <header class="cwg-pc-header">
  3. <div class="left">
  4. <image class="left-img" src="/static/images/logo.png" mode="widthFix" alt="logo" @click="openLeftDrawer" />
  5. </div>
  6. <div class="right">
  7. <LanguageDropdown />
  8. <!-- <text class="icon sun" @click="toggleTheme">🌞</text> -->
  9. <text class="icon bell">🔔<text class="dot"></text></text>
  10. <text class="icon avatar">
  11. <image class="img" src="/static/avatar.png" alt="avatar" />
  12. </text>
  13. <text class="icon logo" @click="openRightDrawer">
  14. <image class="img" src="/static/logo.png" alt="logo" />
  15. </text>
  16. </div>
  17. </header>
  18. </template>
  19. <script setup lang="ts">
  20. // import useGlobalStore from '@/stores/use-global-store'
  21. // const globalStore = useGlobalStore()
  22. import useRouter from "@/hooks/useRouter";
  23. import LanguageDropdown from "@/components/LanguageDropdown.vue";
  24. const router = useRouter();
  25. const props = defineProps({
  26. sidebarVisible: {
  27. type: Boolean,
  28. default: false
  29. },
  30. })
  31. const emit = defineEmits<{
  32. (e: 'open-right-drawer'): void
  33. }>()
  34. function toggleTheme() {
  35. // globalStore.setGlobalTheme(globalStore.theme === 'light' ? 'dark' : 'light');
  36. }
  37. function openRightDrawer() {
  38. emit('open-right-drawer');
  39. }
  40. function openLeftDrawer() {
  41. emit('open-left-drawer');
  42. }
  43. </script>
  44. <style scoped lang="scss">
  45. .cwg-pc-header {
  46. display: flex;
  47. align-items: center;
  48. justify-content: space-between;
  49. height: px2rpx(55);
  50. background-color: rgba(255, 255, 255, 0.9);
  51. border-bottom: 1px solid #f0f0f0;
  52. padding: 0 px2rpx(16);
  53. position: relative;
  54. z-index: 10;
  55. }
  56. .left {
  57. display: flex;
  58. align-items: center;
  59. }
  60. .back-arrow {
  61. color: #e74c3c;
  62. font-size: 22px;
  63. cursor: pointer;
  64. margin-right: 16px;
  65. }
  66. .center {
  67. flex: 1;
  68. }
  69. .right {
  70. display: flex;
  71. align-items: center;
  72. gap: 18px;
  73. }
  74. .lang-select {
  75. display: flex;
  76. align-items: center;
  77. background: #f5f7fa;
  78. border-radius: 18px;
  79. padding: 4px 12px;
  80. font-size: 14px;
  81. cursor: pointer;
  82. }
  83. .flag {
  84. width: 22px;
  85. height: 16px;
  86. margin-right: 6px;
  87. }
  88. .arrow {
  89. margin-left: 4px;
  90. font-size: 12px;
  91. }
  92. .icon {
  93. font-size: 20px;
  94. position: relative;
  95. cursor: pointer;
  96. }
  97. .bell .dot {
  98. position: absolute;
  99. top: 0;
  100. right: -2px;
  101. width: 7px;
  102. height: 7px;
  103. background: #27ae60;
  104. border-radius: 50%;
  105. display: inline-block;
  106. }
  107. .left-img {
  108. width: px2rpx(120);
  109. }
  110. .avatar .img {
  111. width: 32px;
  112. height: 32px;
  113. border-radius: 50%;
  114. background: #eee;
  115. }
  116. .logo .img {
  117. width: 36px;
  118. height: 36px;
  119. border-radius: 50%;
  120. background: #fff;
  121. }
  122. </style>