moban.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!-- 项目列表 -->
  2. <template>
  3. <view class="body" :style="'padding-top:'+bottomHeight">
  4. <!-- 头部 -->
  5. <view class="head">
  6. </view>
  7. <!-- 中部 -->
  8. <view class="list-wrap">
  9. <scroll-view scroll-y="true" class="list">
  10. <view class="list-scroll-view">
  11. <view class="course-card">
  12. </view>
  13. </view>
  14. </scroll-view>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import {
  20. reactive,
  21. ref
  22. } from 'vue';
  23. import {
  24. computed
  25. } from 'vue';
  26. import {
  27. onLoad,
  28. onPageScroll,
  29. onPullDownRefresh,
  30. onReady,
  31. onReachBottom,
  32. onShow
  33. } from '@dcloudio/uni-app';
  34. import sheep from '@/sheep';
  35. import $share from '@/sheep/platform/share';
  36. // 隐藏原生tabBar
  37. uni.hideTabBar();
  38. //获取顶部安全距离
  39. const app = uni.getSystemInfoSync()
  40. const bottomHeightOne = (app.statusBarHeight) + 'rpx'
  41. const bottomHeight = ref(bottomHeightOne)
  42. </script>
  43. <style scoped lang="scss">
  44. // 上中下布局样式
  45. .body {
  46. display: flex;
  47. flex-direction: column;
  48. height: 100vh;
  49. background: linear-gradient(to bottom, #08A3E9, #F8FCFF);
  50. }
  51. .head {
  52. text-align: center;
  53. }
  54. // 中部滚动
  55. .list-wrap {
  56. flex-grow: 1;
  57. position: relative;
  58. }
  59. .list {
  60. position: absolute;
  61. top: 0;
  62. left: 0;
  63. right: 0;
  64. bottom: 0;
  65. }
  66. .list-scroll-view {
  67. display: flex;
  68. flex-direction: row;
  69. flex-wrap: wrap;
  70. justify-content: space-between;
  71. margin-left: 2vw;
  72. margin-right: 2vw;
  73. }
  74. .course-card {
  75. width: 47vw;
  76. margin-top: 10px;
  77. margin-bottom: 10px;
  78. }
  79. // 底部
  80. .tools {
  81. display: flex;
  82. flex-direction: row;
  83. justify-content: space-between;
  84. }
  85. .tools-item {
  86. width: 45px;
  87. text-align: center;
  88. font-size: 14px;
  89. padding: 20px;
  90. }
  91. </style>