cwg-pc-header.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. @import "@/uni.scss";
  45. .cwg-pc-header {
  46. display: flex;
  47. align-items: center;
  48. justify-content: space-between;
  49. width: 100vw;
  50. height: px2rpx(55);
  51. background-color: rgba(255, 255, 255, 0.9);
  52. border-bottom: 1px solid var(--bs-border-color);
  53. padding: 0 px2rpx(16);
  54. box-sizing: border-box;
  55. // position: fixed;
  56. // top: 0;
  57. // left: 0;
  58. // z-index: 101;
  59. }
  60. .left {
  61. display: flex;
  62. align-items: center;
  63. }
  64. .back-arrow {
  65. color: #e74c3c;
  66. font-size: 22px;
  67. cursor: pointer;
  68. margin-right: 16px;
  69. }
  70. .center {
  71. flex: 1;
  72. }
  73. .right {
  74. display: flex;
  75. align-items: center;
  76. }
  77. .bell .dot {
  78. position: absolute;
  79. top: 0;
  80. right: -2px;
  81. width: 7px;
  82. height: 7px;
  83. background: #27ae60;
  84. border-radius: 50%;
  85. display: inline-block;
  86. }
  87. .left-img {
  88. width: px2rpx(120);
  89. }
  90. .avatar .img {
  91. width: 32px;
  92. height: 32px;
  93. border-radius: 50%;
  94. background: #eee;
  95. }
  96. .logo .img {
  97. width: 36px;
  98. height: 36px;
  99. border-radius: 50%;
  100. background: #fff;
  101. }
  102. </style>