cwg-pc-header.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. <cwg-notice />
  16. <cwg-right-drawer />
  17. </div>
  18. </view>
  19. </uni-nav-bar>
  20. </template>
  21. <script setup lang="ts">
  22. import { computed } from 'vue'
  23. import useGlobalStore from '@/stores/use-global-store'
  24. const globalStore = useGlobalStore()
  25. const isDark = computed(() => globalStore.theme === 'dark')
  26. const props = defineProps({
  27. sidebarVisible: {
  28. type: Boolean,
  29. default: false
  30. },
  31. })
  32. const emit = defineEmits<{
  33. (e: 'open-right-drawer'): void,
  34. (e: 'open-left-drawer'): void
  35. }>()
  36. function openLeftDrawer() {
  37. emit('open-left-drawer');
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. @import "@/uni.scss";
  42. .cwg-pc-header {
  43. display: flex;
  44. align-items: center;
  45. justify-content: space-between;
  46. width: 100vw;
  47. height: px2rpx(55);
  48. background-color: rgba(255, 255, 255, 0.9);
  49. border-bottom: 1px solid var(--bs-border-color);
  50. padding: 0 px2rpx(16);
  51. box-sizing: border-box;
  52. // position: fixed;
  53. // top: 0;
  54. // left: 0;
  55. // z-index: 101;
  56. }
  57. .left {
  58. display: flex;
  59. align-items: center;
  60. }
  61. .back-arrow {
  62. color: #e74c3c;
  63. font-size: 22px;
  64. cursor: pointer;
  65. margin-right: 16px;
  66. }
  67. .center {
  68. flex: 1;
  69. }
  70. .right {
  71. display: flex;
  72. align-items: center;
  73. }
  74. .bell .dot {
  75. position: absolute;
  76. top: 0;
  77. right: -2px;
  78. width: 7px;
  79. height: 7px;
  80. background: #27ae60;
  81. border-radius: 50%;
  82. display: inline-block;
  83. }
  84. .left-img {
  85. width: px2rpx(120);
  86. }
  87. .avatar .img {
  88. width: 32px;
  89. height: 32px;
  90. border-radius: 50%;
  91. background: #eee;
  92. }
  93. .logo .img {
  94. width: 36px;
  95. height: 36px;
  96. border-radius: 50%;
  97. background: #fff;
  98. }
  99. </style>