commission_detail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="MyGroup">
  3. <view class="top-view">
  4. <view class="grade-ul" v-if="tabData.length">
  5. <view class="grade-li" @click="tabChange(index)" :class="[tabIndex === index ? 'grade-on' : '']" v-for="(item, index) in tabData" :key="index">
  6. {{ item.title }}
  7. <view class="ibonfont ibonxiangshangjiantou top-jt-icon" v-if="tabIndex === index"></view>
  8. </view>
  9. </view>
  10. </view>
  11. <scroll-view @scrolltolower="scrollBootom" scroll-y="true" :style="style" class="group-ul">
  12. <view class="group-li" v-for="(item, index) in listData" :key="index">
  13. <view class="user-avator-view"><image class="user-avator" :src="item.avatar" mode="aspectFill"></image></view>
  14. <view class="user-info clearfix">
  15. <view class="user-info-left float_left">
  16. <view class="user-name ellipsis">{{ item.name }}</view>
  17. <view class="user-time">{{item.title}}:¥{{ item.commission || 0 }}</view>
  18. </view>
  19. <view class="user-info-right float_right">
  20. <view class="user-time" style="padding-top: 0;">{{ $_utils.formatDate(item.time) }}</view>
  21. <view class="user-time">{{item.type===1?"收益":"消费"}}:¥{{ item.calcMoney || 0 }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <u-loadmore margin-top="20" v-if="listData.length" :status="loading_status" />
  26. </scroll-view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. computed: {
  32. style() {
  33. const systemInfo = uni.getSystemInfoSync();
  34. return `height: calc(100vh - ${systemInfo.statusBarHeight + 171}px)`;
  35. },
  36. },
  37. data() {
  38. return {
  39. loading_status: 'loadmore',
  40. isLogin: false,
  41. tabData:[
  42. {type:0,title:"子级用户消费",code:"consume"},
  43. {type:1,title:"子级合伙人收益",code:"income"}
  44. ],
  45. tabIndex:0,
  46. listData:[],
  47. page: 1,
  48. pageSize: 10,
  49. pageTotal: 0,
  50. };
  51. },
  52. onLoad(options) {
  53. uni.setNavigationBarColor({
  54. frontColor: '#ffffff',
  55. backgroundColor: '#fe582e'
  56. });
  57. },
  58. onShow() {
  59. this.getData();
  60. },
  61. methods: {
  62. getData(){
  63. var that = this;
  64. let post={page: this.page,pageSize: this.pageSize,code:this.tabData[this.tabIndex].code}
  65. this.load_status = 'loading';
  66. this.$u.api.getCommissionDetail(post).then(res=>{
  67. uni.stopPullDownRefresh();
  68. if (that.page === 1) {
  69. that.listData = res.data.data;
  70. } else {
  71. that.listData = that.listData.concat(res.data.data);
  72. }
  73. that.total = res.data.total;
  74. that.load_status = that.$_utils.loadStatus(that.page, that.pageSize, that.total);
  75. }).catch(err=>{
  76. uni.stopPullDownRefresh();
  77. that.load_status = 'nomore';
  78. })
  79. },
  80. scrollBootom() {
  81. if (this.pageTotal / this.pageSize > this.page) {
  82. this.page += 1;
  83. this.getData();
  84. }
  85. },
  86. tabChange(index) {
  87. this.tabIndex = index;
  88. this.page = 1;
  89. this.getData();
  90. }
  91. }
  92. };
  93. </script>
  94. <style lang="scss">
  95. .top-view {
  96. color: #ffffff;
  97. background-color: #fe582e;
  98. .num-ul {
  99. padding: 40upx 0;
  100. display: flex;
  101. .num-li {
  102. flex: 2;
  103. text-align: center;
  104. .num-li-tit {
  105. font-size: 24upx;
  106. }
  107. .num-li-num {
  108. font-size: 40upx;
  109. padding-top: 30upx;
  110. }
  111. }
  112. .num-li-line {
  113. width: 1upx;
  114. height: 56upx;
  115. background-color: #fff;
  116. opacity: 0.5;
  117. transform: translateY(70upx);
  118. }
  119. }
  120. .grade-ul {
  121. background-color: rgba($color: #ffffff, $alpha: 0.2);
  122. font-size: 28upx;
  123. display: flex;
  124. color: rgba($color: #ffffff, $alpha: 0.7);
  125. .grade-li {
  126. flex: 2;
  127. text-align: center;
  128. line-height: 90upx;
  129. position: relative;
  130. .top-jt-icon {
  131. position: absolute;
  132. bottom: -10upx;
  133. left: 50%;
  134. transform: translateX(-50%);
  135. display: block;
  136. height: 30upx;
  137. line-height: 30upx;
  138. font-size: 32upx;
  139. color: rgba($color: #ffffff, $alpha: 1);
  140. }
  141. }
  142. .grade-on {
  143. color: rgba($color: #ffffff, $alpha: 1);
  144. font-size: 32upx;
  145. }
  146. }
  147. }
  148. .total-view {
  149. line-height: 90upx;
  150. color: #3d404d;
  151. background-color: #fff1f0;
  152. font-size: 24upx;
  153. .total-left {
  154. .left-num {
  155. padding: 0 24upx;
  156. display: inline-block;
  157. }
  158. .line-num {
  159. display: inline-block;
  160. width: 2upx;
  161. height: 28upx;
  162. background-color: #fff;
  163. }
  164. }
  165. }
  166. .group-ul {
  167. .group-li {
  168. padding: 20upx;
  169. background-color: #fff;
  170. border-radius: 8upx;
  171. .user-avator-view {
  172. display: inline-block;
  173. padding-right: 20upx;
  174. .user-avator {
  175. display: block;
  176. width: 100upx;
  177. height: 100upx;
  178. border-radius: 100%;
  179. }
  180. }
  181. .user-info {
  182. border-bottom: 1upx solid #f4f4f4;
  183. width: 588upx;
  184. display: inline-block;
  185. padding-bottom: 20upx;
  186. .user-name{
  187. width: 310rpx;
  188. -webkit-line-clamp:1;
  189. height: 40rpx;
  190. line-height: 40rpx;
  191. }
  192. .user-time {
  193. color: #999;
  194. font-size: 24upx;
  195. padding-top: 10upx;
  196. }
  197. .user-info-right {
  198. text-align: right;
  199. }
  200. }
  201. }
  202. }
  203. </style>