pushList.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="content">
  3. <empty v-if="loaded === true && list.length === 0"></empty>
  4. <view class="flex tab">
  5. <view class="td">
  6. 消费人
  7. </view>
  8. <view class="td">
  9. 消费额度
  10. </view>
  11. <view class="td">
  12. 是否结算
  13. </view>
  14. </view>
  15. <view class="flex tab tab-1" v-for="item in list">
  16. <view class="td clamp">
  17. {{item.nickname}}
  18. </view>
  19. <view class="td clamp">
  20. {{item.pay_price}}
  21. </view>
  22. <view class="td clamp">
  23. {{item.is_participate == 0 ? '未结算': '已结算'}}
  24. </view>
  25. </view>
  26. <uni-load-more :status="loadingType"></uni-load-more>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. myspread,
  32. myteam,
  33. getPushList
  34. } from '@/api/user.js';
  35. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  36. import empty from '@/components/empty';
  37. export default {
  38. components: {
  39. empty,
  40. uniLoadMore
  41. },
  42. data() {
  43. return {
  44. list: [],
  45. page: 1,
  46. limit: 100,
  47. loaded: false,
  48. loadingType: 'more'
  49. }
  50. },
  51. onLoad() {
  52. this.getPushList()
  53. },
  54. onShow() {
  55. },
  56. onReachBottom() {
  57. this.getPushList()
  58. },
  59. onReady() {
  60. },
  61. methods: {
  62. getPushList() {
  63. let that = this
  64. if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
  65. return
  66. }
  67. that.loadingType = 'loading'
  68. getPushList({
  69. page: that.page,
  70. limit: that.limit
  71. }).then(res => {
  72. // console.log(res)
  73. that.list = that.list.concat(res.data.data)
  74. if (that.limit == res.data.data.length) {
  75. that.loadingType = 'more'
  76. } else {
  77. that.loadingType = 'noMore'
  78. }
  79. this.loaded = true
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .tab {
  87. width: 100%;
  88. height: 100rpx;
  89. text-align: center;
  90. font-size: 32rpx;
  91. border-bottom: 1px solid #eee;
  92. .td {
  93. text-align: center;
  94. width: 33.3%;
  95. }
  96. }
  97. .tab-1 {
  98. height: 50rpx;
  99. }
  100. </style>