nonprofit.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 @tap="toDetail(item)"></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. const toDetail = item => {
  36. uni.navigateTo({
  37. url:'/pagesNonprofit/nonprofitDetail'
  38. })
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. .tab_page{
  43. padding: 0;
  44. .tab{
  45. height: 110rpx;
  46. padding: 40rpx 24rpx 0;
  47. box-sizing: border-box;
  48. background: #FFFFFF;
  49. &-pre{
  50. width: calc(100% / 3);
  51. position: relative;
  52. font-family: PingFangSC, PingFang SC;
  53. font-weight: 400;
  54. font-size: 30rpx;
  55. color: #676775;
  56. line-height: 30rpx;
  57. text-align: center;
  58. &.active{
  59. font-weight: bold;
  60. font-size: 32rpx;
  61. color: #151B29;
  62. &::after{
  63. content: '';
  64. width: 100%;
  65. height: 6rpx;
  66. background: #252525;
  67. position: absolute;
  68. left: 0;
  69. bottom: 0;
  70. }
  71. }
  72. }
  73. }
  74. .list{
  75. height: calc(100% - 274rpx);
  76. padding: 0 24rpx 20rpx;
  77. box-sizing: border-box;
  78. }
  79. }
  80. </style>