history.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="log-list">
  3. <!-- 提现记录 -->
  4. <view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
  5. <view class="log-item">
  6. <view class="log-item-view">
  7. <view class="title">{{
  8. item.distributionCashStatus == "APPLY"
  9. ? "待处理"
  10. : item.distributionCashStatus == "PASS"
  11. ? "通过"
  12. : "拒绝"
  13. }}</view>
  14. <view class="price">+{{ item.price | unitPrice }}</view>
  15. </view>
  16. <view class="log-item-view">
  17. <view>{{ item.createTime }}</view>
  18. <view></view>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 分销业绩 -->
  23. <view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
  24. <view class="log-item">
  25. <view class="log-item-view">
  26. <view class="title">{{item.goodsName}}</view>
  27. <view class="price">+{{ item.rebate | unitPrice }}</view>
  28. </view>
  29. <view class="log-item-view">
  30. <view>{{ item.createTime }}</view>
  31. <view>{{item.storeName}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="empty" v-if="empty">
  36. <u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import { cashLog, distributionOrderList } from "@/api/goods";
  42. export default {
  43. data() {
  44. return {
  45. cashLogData: [], //提现记录数据集合
  46. achievementData: [], //分销业绩数据合集,
  47. status: "loadmore",
  48. iconType: "flower",
  49. empty: false,
  50. params: {
  51. pageNumber: 1,
  52. pageSize: 10,
  53. },
  54. type: 0,
  55. routers: "",
  56. achParams: {
  57. distributionId: (this.routers && this.routers.id) || "", //分销商id
  58. distributionName: (this.routers && this.routers.name) || "", //分销商名称
  59. distributionOrderStatus: "", //分销商订单状态
  60. pageNumber: 1,
  61. pageSize: 10,
  62. },
  63. };
  64. },
  65. onLoad(option) {
  66. let title;
  67. option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
  68. uni.setNavigationBarTitle({
  69. title: title, //这是修改后的导航栏文字
  70. });
  71. this.routers = option;
  72. option.type == 0 ? this.achievement() : this.history();
  73. },
  74. mounted() {},
  75. onReachBottom() {
  76. this.status = "loading";
  77. this.params.pageNumber++;
  78. this.type == 1 ? this.history() : this.achievement();
  79. },
  80. methods: {
  81. // 业绩
  82. achievement() {
  83. uni.showLoading({
  84. title: "加载中",
  85. });
  86. distributionOrderList(this.achParams).then((res) => {
  87. if (res.data.success && res.data.result.records.length >= 1) {
  88. this.achievementData = res.data.result.records;
  89. } else {
  90. this.status = "nomore";
  91. this.empty = true;
  92. }
  93. uni.hideLoading();
  94. });
  95. },
  96. // 初始化提现历史
  97. history() {
  98. uni.showLoading({
  99. title: "加载中",
  100. });
  101. cashLog(this.params).then((res) => {
  102. if (res.data.success && res.data.result.records.length >= 1) {
  103. this.cashLogData = res.data.result.records;
  104. } else {
  105. this.status = "nomore";
  106. this.empty = true;
  107. }
  108. uni.hideLoading();
  109. });
  110. },
  111. },
  112. };
  113. </script>
  114. <style lang="scss" scoped>
  115. .empty {
  116. margin: 40rpx 0;
  117. }
  118. .price {
  119. color: $main-color;
  120. font-weight: bold;
  121. }
  122. .log-list {
  123. padding: 0 8rpx;
  124. overflow: hidden;
  125. margin: 20rpx 0;
  126. }
  127. .log-way {
  128. margin: 10rpx 0;
  129. overflow: hidden;
  130. background: #fff;
  131. border-radius: 10rpx;
  132. padding: 20rpx 0;
  133. }
  134. .title {
  135. font-size: 30rpx;
  136. font-weight: bold;
  137. }
  138. .log-item-view {
  139. padding: 8rpx 32rpx;
  140. display: flex;
  141. justify-content: space-between;
  142. }
  143. </style>