top-window.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <header class="cwg-pc-header bg-body" :class="{ 'dark': isDark }">
  3. <div class="left">
  4. <image class="left-img" v-if="!isDark" src="/static/images/vu/logo-full.svg" mode="widthFix" alt="logo"
  5. @click="openLeftDrawer" />
  6. <image class="left-img" v-else src="/static/images/vu/logo-full-white.svg" mode="widthFix" alt="logo"
  7. @click="openLeftDrawer" />
  8. </div>
  9. <div class="right" v-if="visible">
  10. <cwg-payment />
  11. <cwg-system />
  12. <cwg-language />
  13. <cwg-notice />
  14. <cwg-right-drawer />
  15. </div>
  16. </header>
  17. </template>
  18. <script setup lang="ts">
  19. import { ref, computed, watch } from 'vue'
  20. import { storeToRefs } from 'pinia'
  21. import useUserStore from '@/stores/use-user-store'
  22. const userStore = useUserStore()
  23. const { userInfo } = storeToRefs(userStore)
  24. import useGlobalStore from '@/stores/use-global-store'
  25. const globalStore = useGlobalStore()
  26. const isDark = computed(() => globalStore.theme === 'dark')
  27. const visible = ref(true)
  28. watch(() => userInfo.value, (val) => {
  29. visible.value = !!val
  30. })
  31. const props = defineProps({
  32. sidebarVisible: {
  33. type: Boolean,
  34. default: false,
  35. },
  36. })
  37. </script>
  38. <style scoped lang="scss">
  39. .cwg-pc-header {
  40. display: flex;
  41. align-items: center;
  42. justify-content: space-between;
  43. height: px2rpx(55);
  44. border-bottom: 1px solid var(--bs-border-color);
  45. padding: 0 px2rpx(16);
  46. position: relative;
  47. z-index: 10;
  48. }
  49. .left {
  50. display: flex;
  51. align-items: center;
  52. }
  53. .center {
  54. flex: 1;
  55. }
  56. .right {
  57. display: flex;
  58. align-items: center;
  59. gap: 0;
  60. }
  61. .bell .dot {
  62. position: absolute;
  63. top: 0;
  64. right: -2px;
  65. width: 7px;
  66. height: 7px;
  67. background: #27ae60;
  68. border-radius: 50%;
  69. display: inline-block;
  70. }
  71. .left-img {
  72. width: px2rpx(120);
  73. }
  74. .avatar .img {
  75. width: 32px;
  76. height: 32px;
  77. border-radius: 50%;
  78. background: #eee;
  79. }
  80. .logo .img {
  81. width: 36px;
  82. height: 36px;
  83. border-radius: 50%;
  84. background: #fff;
  85. }
  86. </style>