balance.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view>
  3. <!--promote/balance/balance.wxml-->
  4. <view class="list" v-if="pageList.length > 0">
  5. <block v-for="(item, index) in pageList" :key="index">
  6. <view class="li dflex">
  7. <image :src="item.createAvatar ? item.createAvatar : '../../static/pages/images/userimg.png'" mode="aspectFill" class="userimg"></image>
  8. <view class="fflex">
  9. <view class="ddflex">
  10. <view class="fflex">
  11. <view class="username">{{item.nickName}}</view>
  12. <view class="time" v-if="item.updateDate">{{item.updateDate}}</view>
  13. </view>
  14. <view class="money">¥<text>{{item.orderMoney}}</text></view>
  15. </view>
  16. <view class="name">
  17. <text>订单</text>
  18. {{item.orderId}}
  19. </view>
  20. <view class="pro-buy ddflex" v-if="item.productList && item.productList.length > 0">
  21. <text>购买了</text>
  22. <view class="pro-list fflex">
  23. <view class="lis tover" v-for="(it,idx) in item.productList" :key="idx">{{it.title}}</view>
  24. </view>
  25. </view>
  26. <view class="opt ddflex">
  27. <view :class="'shifu ddflex' + (item.state==2 ? ' green' : item.state==1 ? ' dai' : '')"><text>佣金</text>¥<text>{{item.money}}</text></view>
  28. <view class="sta dai" v-if="item.state==1">待结算</view>
  29. <view class="sta green" v-else-if="item.state==2">已结算</view>
  30. <view class="sta moneygray" v-else>已取消</view>
  31. </view>
  32. </view>
  33. <!-- <view class="flex">
  34. <view class="name">
  35. <text>订单:</text>
  36. {{item.orderId}}
  37. </view>
  38. <view class="dblock">
  39. <text class="moneygray"></text>
  40. <text class="moneygray" v-if="item.orderMoney"> ¥{{item.orderMoney}}</text>
  41. <text class="moneyred" v-if="item.state==1">待结算</text>
  42. <text class="moneygray" v-else-if="item.state==2">已结算</text>
  43. <text class="moneygray" v-else>已取消</text>
  44. </view>
  45. </view>
  46. <view class="money">¥<text>{{item.money}}</text>
  47. <view>
  48. <text class="time" v-if="item.updateDate">{{item.updateDate}}</text>
  49. </view>
  50. </view> -->
  51. </view>
  52. </block>
  53. </view>
  54. <view class="nodata" v-if="pageList.length < 1">
  55. <image :src="picUrlss+'empty_dd.png'"></image>
  56. <text>暂无业绩订单</text>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. // promote/balance/balance.js
  62. const app = getApp();
  63. const req = require("../../utils/request.js");
  64. export default {
  65. data() {
  66. return {
  67. picUrlss: req.public.picUrls,
  68. pageList: [],
  69. form: {
  70. page: 1,
  71. limit: 12
  72. },
  73. isLoad: true
  74. };
  75. },
  76. components: {},
  77. props: {},
  78. onLoad(options) {
  79. this.getData();
  80. },
  81. onReachBottom: function () {
  82. if (this.hasmore) return false;
  83. this.form.page++;
  84. this.getData();
  85. },
  86. methods: {
  87. getData() {
  88. if (!this.isLoad) return false;
  89. this.isLoad = false;
  90. let that = this;
  91. req.getRequest('/api/distribution/income', that.form, data => {
  92. // console.log(data);
  93. if (data && data.length >= 10) that.isLoad = true;
  94. if (that.form.page > 1) data = that.pageList.concat(data);
  95. that.setData({
  96. pageList: data
  97. });
  98. });
  99. }
  100. }
  101. };
  102. </script>
  103. <style>
  104. @import "./balance.css";
  105. </style>