top-window.vue 2.2 KB

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