list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="content">
  3. <view class="warp">
  4. <block v-if="type==3">
  5. <view v-for="item in newsInfo" :key="item.id" class="pgConBox bb">
  6. <view class="pgConTop dfsb">
  7. 充值 : <text class="elli red"> {{ item.money }}</text>
  8. </view>
  9. <view class="pgConBot dfsb">
  10. <text>{{type==3?'充值时间:':''}}{{ item.pay_time }}</text>
  11. </view>
  12. </view>
  13. </block>
  14. <block v-if="type==1">
  15. <view v-for="item in newsInfo" :key="item.id" class="pgConBox bb">
  16. <view class="pgConTop dfsb">
  17. <text class="elli">提现:<text class="red"> {{ item.money }}</text>手续费{{item.sxf}},实际到账{{item.actual}}</text>
  18. <text :class="['mon', item.status==0?'yellow':item.status==1?'green':item.status==2?'red':'' ]">-{{ item.money }}</text>
  19. </view>
  20. <view class="pgConBot dfsb">
  21. <text class="textgrey">{{ item.create_time }}</text>
  22. <text :class="['mon', item.status==0?'yellow':item.status==1?'green':item.status==2?'red':'' ]">{{ item.status==0?'待审核':item.status==1?'已结算':item.status==2?'已驳回':'' }}</text>
  23. </view>
  24. </view>
  25. </block>
  26. </view>
  27. <u-empty v-if="newsInfo.length < 1" icon-size="200" text="还没有记录哦" mode="list"></u-empty>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. type: '', //1.2 提现 3 充值
  35. newsInfo: [
  36. // {
  37. // content: '编译成功。前端运行日志,请另行在小程序开发工具的控制台查',
  38. // money: 566,
  39. // create_time: '09:57:41'
  40. // }
  41. ],
  42. status: 'loadmore',
  43. limit:20,
  44. page: 1
  45. };
  46. },
  47. onReachBottom() {
  48. if (this.status == 'nomore') return;
  49. this.status = 'loading';
  50. this.page = ++this.page;
  51. this.loading();
  52. },
  53. onLoad(opt) {
  54. this.type = opt.type;
  55. if (this.type == 1 ) {
  56. uni.setNavigationBarTitle({
  57. title: '提现记录'
  58. });
  59. } else if (this.type == 3) {
  60. uni.setNavigationBarTitle({
  61. title: '充值记录'
  62. });
  63. }
  64. this.loading();
  65. },
  66. methods: {
  67. loading() {
  68. console.log(1212);
  69. let url = '';
  70. if (this.type == 1) {
  71. uni.setNavigationBarTitle({
  72. title: '提现记录'
  73. });
  74. url = 'withdrawal/cashList';
  75. } else if (this.type == 3) {
  76. uni.setNavigationBarTitle({
  77. title: '充值记录'
  78. });
  79. url = 'user/beanRechargeList';
  80. }
  81. this.$api
  82. .request(url, {
  83. page: this.page,
  84. limit: this.limit
  85. })
  86. .then(data => {
  87. if (data.code == 200) {
  88. this.newsInfo = this.newsInfo.concat(data.data.list);
  89. console.log(this.newsInfo);
  90. if (data.data.list.length < this.limit) {
  91. this.status = 'nomore';
  92. }
  93. } else {
  94. this.$api.toast(data.msg);
  95. }
  96. })
  97. }
  98. }
  99. };
  100. </script>
  101. <style lang="scss">
  102. .content {
  103. padding-top: 20rpx;
  104. .warp {
  105. min-height: 100vh;
  106. }
  107. .pgConBox {
  108. margin-bottom: 20rpx;
  109. background-color: #fff;
  110. padding: 30rpx;
  111. .pgConTop {
  112. align-items: flex-start;
  113. .elli {
  114. flex: 1;
  115. }
  116. text {
  117. font-size: 30rpx;
  118. }
  119. .mon {
  120. font-size: 36rpx;
  121. font-family: DIN-Medium, DIN;
  122. font-weight: 500;
  123. margin-left: 20rpx;
  124. }
  125. }
  126. .pgConBot {
  127. margin-top: 20rpx;
  128. text {
  129. font-size: 26rpx;
  130. line-height: 36rpx;
  131. }
  132. }
  133. }
  134. }
  135. </style>