totalClient.vue 4.3 KB

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