多租户商城-商户小程序端

205 lines
5.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view>
  3. <global-loading />
  4. <view class="totalClient-topBackImg flex-items flex-column">
  5. <view class="topBg">
  6. <view class="font-color-8A734A mar-top-30 fs60">{{SalesCustomerData.total}}</view>
  7. <view class="font-color-C5AA7B">{{$t('page.cumulativecustomer')}}{{$t('common.persons')}}</view>
  8. </view>
  9. </view>
  10. <view class="content directAwardInfo" v-if="SalesCustomerData.total>0">
  11. <view class="directAwardTit fs32 font-color-333">我的客户信息</view>
  12. <view class="flex-center clientList-box mar-top-30" v-for="(item, index) in SalesCustomerDatalist"
  13. :key="index">
  14. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange1(index)">
  15. <view class="directAward-icon flex-row-plus flex-items flex-sp-between">
  16. <view>
  17. <view class="flex-row-plus flex-items mar-top-30 flex-sp-between">
  18. <label class="orderId-box font-color-999">客户昵称{{item.customerName}}</label>
  19. </view>
  20. </view>
  21. <image v-if="item.ifOpen == false" class="arrow-down" src="http://36.138.125.206:8081/ceres-local-file/static/images/arrowDownIcon.png"></image>
  22. <image v-if="item.ifOpen == true" class="arrow-down" src="http://36.138.125.206:8081/ceres-local-file/static/images/arrowUpIcon.png"></image>topColor
  23. </view>
  24. <view v-if="item.ifOpen == true">
  25. <view class="flex-row-plus flex-itdistributionOrderems mar-top-30 flex-sp-between">
  26. <label class="orderId-box font-color-999">手机号{{item.customerPhone}}</label>
  27. </view>
  28. <view class="flex-row-plus flex-itdistributionOrderems mar-top-30 flex-sp-between">
  29. <label class="orderId-box font-color-999">累计下单数{{item.orders}}</label>
  30. <label class="commission-box mar-left-70 font-color-999">累计消费金额¥{{item.price}}</label>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view v-else class="emptyCart-box flex-items-plus flex-column">
  37. <image class="emptyCart-img" src="http://36.138.125.206:8081/ceres-local-file/static/img/bgnull.png"></image>
  38. <label class="font-color-999 fs26 mar-top-30">{{$t('client.emptydata')}}</label>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. const NET = require('../../utils/request')
  44. const API = require('../../config/api')
  45. export default {
  46. data() {
  47. return {
  48. item: {},
  49. SalesCustomerQuery: {
  50. model: {
  51. tenantCode: ''
  52. }
  53. },
  54. SalesCustomerData: [],
  55. shopId: 0,
  56. distributorId: 0,
  57. page: 1, //当前页
  58. pageSize: 10, //每页记录数
  59. loadingType: 0,
  60. SalesCustomerDatalist: []
  61. }
  62. },
  63. onLoad: function(options) {
  64. this.shopId = JSON.parse(options.shopId)
  65. this.distributorId = options.distributorId
  66. this.getSalesCustomer()
  67. },
  68. onReachBottom() {
  69. if (this.loadingType == 1) {
  70. uni.stopPullDownRefresh()
  71. } else {
  72. this.pageSize = this.pageSize + 10
  73. this.getSalesCustomer()
  74. }
  75. },
  76. methods: {
  77. getSalesCustomer() {
  78. // uni.showLoading({
  79. // mask: true,
  80. // title: '加载中...'
  81. // })
  82. NET.request(API.FindSalesCustomerList, {
  83. shopId: this.shopId,
  84. distributorId: this.distributorId,
  85. page: this.page,
  86. pageSize: this.pageSize
  87. }, 'GET').then(res => {
  88. uni.hideLoading()
  89. this.SalesCustomerDatalist = this.SalesCustomerDatalist.concat(res.data.list)
  90. this.SalesCustomerData = res.data
  91. if (res.data.list.length == res.data.total) {
  92. this.loadingType = 1
  93. }
  94. }).catch(res => {
  95. uni.hideLoading()
  96. })
  97. },
  98. arrowTypeChange1(arrowTypeId) {
  99. this.SalesCustomerData.list[arrowTypeId].ifOpen = this.SalesCustomerData.list[arrowTypeId].ifOpen ==
  100. false ? true : false
  101. },
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. page {
  107. background: #333333;
  108. }
  109. .emptyCart-box {
  110. margin-top: 300upx;
  111. .emptyCart-img{
  112. width: 216rpx;
  113. height: 156rpx;
  114. }
  115. }
  116. .totalClient-topBackImg {
  117. width: 100%;
  118. padding: 0 20rpx;
  119. .topBg {
  120. width: 100%;
  121. height: 196upx;
  122. background: url("http://36.138.125.206:8081/ceres-local-file/static/images/totalPersonnelTopBackImg.png") no-repeat;
  123. margin-top: 50rpx;
  124. text-align: center;
  125. }
  126. .content {
  127. width: 690upx;
  128. background-color: #FFFFFF;
  129. .totalClient-left {
  130. width: 170upx;
  131. height: 20upx;
  132. }
  133. .massage-text {
  134. padding: 0 20upx;
  135. }
  136. }
  137. }
  138. .top {
  139. height: 50upx;
  140. background-image: linear-gradient(#FF8E14, #FFFFFF);
  141. }
  142. .directAwardInfo {
  143. width: 100%;
  144. height: 100vh;
  145. background: #F8F8F8;
  146. padding: 0 20rpx;
  147. .directAwardTit {
  148. height: 88rpx;
  149. line-height: 88rpx;
  150. font-size: 32rpx;
  151. color: #333333;
  152. text-align: center;
  153. padding-bottom: 20rpx;
  154. border-bottom: 2rpx solid #EEEEEE;
  155. font-weight: bold;
  156. }
  157. }
  158. .uni-collapse-cell[data-v-8f47561c] {
  159. -webkit-box-orient: vertical;
  160. -webkit-box-direction: normal;
  161. -webkit-flex-direction: column;
  162. flex-direction: column;
  163. border-color: #c8c7cc;
  164. border-bottom-width: 1px;
  165. border-bottom-style: none;
  166. }
  167. .directAward-box {
  168. width: 100%;
  169. display: flex;
  170. justify-content: flex-start;
  171. flex-direction: column;
  172. background-color: #FFFFFF;
  173. padding: 50upx 20upx;
  174. .orderId-box {
  175. width: 320upx;
  176. display: flex;
  177. justify-content: flex-start;
  178. flex-direction: row;
  179. }
  180. label.name {
  181. font-weight: bold;
  182. }
  183. .commission-box {
  184. text-align: right;
  185. }
  186. .arrow-down {
  187. width: 24upx;
  188. height: 24upx;
  189. }
  190. .upBox {
  191. border-top: 1upx solid #EDEDED;
  192. margin-top: 30upx;
  193. }
  194. }
  195. </style>