nonprofit.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="tab_page" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <up-navbar title="我的公益" bgColor="#FFFFFF">
  4. <template #left></template>
  5. </up-navbar>
  6. <div class="tab adf">
  7. <div class="tab-pre" :class="{'active':tidx===0}" @tap="changeTab(0)">未开始</div>
  8. <div class="tab-pre" :class="{'active':tidx===1}" @tap="changeTab(1)">进行中</div>
  9. <div class="tab-pre" :class="{'active':tidx===2}" @tap="changeTab(2)">已结束</div>
  10. </div>
  11. <div class="list">
  12. <up-list @scrolltolower="scrolltolower" style="height: 100%;">
  13. <up-list-item v-for="(item, index) in list" :key="index">
  14. <NonprofitItem></NonprofitItem>
  15. </up-list-item>
  16. </up-list>
  17. </div>
  18. <CusTabbar :tabbarIndex="1"></CusTabbar>
  19. </view>
  20. </template>
  21. <script setup name="">
  22. import CusTabbar from '@/components/CusTabbar/index.vue'
  23. import NonprofitItem from '@/components/pages/nonprofitItem/index.vue'
  24. import { ref } from 'vue'
  25. const tidx = ref(0)
  26. const query = ref({
  27. page: 1,
  28. limit: 10,
  29. status: 0
  30. })
  31. const list = ref([1,1,1,1,1,1])
  32. const changeTab = index => {
  33. tidx.value = index;
  34. }
  35. </script>
  36. <style scoped lang="scss">
  37. .tab_page{
  38. padding: 0;
  39. .tab{
  40. height: 110rpx;
  41. padding: 40rpx 24rpx 0;
  42. box-sizing: border-box;
  43. background: #FFFFFF;
  44. &-pre{
  45. width: calc(100% / 3);
  46. position: relative;
  47. font-family: PingFangSC, PingFang SC;
  48. font-weight: 400;
  49. font-size: 30rpx;
  50. color: #676775;
  51. line-height: 30rpx;
  52. text-align: center;
  53. &.active{
  54. font-weight: bold;
  55. font-size: 32rpx;
  56. color: #151B29;
  57. &::after{
  58. content: '';
  59. width: 100%;
  60. height: 6rpx;
  61. background: #252525;
  62. position: absolute;
  63. left: 0;
  64. bottom: 0;
  65. }
  66. }
  67. }
  68. }
  69. .list{
  70. height: calc(100% - 274rpx);
  71. padding: 0 24rpx 20rpx;
  72. box-sizing: border-box;
  73. }
  74. }
  75. </style>