top-window.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. border-bottom: 1px solid #f0f0f0;
  39. padding: 0 px2rpx(16);
  40. position: relative;
  41. z-index: 10;
  42. }
  43. .left {
  44. display: flex;
  45. align-items: center;
  46. }
  47. .center {
  48. flex: 1;
  49. }
  50. .right {
  51. display: flex;
  52. align-items: center;
  53. gap: 0;
  54. }
  55. .bell .dot {
  56. position: absolute;
  57. top: 0;
  58. right: -2px;
  59. width: 7px;
  60. height: 7px;
  61. background: #27ae60;
  62. border-radius: 50%;
  63. display: inline-block;
  64. }
  65. .left-img {
  66. width: px2rpx(120);
  67. }
  68. .avatar .img {
  69. width: 32px;
  70. height: 32px;
  71. border-radius: 50%;
  72. background: #eee;
  73. }
  74. .logo .img {
  75. width: 36px;
  76. height: 36px;
  77. border-radius: 50%;
  78. background: #fff;
  79. }
  80. </style>