bzjlist.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <view class="content" v-if="list.length" >
  4. <view class="list_box" v-for="(item,index) in list" :key="index">
  5. <view class="list_left">
  6. <view class="name">{{item.title}}</view>
  7. <view class="flex justify-between align-center">
  8. <view style="color: red;">{{item.type==1?'+':'-'}} {{item.money}}</view>
  9. <view class="data">{{item.createTime}}</view>
  10. </view>
  11. </view>
  12. <!-- <view class="list_right" style="color: red;" v-if="item.type==2">- {{item.money}}</view> -->
  13. <!-- <view class="list_right" style="color: #33D442;" v-if="item.type==1">+ {{item.money}}</view> -->
  14. </view>
  15. </view>
  16. <empty v-else></empty>
  17. </view>
  18. </template>
  19. <script>
  20. import empty from '@/components/empty'
  21. export default {
  22. components: {
  23. empty
  24. },
  25. data() {
  26. return {
  27. list: [],
  28. page: 1,
  29. totalCount: 0
  30. }
  31. },
  32. onLoad() {
  33. this.taskData()
  34. },
  35. methods: {
  36. // 获取任务数据
  37. taskData() {
  38. this.$Request.getT('/app/userMoney/selectUserMoneyDetails?classify=1&page='+this.page+'&limit=15').then(res => {
  39. if(res.code==0){
  40. // this.list = res.data.list
  41. if (this.page == 1) {
  42. this.list = res.data.records
  43. } else {
  44. this.list = this.list.concat(res.data.records)
  45. }
  46. this.totalCount = res.data.pages
  47. }
  48. console.log('res',res)
  49. uni.stopPullDownRefresh();
  50. });
  51. },
  52. },
  53. // 上拉加载
  54. onReachBottom: function() {
  55. if (this.page < this.totalCount) {
  56. this.page += 1;
  57. this.taskData();
  58. } else {
  59. uni.showToast({
  60. title: '已经最后一页啦',
  61. icon: 'none'
  62. })
  63. }
  64. },
  65. onPullDownRefresh: function() {
  66. this.page = 1;
  67. this.taskData();
  68. },
  69. }
  70. </script>
  71. <style>
  72. body {
  73. background: #F5F5F5;
  74. }
  75. .content {
  76. width: 100%;
  77. background: #FFFFFF;
  78. /* margin-top: 20rpx; */
  79. padding-bottom: 50rpx;
  80. padding-top: 20rpx;
  81. }
  82. .list_box {
  83. width: 90%;
  84. margin: 0 auto;
  85. display: flex;
  86. line-height: 45rpx;
  87. padding-top: 20rpx;
  88. border-bottom: 1rpx solid #f8f8f8;
  89. }
  90. .list_left {
  91. flex: 2;
  92. }
  93. .name {
  94. font-size: 26rpx;
  95. color: #333333;
  96. font-weight: bold;
  97. letter-spacing: 2rpx;
  98. }
  99. .data {
  100. color: #999999;
  101. font-size: 24rpx;
  102. }
  103. .list_right {
  104. flex: 1;
  105. display: flex;
  106. justify-content: flex-end;
  107. align-items: center;
  108. font-size: 31rpx;
  109. }
  110. </style>