totalPersonnel.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="total-personnel-container">
  3. <JHeader :dark="false" title="累计分销员" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view class="totalClient-topBackImg">
  5. <view class="topBg">
  6. <view class="font-color-8A734A mar-top-30 fs60">{{ subordinateSalesDataTotal }}</view>
  7. <view class="font-color-C5AA7B">累计分销员(人)</view>
  8. </view>
  9. </view>
  10. <view v-if="subordinateSalesDatalist && subordinateSalesDatalist.length" class="content directAwardInfo">
  11. <view class="directAwardTit fs32 font-color-333">我的客户信息</view>
  12. <view v-for="(item, index) in subordinateSalesDatalist" :key="index" class="flex-center clientList-box mar-top-30">
  13. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange(index)">
  14. <view class="directAward-icon flex-row-plus flex-items flex-sp-between">
  15. <view>
  16. <label class="orderId-box name font-color-333 fs28">分销员昵称:{{ item.distributorName }}</label>
  17. <view class="flex-row-plus flex-items mar-top-30 flex-sp-between">
  18. <label class="orderId-box font-color-999">手机号:{{ item.distributorPhone }}</label>
  19. </view>
  20. </view>
  21. <tui-icon
  22. :name="item.ifOpen ? 'arrowup' : 'arrowdown'" :size="30" unit="upx" margin="0"
  23. color="#b7b7b7"
  24. ></tui-icon>
  25. </view>
  26. <view v-if="item.ifOpen == true">
  27. <view class="flex-row-plus flex-itdistributionOrderems mar-top-30 flex-sp-between">
  28. <label class="orderId-box font-color-999">累计下单数:{{ item.orders }}</label>
  29. <label class="commission-box mar-left-70 font-color-999">累计分佣:¥{{ item.price }}</label>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view style="padding-bottom: 45upx;">
  36. <LoadingMore
  37. :status="!isEmpty && !subordinateSalesDatalist.length
  38. ? 'loading' : !isEmpty && subordinateSalesDatalist.length && (subordinateSalesDatalist.length >= subordinateSalesDataTotal) ? 'no-more' : ''"
  39. >
  40. </LoadingMore>
  41. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">这里空空如也~</tui-no-data>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import { getDistributorsDistributorApi } from '../../../api/anotherTFInterface'
  47. export default {
  48. name: 'TotalPersonnel',
  49. data() {
  50. return {
  51. isEmpty: false,
  52. subordinateSalesDatalist: [],
  53. subordinateSalesDataTotal: 0,
  54. queryInfo: {
  55. page: 1,
  56. pageSize: 20,
  57. shopId: 0,
  58. distributorId: 0
  59. }
  60. }
  61. },
  62. onLoad(options) {
  63. this.queryInfo.shopId = options.shopId
  64. this.queryInfo.distributorId = options.distributorId
  65. this.getSubordinateSales()
  66. },
  67. methods: {
  68. getSubordinateSales(isLoadmore) {
  69. uni.showLoading()
  70. getDistributorsDistributorApi(this.queryInfo).then((res) => {
  71. this.subordinateSalesDataTotal = res.data.total
  72. if (isLoadmore) {
  73. this.subordinateSalesDatalist.push(...res.data.list)
  74. } else {
  75. this.subordinateSalesDatalist = res.data.list
  76. }
  77. this.isEmpty = this.subordinateSalesDatalist.length === 0
  78. uni.hideLoading()
  79. })
  80. .catch((e) => {
  81. uni.hideLoading()
  82. })
  83. },
  84. arrowTypeChange(arrowTypeId) {
  85. this.subordinateSalesDatalist[arrowTypeId].ifOpen = this.subordinateSalesDatalist[arrowTypeId].ifOpen == false
  86. }
  87. },
  88. onReachBottom() {
  89. if (this.subordinateSalesDatalist.length < this.subordinateSalesDataTotal) {
  90. ++this.queryInfo.page
  91. this.getSubordinateSales(true)
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="less" scoped>
  97. .total-personnel-container {
  98. min-height: 100%;
  99. background-color: #333333;
  100. box-sizing: border-box;
  101. .totalClient-topBackImg {
  102. padding: 0 20rpx;
  103. .topBg {
  104. height: 196upx;
  105. background-color: #f5e3c7;
  106. margin-top: 50rpx;
  107. text-align: center;
  108. }
  109. .content {
  110. width: 690upx;
  111. background-color: #FFFFFF;
  112. }
  113. }
  114. .directAwardInfo {
  115. width: 100%;
  116. height: 100vh;
  117. background: #F8F8F8;
  118. padding: 0 20rpx;
  119. .directAwardTit {
  120. height: 88rpx;
  121. line-height: 88rpx;
  122. font-size: 32rpx;
  123. color: #333333;
  124. text-align: center;
  125. padding-bottom: 20rpx;
  126. border-bottom: 2rpx solid #EEEEEE;
  127. font-weight: bold;
  128. }
  129. }
  130. .directAward-box {
  131. width: 100%;
  132. display: flex;
  133. justify-content: flex-start;
  134. flex-direction: column;
  135. background-color: #FFFFFF;
  136. padding: 50upx 20upx;
  137. .orderId-box {
  138. width: 320upx;
  139. display: flex;
  140. justify-content: flex-start;
  141. flex-direction: row;
  142. }
  143. label.name {
  144. font-weight: bold;
  145. }
  146. .commission-box {
  147. text-align: right;
  148. }
  149. }
  150. }
  151. </style>