cwg-pc-header.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <uni-nav-bar :leftWidth="0" :rightWidth="0" :statusBar="true" :fixed="true" :height="55" :border="false">
  3. <view class="cwg-pc-header bg-body">
  4. <div class="left">
  5. <cwg-icon :name="!sidebarVisible ? 'crm-bars-staggered' : 'cwg-close'" color="#97A1C0"
  6. @click="openLeftDrawer" />
  7. </div>
  8. <div class="left">
  9. <image class="left-img" v-if="!isDark" src="/static/images/vu/logo-full.svg" mode="widthFix" alt="logo"
  10. @click="openLeftDrawer" />
  11. <image class="left-img" v-else src="/static/images/vu/logo-full-white.svg" mode="widthFix" alt="logo"
  12. @click="openLeftDrawer" />
  13. </div>
  14. <div class="right">
  15. <!-- #ifndef APP-PLUS -->
  16. <cwg-system />
  17. <!-- #endif -->
  18. <cwg-notice />
  19. <cwg-right-drawer />
  20. </div>
  21. </view>
  22. </uni-nav-bar>
  23. </template>
  24. <script setup lang="ts">
  25. import { computed } from 'vue'
  26. import useGlobalStore from '@/stores/use-global-store'
  27. const globalStore = useGlobalStore()
  28. const isDark = computed(() => globalStore.theme === 'dark')
  29. const props = defineProps({
  30. sidebarVisible: {
  31. type: Boolean,
  32. default: false
  33. },
  34. })
  35. const emit = defineEmits<{
  36. (e: 'open-right-drawer'): void,
  37. (e: 'open-left-drawer'): void
  38. }>()
  39. function openLeftDrawer() {
  40. emit('open-left-drawer');
  41. }
  42. </script>
  43. <style scoped lang="scss">
  44. .cwg-pc-header {
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. width: 100vw;
  49. height: 55px;
  50. background-color: rgba(255, 255, 255, 0.9);
  51. border-bottom: 1px solid var(--bs-border-color);
  52. padding: 0 px2rpx(16);
  53. box-sizing: border-box;
  54. // position: fixed;
  55. // top: 0;
  56. // left: 0;
  57. // z-index: 101;
  58. }
  59. .left {
  60. display: flex;
  61. align-items: center;
  62. }
  63. .back-arrow {
  64. color: #e74c3c;
  65. font-size: 22px;
  66. cursor: pointer;
  67. margin-right: 16px;
  68. }
  69. .center {
  70. flex: 1;
  71. }
  72. .right {
  73. display: flex;
  74. align-items: center;
  75. }
  76. .bell .dot {
  77. position: absolute;
  78. top: 0;
  79. right: -2px;
  80. width: 7px;
  81. height: 7px;
  82. background: #27ae60;
  83. border-radius: 50%;
  84. display: inline-block;
  85. }
  86. .left-img {
  87. width: px2rpx(120);
  88. }
  89. .avatar .img {
  90. width: 32px;
  91. height: 32px;
  92. border-radius: 50%;
  93. background: #eee;
  94. }
  95. .logo .img {
  96. width: 36px;
  97. height: 36px;
  98. border-radius: 50%;
  99. background: #fff;
  100. }
  101. </style>