Acontlist.vue 3.0 KB

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