team.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="content">
  3. <view class="view1">
  4. <view class="flex">
  5. <view class="view1_item">
  6. <view class="view1_itemmoney">{{ teamCount }} <text>人</text> </view>
  7. <view class="view1_itemname">已邀请</view>
  8. </view>
  9. <view class="view1_item">
  10. <view class="view1_itemmoney"><text>¥</text>{{ teamMoney }}</view>
  11. <view class="view1_itemname">我的收益</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="view2" style="border-radius: 20upx;">
  16. <view style="display: flex;flex-direction: row;padding: 20upx;">
  17. <view style="width: 20%;">排名</view>
  18. <view style="width: 50%;">用户</view>
  19. <view style="width: 30%;text-align: center;">收益</view>
  20. </view>
  21. <view style="display: flex;flex-direction: row;padding: 20upx;" v-for="(item, index) in rankingList"
  22. :key="index">
  23. <view style="width: 20%;">
  24. <image v-if="index == 0"
  25. src="https://h5.taidudaojia.cc/file/uploadPath/2023/01/16/f5305e9ce03a6d0269f58ce55e6c3d0d.png"
  26. style="width: 50upx; height: 50upx;"></image>
  27. <image v-if="index == 1"
  28. src="https://h5.taidudaojia.cc/file/uploadPath/2023/01/16/20b80ec8d3f4db15754426697d0054b8.png"
  29. style="width: 50upx; height: 50upx;"></image>
  30. <image v-if="index == 2"
  31. src="https://h5.taidudaojia.cc/file/uploadPath/2023/01/16/6f61f5e7ec61a1d815bee3c9f0af3c58.png"
  32. style="width: 50upx; height: 50upx;"></image>
  33. <view v-if="item.rankNum > 2" style="font-size: 19px; color: #999999; margin-left: 15upx;">
  34. {{ index + 1 }}
  35. </view>
  36. </view>
  37. <view style="width: 50%;display: flex;flex-direction: row;align-items: center;">
  38. <image :src="item.avatar ? item.avatar : '/static/logo.png'"
  39. style="border-radius: 100upx;width: 50upx; height: 50upx;"></image>
  40. <view style="font-size: 14px; color: #333333;margin-left: 20upx; width: 65%;">{{ item.userName }}
  41. </view>
  42. </view>
  43. <view style="width: 30%;text-align: center;">
  44. <view style="font-size: 16px;color: #2FB57A;">¥{{ item.money }}</view>
  45. </view>
  46. </view>
  47. <empty v-if="rankingList.length==0"></empty>
  48. <!-- 加载更多提示 -->
  49. <view class="s-col is-col-24" v-if="rankingList.length > 0">
  50. <load-more :loadingType="loadingType" :contentText="contentText"></load-more>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import empty from '@/components/empty.vue'
  57. export default {
  58. components:{
  59. empty
  60. },
  61. data() {
  62. return {
  63. tabFromIndex: 2,
  64. teamCount: 0,
  65. teamMoney: 0,
  66. rankingList: [],
  67. imageUrl: '/static/logo2.jpg',
  68. money: 0,
  69. nickName: '游客',
  70. rankNum: 0,
  71. page: 1,
  72. size: 20,
  73. loadingType: 0,
  74. scrollTop: false,
  75. contentText: {
  76. contentdown: '上拉显示更多',
  77. contentrefresh: '正在加载...',
  78. contentnomore: '没有更多数据了'
  79. }
  80. };
  81. },
  82. onLoad() {
  83. let userId = this.$queue.getData('userId');
  84. if (userId) {
  85. this.getRankingList(userId);
  86. this.getUserInfo();
  87. }
  88. },
  89. onPageScroll: function(e) {
  90. this.scrollTop = e.scrollTop > 200;
  91. },
  92. methods: {
  93. getUserInfo() {
  94. let userId = this.$queue.getData('userId');
  95. this.$Request.getT('/app/artificer/selectTeamStatistics?userId=' + userId + '&type=' + this.tabFromIndex)
  96. .then(res => {
  97. if (res.code == 0) {
  98. this.teamCount = res.data.teamCount ? res.data.teamCount : 0;
  99. this.teamMoney = res.data.teamMoney ? res.data.teamMoney : 0;
  100. }
  101. });
  102. },
  103. getRankingList() {
  104. this.loadingType = 1;
  105. uni.showLoading({
  106. title: '加载中...'
  107. });
  108. let userId = this.$queue.getData('userId');
  109. this.$Request.getT('/app/artificer/selectTeamUserList?type=' + this.tabFromIndex + '&page=' + this.page +
  110. '&limit=' + this
  111. .size +
  112. '&userId=' + userId).then(res => {
  113. if (res.code === 0) {
  114. if (this.page === 1) {
  115. this.rankingList = [];
  116. }
  117. res.data.list.forEach(d => {
  118. this.rankingList.push(d);
  119. });
  120. if (res.data.list.length === this.size) {
  121. this.loadingType = 0;
  122. } else {
  123. this.loadingType = 3;
  124. }
  125. } else {
  126. this.loadingType = 2;
  127. }
  128. uni.hideLoading();
  129. });
  130. }
  131. },
  132. onReachBottom: function() {
  133. this.page = this.page + 1;
  134. this.getRankingList();
  135. },
  136. onPullDownRefresh: function() {
  137. this.page = 1;
  138. this.getRankingList();
  139. }
  140. };
  141. </script>
  142. <style lang="scss">
  143. page {
  144. background: #F5F5F5;
  145. }
  146. .bg {
  147. background: #FFFFFF;
  148. }
  149. .view1 {
  150. background-color: #ffffff;
  151. width: 93%;
  152. height: 270upx;
  153. margin-left: 26upx;
  154. border-radius: 20upx;
  155. margin-top: 20upx;
  156. border-radius: 20upx;
  157. image {
  158. width: 586rpx;
  159. height: 88rpx;
  160. margin: 80rpx 50rpx 0rpx;
  161. }
  162. .view1_item {
  163. margin: 60upx 0 0 0;
  164. height: 100upx;
  165. flex: 1;
  166. text-align: center;
  167. .view1_itemmoney {
  168. font-size: 56rpx;
  169. font-family: PingFang SC;
  170. font-weight: 800;
  171. color: #333333;
  172. text {
  173. font-size: 28rpx;
  174. }
  175. }
  176. .view1_itemname {
  177. font-size: 28rpx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. color: #999999;
  181. margin-top: 30rpx;
  182. }
  183. }
  184. }
  185. .title_btn {
  186. height: 78upx;
  187. line-height: 78upx;
  188. color: #333333;
  189. /* background: #f7f7f7; */
  190. }
  191. .bgCol2 {
  192. color: #2FB57A;
  193. background: #EAFFF5;
  194. }
  195. .view2 {
  196. background-color: #ffffff;
  197. width: 93%;
  198. height: 100%;
  199. margin-left: 26upx;
  200. border-radius: 20upx;
  201. margin-bottom: 20upx;
  202. margin-top: 20rpx;
  203. }
  204. </style>