Acontlist.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. let data = {
  39. classify: 1,
  40. page:this.page,
  41. limit:15
  42. };
  43. this.$Request.getT('/app/userinfo/selectCashDeposit',data).then(res => {
  44. if(res.code==0){
  45. // this.list = res.data.list
  46. if (this.page == 1) {
  47. this.list = res.data.list
  48. } else {
  49. this.list = this.list.concat(res.data.list)
  50. }
  51. this.totalCount = res.data.totalPage
  52. }
  53. console.log('res',res)
  54. uni.stopPullDownRefresh();
  55. });
  56. },
  57. },
  58. // 上拉加载
  59. onReachBottom: function() {
  60. if (this.page < this.totalCount) {
  61. this.page += 1;
  62. this.taskData();
  63. } else {
  64. uni.showToast({
  65. title: '已经最后一页啦',
  66. icon: 'none'
  67. })
  68. }
  69. },
  70. onPullDownRefresh: function() {
  71. this.page = 1;
  72. this.taskData();
  73. },
  74. }
  75. </script>
  76. <style>
  77. body {
  78. background: #F5F5F5;
  79. }
  80. .content {
  81. width: 100%;
  82. background: #FFFFFF;
  83. /* margin-top: 20rpx; */
  84. padding-bottom: 50rpx;
  85. padding-top: 20rpx;
  86. }
  87. .list_box {
  88. width: 90%;
  89. margin: 0 auto;
  90. display: flex;
  91. line-height: 45rpx;
  92. padding-top: 20rpx;
  93. }
  94. .list_left {
  95. flex: 2;
  96. }
  97. .name {
  98. font-size: 26rpx;
  99. color: #333333;
  100. font-weight: bold;
  101. letter-spacing: 2rpx;
  102. }
  103. .data {
  104. color: #999999;
  105. font-size: 24rpx;
  106. }
  107. .list_right {
  108. flex: 1;
  109. display: flex;
  110. justify-content: flex-end;
  111. align-items: center;
  112. font-size: 31rpx;
  113. }
  114. </style>