小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.0 KiB

  1. <template>
  2. <view class="promoter-order" ref="container">
  3. <view class="promoterHeader bg-color-red">
  4. <view class="headerCon acea-row row-between-wrapper">
  5. <view>
  6. <text class="name">累计推广订单</text>
  7. <view>
  8. <text class="num">{{ count||'0' }}</text>
  9. <text></text>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="list">
  15. <view class="item" v-for="(item, listIndex) in list" :key="listIndex">
  16. <view class="title acea-row row-column row-center">
  17. <view class="data">{{ item.time }}</view>
  18. <text>本月累计推广订单{{ item.count ? item.count : 0 }}</text>
  19. </view>
  20. <view class="listn">
  21. <view class="itenm" v-for="(val, indexn) in item.child" :key="indexn">
  22. <view class="top acea-row row-between-wrapper">
  23. <view class="pictxt acea-row row-between-wrapper">
  24. <view class="pictrue">
  25. <image :src="val.avatar" />
  26. </view>
  27. <text class="text line1">{{ val.nickname }}</text>
  28. </view>
  29. <view class="money">
  30. <text>返佣</text>
  31. <text class="font-color-red">{{ val.number ? val.number : 0 }}</text>
  32. </view>
  33. </view>
  34. <view class="bottom">
  35. <view>
  36. <text class="name">订单号</text>
  37. {{ val.orderId }}
  38. </view>
  39. <view>
  40. <text class="name">下单时间</text>
  41. {{ val.time }}
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <Loading :loaded="loaded" :loading="loading"></Loading>
  49. </view>
  50. </template>
  51. <script>
  52. import { getSpreadOrder } from "@/api/user";
  53. import Loading from "@/components/Loading";
  54. export default {
  55. name: "PromoterOrder",
  56. components: {
  57. Loading
  58. },
  59. props: {},
  60. data: function() {
  61. return {
  62. list: [],
  63. where: {
  64. page: 1,
  65. limit: 15
  66. },
  67. loaded: false,
  68. loading: false,
  69. loadTitle: "",
  70. count: ""
  71. };
  72. },
  73. mounted: function() {
  74. this.getIndex();
  75. },
  76. onReachBottom() {
  77. !this.loading && this.getIndex();
  78. },
  79. methods: {
  80. getIndex: function() {
  81. let there = this;
  82. if (there.loaded == true || there.loading == true) return;
  83. there.loading = true;
  84. getSpreadOrder(there.where).then(
  85. res => {
  86. there.loading = false;
  87. there.loaded = res.data.list.length < there.where.limit;
  88. there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多";
  89. there.where.page = there.where.page + 1;
  90. there.list.push.apply(there.list, res.data.list);
  91. there.count = res.data.count;
  92. },
  93. err => {
  94. uni.showToast({
  95. title: err.msg || err.response.data.msg|| err.response.data.message,
  96. icon: "none",
  97. duration: 2000
  98. });
  99. },
  100. 300
  101. );
  102. }
  103. }
  104. };
  105. </script>