top-window.vue 2.4 KB

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