index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="scan-page">
  3. <!-- 自定义头部 -->
  4. <view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
  5. <view class="header-content">
  6. <text class="header-title">{{ t('common.page.scan') }}</text>
  7. </view>
  8. </view>
  9. <!-- 页面内容 -->
  10. <view class="page-body">
  11. <text class="placeholder">扫描主体内容区域</text>
  12. </view>
  13. </view>
  14. </template>
  15. <script setup>
  16. import { ref, onMounted } from 'vue'
  17. import { useI18n } from 'vue-i18n'
  18. const { t } = useI18n()
  19. // 状态栏高度
  20. const statusBarHeight = ref(0)
  21. onMounted(() => {
  22. // 获取系统信息
  23. const systemInfo = uni.getSystemInfoSync()
  24. statusBarHeight.value = systemInfo.statusBarHeight || 0
  25. console.log('扫描内容组件已加载')
  26. })
  27. </script>
  28. <style lang="scss" scoped>
  29. .scan-page {
  30. width: 100%;
  31. min-height: 100vh;
  32. display: flex;
  33. flex-direction: column;
  34. background: linear-gradient(180deg, #e0f7fa 0%, #f8f9fa 100%);
  35. // 自定义头部
  36. .custom-header {
  37. position: fixed;
  38. top: 0;
  39. left: 0;
  40. right: 0;
  41. background-color: #ffffff;
  42. border-bottom: 1rpx solid #e5e5e5;
  43. z-index: 100;
  44. .header-content {
  45. height: 88rpx;
  46. display: flex;
  47. align-items: center;
  48. justify-content: center;
  49. .header-title {
  50. font-size: 32rpx;
  51. font-weight: 500;
  52. color: #000000;
  53. }
  54. }
  55. }
  56. // 页面内容
  57. .page-body {
  58. flex: 1;
  59. padding: 40rpx;
  60. margin-top: 88rpx;
  61. .placeholder {
  62. font-size: 28rpx;
  63. color: #999999;
  64. text-align: center;
  65. margin-top: 200rpx;
  66. }
  67. }
  68. }
  69. </style>