CommissionDetails.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="commission-details" ref="container">
  3. <NavBar title="佣金记录"></NavBar>
  4. <div class="promoterHeader bg-color-red">
  5. <div class="headerCon acea-row row-between-wrapper">
  6. <div>
  7. <div class="name">佣金汇总</div>
  8. <div class="money">
  9. ¥<span class="num">{{ commission }}</span>
  10. </div>
  11. </div>
  12. <div class="iconfont icon-jinbi1"></div>
  13. </div>
  14. </div>
  15. <div class="sign-record" ref="content">
  16. <div class="list">
  17. <div class="item" v-for="(item, index) in info" :key="index">
  18. <div class="data">{{ item.time }}</div>
  19. <div class="listn" v-for="(val, indexn) in item.list" :key="indexn">
  20. <div class="itemn acea-row row-between-wrapper">
  21. <div>
  22. <div class="name line1">{{ val.title }}</div>
  23. <div>{{ val.add_time }}</div>
  24. </div>
  25. <div class="num" v-if="val.pm == 1">+{{ val.number }}</div>
  26. <div class="num font-color-red" v-if="val.pm == 0">
  27. -{{ val.number }}
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <Loading :loaded="loaded" :loading="loading"></Loading>
  35. </div>
  36. </template>
  37. <script>
  38. import { getCommissionInfo, getSpreadInfo } from "../../../api/user";
  39. import Loading from "@components/Loading";
  40. import NavBar from "@components/NavBar";
  41. export default {
  42. name: "CommissionDetails",
  43. components: {
  44. Loading,
  45. NavBar
  46. },
  47. props: {},
  48. data: function() {
  49. return {
  50. info: [],
  51. commission: 0,
  52. where: {
  53. page: 1,
  54. limit: 3
  55. },
  56. types: 3,
  57. loaded: false,
  58. loading: false
  59. };
  60. },
  61. mounted: function() {
  62. this.getCommission();
  63. this.getIndex();
  64. this.$scroll(this.$refs.container, () => {
  65. this.loading === false && this.getIndex();
  66. });
  67. },
  68. methods: {
  69. getIndex: function() {
  70. let that = this;
  71. if (that.loading == true || that.loaded == true) return;
  72. that.loading = true;
  73. getCommissionInfo(that.where, that.types).then(
  74. res => {
  75. that.loading = false;
  76. that.loaded = res.data.length < that.where.limit;
  77. that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
  78. that.where.page = that.where.page + 1;
  79. that.info.push.apply(that.info, res.data);
  80. },
  81. error => {
  82. that.$dialog.message(error.msg);
  83. }
  84. );
  85. },
  86. getCommission: function() {
  87. let that = this;
  88. getSpreadInfo().then(
  89. res => {
  90. that.commission = res.data.commissionCount;
  91. },
  92. error => {
  93. this.$dialog.message(error.msg);
  94. }
  95. );
  96. }
  97. }
  98. };
  99. </script>