cwg-pc-header.vue 1.8 KB

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