top-window.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <header class="cwg-pc-header">
  3. <div class="left">
  4. <image class="left-img" src="/static/images/logo-full.svg" mode="widthFix" alt="logo" @click="openLeftDrawer" />
  5. </div>
  6. <div class="right" v-if="visible">
  7. <cwg-payment />
  8. <cwg-system />
  9. <cwg-language />
  10. <cwg-notice />
  11. <cwg-right-drawer />
  12. </div>
  13. </header>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref, computed,watch } from 'vue'
  17. import { storeToRefs } from 'pinia'
  18. import useUserStore from '@/stores/use-user-store'
  19. const userStore = useUserStore()
  20. const { userInfo } = storeToRefs(userStore)
  21. const visible = ref(true)
  22. watch(() => userInfo.value, (val) => {
  23. visible.value = !!val
  24. })
  25. const props = defineProps({
  26. sidebarVisible: {
  27. type: Boolean,
  28. default: false,
  29. },
  30. })
  31. </script>
  32. <style scoped lang="scss">
  33. .cwg-pc-header {
  34. display: flex;
  35. align-items: center;
  36. justify-content: space-between;
  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. position: relative;
  42. z-index: 10;
  43. }
  44. .left {
  45. display: flex;
  46. align-items: center;
  47. }
  48. .center {
  49. flex: 1;
  50. }
  51. .right {
  52. display: flex;
  53. align-items: center;
  54. gap: 0;
  55. }
  56. .bell .dot {
  57. position: absolute;
  58. top: 0;
  59. right: -2px;
  60. width: 7px;
  61. height: 7px;
  62. background: #27ae60;
  63. border-radius: 50%;
  64. display: inline-block;
  65. }
  66. .left-img {
  67. width: px2rpx(120);
  68. }
  69. .avatar .img {
  70. width: 32px;
  71. height: 32px;
  72. border-radius: 50%;
  73. background: #eee;
  74. }
  75. .logo .img {
  76. width: 36px;
  77. height: 36px;
  78. border-radius: 50%;
  79. background: #fff;
  80. }
  81. </style>