index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="distribution">
  3. <!-- header -->
  4. <cu-custom isBack bgColor="bg-gradual-blue"><view slot="content">分销中心</view></cu-custom>
  5. <view class="grid col-3 text-center bg-white padding">
  6. <view>
  7. <view>合计购买次数</view>
  8. <view>{{params.sum_count}}</view>
  9. </view>
  10. <view>
  11. <view>累计现金收益</view>
  12. <view>{{params.sum_cash}}</view>
  13. </view>
  14. <view>
  15. <view>累计积分收益</view>
  16. <view>{{params.sum_point}}</view>
  17. </view>
  18. </view>
  19. <view class="cu-bar search bg-white border">
  20. <view class="search-form round">
  21. <text class="cuIcon-search"></text>
  22. <input type="text" placeholder="下级分销商姓名" confirm-type="search"></input>
  23. </view>
  24. <view class="action">
  25. <button class="cu-btn bg-green shadow-blur round">搜索</button>
  26. </view>
  27. </view>
  28. <view class="flex border padding-lr bg-white">
  29. <view class="text-center text-black text-cut text-bold lineheight">序号</view>
  30. <view class="text-center text-black text-cut text-bold lineheight ">姓名</view>
  31. <view class="text-center text-black text-cut text-bold lineheight ">消费金额</view>
  32. <view class=" text-center text-black text-cut text-bold lineheight ">消费积分</view>
  33. </view>
  34. <view class="flex border padding-lr bg-white">
  35. <view class="text-center text-black text-cut text-bold lineheight ">合计</view>
  36. <view class="text-center text-black text-cut text-bold lineheight "> </view>
  37. <view class="text-center text-black text-cut text-bold lineheight ">{{params.sum_amount}}</view>
  38. <view class="text-center text-black text-cut text-bold lineheight "> </view>
  39. </view>
  40. <!-- section -->
  41. <view class="bg-white">
  42. <cu-scrollView @scroll="scrollFunc" @refresherpulling="refresherpulling" :height="height">
  43. <view class="section padding">
  44. <view v-for="(item,index) in ListValue" :key="index" class="row">
  45. <view class="cell text-center padding-tb-sm text-cut bordera">{{index+1}}</view>
  46. <view class="cell text-center padding-tb-sm text-cut bordera">{{item.name}}</view>
  47. <view class="cell text-center padding-tb-sm text-cut bordera">{{item.total_amount}}</view>
  48. <view class="cell text-center padding-tb-sm text-cut bordera">{{item.total_count}}</view>
  49. </view>
  50. </view>
  51. <!-- 状态管理 -->
  52. <view class="cu-load" :class="{ loading: currentPage <= totalPage, over: currentPage > totalPage }"></view>
  53. </cu-scrollView>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {CustomBarHeight} from "@/common/device/index.js";
  59. import api from "./api.js";
  60. export default {
  61. data(){
  62. return {
  63. ListValue:[],
  64. totalPage:1,
  65. currentPage:1,
  66. params:{}
  67. }
  68. },
  69. async onShow(){
  70. await this.requestList();
  71. },
  72. methods:{
  73. async requestList (status){
  74. let {currentPage,totalPage,ListValue}=this;
  75. if (status){
  76. currentPage=1,totalPage=1;ListValue=[]
  77. };
  78. if(currentPage>totalPage) return false;
  79. var result=await api.detail({limit:10,page:currentPage});
  80. if(result.code!=0) return false;
  81. this.currentPage=currentPage+1;
  82. this.totalPage = result.totalPage;
  83. this.ListValue =ListValue.concat(result.data.data);
  84. this.params=result.data.footer;
  85. },
  86. async refresherpulling(){
  87. await this.requestList();
  88. },
  89. async scrollFunc(){
  90. await this.requestList();
  91. }
  92. },
  93. computed:{
  94. height(){
  95. let value=CustomBarHeight;
  96. return `calc(100vh - ${value}px - 359rpx)`
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .distribution{
  103. .border{
  104. position: relative;
  105. &::after{
  106. content:"";
  107. width: 100%;
  108. position: absolute;
  109. bottom: 0;left: 0;
  110. border-bottom: 1upx solid #ccc;
  111. transform: scale(1,0.5);
  112. }
  113. }
  114. .lineheight{
  115. line-height: 80upx;
  116. &:nth-child(1){
  117. width: 10%;
  118. }
  119. &:not(:nth-child(1)){
  120. width: 30%;
  121. }
  122. }
  123. .bordera{
  124. position: relative;
  125. &::after{
  126. content:"";
  127. width: 100%;
  128. position: absolute;
  129. bottom: 0;left: 0;
  130. border-bottom: 1upx solid #eee;
  131. transform: scale(1,0.5);
  132. }
  133. }
  134. .section{
  135. display: table;
  136. width: 100vw;
  137. box-sizing: border-box;
  138. .row{
  139. display: table-row;
  140. .cell{
  141. display: table-cell;
  142. }
  143. .cell:nth-child(1){
  144. width: 10%;
  145. }
  146. .cell:not(:nth-child(1)){
  147. width: 30%;
  148. }
  149. }
  150. .fixed{
  151. position: fixed;left: 0;
  152. width: 100vw;
  153. }
  154. }
  155. }
  156. </style>