cwg-pc-header.vue 1.6 KB

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