income.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view class="top ddflex">
  4. <view class="ke"><text>{{count.ktx}}</text>可提现</view>
  5. <view class="datas ddflex fflex">
  6. <view class="li"><text>总收益</text>{{count.profit}}</view>
  7. <view class="li"><text>已提现</text>{{count.ytx}}</view>
  8. <view class="li"><text>待结算</text>{{count.djs}}</view>
  9. <view class="li"><text>已消费</text>{{count.yxf}}</view>
  10. </view>
  11. </view>
  12. <view v-for="(item, index) in pageList" :key="index" class="pintuan">
  13. <view class="li">
  14. <view class="dflex item">
  15. <view class="pinimgs">
  16. <image src="/promote/static/promote/images/purchase.png" mode="aspectFit" class="pinimg"
  17. v-if="item.logType==3||item.logType==31">
  18. </image>
  19. <image src="/promote/static/promote/images/recharge.png" mode="aspectFit" class="pinimg"
  20. v-if="item.logType==6||item.logType==5||item.logType==32||item.logType==7||item.logType==8||item.logType==30">
  21. </image>
  22. <image src="/promote/static/promote/images/commission.png" mode="aspectFit" class="pinimg"
  23. v-if="item.logType==1"></image>
  24. <image src="/promote/static/promote/images/service.png" mode="aspectFit" class="pinimg"
  25. v-if="item.logType==2"></image>
  26. </view>
  27. <view class="pininfo ">
  28. <view class="proname">
  29. <!-- {{item.source==1?item.note:item.sourceStr}} -->
  30. <!-- <text>充值赠送-{{item.changeMoney}}</text> -->
  31. <text>{{item.logTypeName}} </text>
  32. <text class="orderId" v-if="item.orderId">NO:{{item.orderId}}</text>
  33. </view>
  34. <view class="operate">
  35. <view class="introduce">
  36. {{item.createDate}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="price">
  41. <view class="give" v-if="item.logType==5">赠送:{{item.giveMenoy}}</view>
  42. <view>
  43. <text v-if="item.logType!=5"
  44. :class="item.changeMoney>0?'prc':'prc1'">{{item.changeMoney>0?'+':''}}{{item.changeMoney}}</text>
  45. <text v-if="item.logType==5"
  46. :class="item.actuallyMenoy>0?'prc':'prc1'">{{item.actuallyMenoy>0?'+':''}}{{item.actuallyMenoy}}</text>
  47. </view>
  48. <view><text class="num">余额 {{item.currentMoney?item.currentMoney:'0'}}</text></view>
  49. <!-- <view class="btn file" >积分不足</view> -->
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="nodata" v-if="ishow">
  55. <image :src="picUrlss+'empty_dd.png'"></image>
  56. <text>暂无明细</text>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. const route = require("../../../utils/route.js");
  62. const req = require("../../../utils/request");
  63. export default {
  64. data() {
  65. return {
  66. picUrlss: req.public.picUrls,
  67. searchTitle: '',
  68. isLoad: true,
  69. page: 1,
  70. pageList: "",
  71. ishow: false,
  72. count: {}
  73. };
  74. },
  75. onLoad: function(options) {
  76. this.getProfit();
  77. },
  78. onShow: function() {
  79. this.balanceLogs();
  80. },
  81. onReachBottom: function() {
  82. this.page++;
  83. this.balanceLogs();
  84. },
  85. methods: {
  86. getProfit(){
  87. req.getRequest('/api/rrLogs/profit',{},res=>{
  88. this.count = res;
  89. })
  90. },
  91. balanceLogs() {
  92. let that = this;
  93. let from = {
  94. smallType: 1,
  95. page: that.page,
  96. limit: 10
  97. };
  98. let isShowLoading = false;
  99. if (that.page == 1 && !isShowLoading) {
  100. console.log('一直在加载');
  101. req.loadIng('加载中');
  102. isShowLoading = true;
  103. }
  104. if (!that.isLoad) return false;
  105. that.isLoad = false;
  106. route.balanceLogs(from, res => {
  107. if (res && res.length >= 10) that.isLoad = true;
  108. if (that.page > 1) res = that.pageList.concat(res);
  109. console.log(res);
  110. res.map(it => {
  111. if (it.orderId) {
  112. it.orderId = it.orderId.substring(it.orderId.length - 6);
  113. }
  114. return it;
  115. });
  116. this.setData({
  117. pageList: res
  118. });
  119. if (this.pageList && this.pageList.length <= 0) {
  120. that.setData({
  121. ishow: true
  122. });
  123. } else {
  124. that.setData({
  125. ishow: false
  126. });
  127. }
  128. if (isShowLoading) {
  129. uni.hideLoading();
  130. isShowLoading = false;
  131. }
  132. });
  133. }
  134. }
  135. };
  136. </script>
  137. <style>
  138. @import "./income.css";
  139. </style>