top-window.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 event-source="top"/>
  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, onMounted } 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. onMounted(()=>{
  38. uni.$emit('updateSystemList','top')
  39. })
  40. </script>
  41. <style scoped lang="scss">
  42. @import "@/uni.scss";
  43. .cwg-pc-header {
  44. display: flex;
  45. align-items: center;
  46. justify-content: space-between;
  47. height: px2rpx(55);
  48. border-bottom: 1px solid var(--bs-border-color);
  49. padding: 0 px2rpx(16);
  50. position: relative;
  51. z-index: 10;
  52. }
  53. .left {
  54. display: flex;
  55. align-items: center;
  56. }
  57. .center {
  58. flex: 1;
  59. }
  60. .right {
  61. display: flex;
  62. align-items: center;
  63. gap: 0;
  64. }
  65. .bell .dot {
  66. position: absolute;
  67. top: 0;
  68. right: -2px;
  69. width: 7px;
  70. height: 7px;
  71. background: #27ae60;
  72. border-radius: 50%;
  73. display: inline-block;
  74. }
  75. .left-img {
  76. width: px2rpx(120);
  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>