page-header.vue 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="page_header" :style="{ paddingTop: 80 + 'rpx' }">
  3. <text class="header_title">{{ schoolName }}</text>
  4. </view>
  5. </template>
  6. <script setup>
  7. import { ref, onMounted } from 'vue';
  8. import { useStore } from 'vuex';
  9. import { useSafeArea } from '@/common/safeArea';
  10. const store = useStore();
  11. const schoolName = ref('');
  12. const { statusBarHeight, initSafeArea } = useSafeArea();
  13. onMounted(() => {
  14. initSafeArea();
  15. schoolName.value = store.state.userStore.userInfo.schoolName || '';
  16. });
  17. </script>
  18. <style lang="scss" scoped>
  19. .page_header {
  20. position: fixed;
  21. top: 0;
  22. left: 0;
  23. right: 0;
  24. background-color: #FFFFFF;
  25. padding-bottom: 26rpx;
  26. padding-left: 24rpx;
  27. padding-right: 24rpx;
  28. border-bottom: 1rpx solid #F0F0F0;
  29. z-index: 999;
  30. .header_title {
  31. font-size: 44rpx;
  32. font-weight: 600;
  33. color: #333333;
  34. }
  35. }
  36. </style>