myteam.vue 5.9 KB

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