yaoqing.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="content">
  3. <view class="view1" style="box-shadow: rgba(183, 183, 183, 0.3) 1px 1px 10px 1px;border-radius: 20upx;margin-bottom: 20upx;">
  4. <view style="display: flex;">
  5. <view style="margin: 70upx 0 0 20upx;height: 100upx; width: 300upx; text-align: center;">
  6. <view style="font-size: 40upx;color: #333333;">{{ total }}</view>
  7. <view style="font-size: 28upx;color: #666666;">邀请好友(人)</view>
  8. </view>
  9. <view style="margin: 70upx 0 0 75upx;height: 100upx; width: 300upx;text-align: center;">
  10. <view style="font-size: 40upx;color: #333333;">{{ money }}</view>
  11. <view style="font-size: 28upx;color: #666666;">总收益</view>
  12. </view>
  13. </view>
  14. <button class="yaoqing_btn" @click="goYao">邀请好友</button>
  15. </view>
  16. <view class="navbar" style="border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;margin-left: 26rpx;width: 93%;">
  17. <view class="nav-item" :class="{current: index == 1}" @tap="zhishu(1)">
  18. 直属收益
  19. </view>
  20. <view class="nav-item" :class="{current: index == 2}" @tap="tuan(2)">
  21. 非直属收益
  22. </view>
  23. </view>
  24. <view class="view2" style="margin-bottom: 50rpx;">
  25. <view style="display: flex;flex-direction: row;padding: 20upx;">
  26. <view style="width: 20%;">排名</view>
  27. <view style="width: 50%;">昵称</view>
  28. <view style="width: 30%;text-align: center;">累计贡献</view>
  29. </view>
  30. <view style="display: flex;flex-direction: row;padding: 20upx;" v-for="(item, index) in list" :key="index">
  31. <view style="width: 20%;">
  32. <image v-if="index + 1 == 1" src="/static/image/paihang_1.png" style="width: 40upx; height: 40upx;"></image>
  33. <image v-if="index + 1 == 2" src="/static/image/paihang_2.png" style="width: 40upx; height: 40upx;"></image>
  34. <image v-if="index + 1 == 3" src="/static/image/paihang_3.png" style="width: 40upx; height: 40upx;"></image>
  35. <view v-if="index + 1 > 3" style="font-size: 28upx; color: #000000; margin-left: 15upx;margin-top: 6upx;">{{ index + 1 }}</view>
  36. </view>
  37. <view style="width: 50%;display: flex;flex-direction: row;align-items: center;">
  38. <view style="font-size: 14px; color: #333333;width: 65%;">{{ item.userName }}</view>
  39. </view>
  40. <view style="width: 30%;text-align: center;">
  41. <view style="font-size: 16px;color: #FF580B;">¥{{ item.moneySum }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. list: [],
  52. index: 1,
  53. money: 0,
  54. toBase64Url: '',
  55. nickName: '游客',
  56. total: 0
  57. };
  58. },
  59. onLoad() {
  60. let userId = this.$queue.getData('userId');
  61. if (userId) {
  62. this.$Request.getT('/ordersRelation/tuanSum?userId=' + userId).then(res => {
  63. if (res.status === 0) {
  64. this.money = res.data.data;
  65. }
  66. });
  67. }
  68. this.getTeamTotal('');
  69. },
  70. methods: {
  71. zhishu(nub) {
  72. this.index = nub
  73. this.getTeamTotal('');
  74. },
  75. tuan(nub) {
  76. this.index = nub
  77. this.getTeamTotal('');
  78. },
  79. goYao() {
  80. uni.navigateTo({
  81. url: '/pages/member/yao'
  82. });
  83. },
  84. getTeamTotal(type) {
  85. let relationId = this.$queue.getData('relation_id');
  86. if (relationId) {
  87. this.$Request.getT('/user/team/users/' + relationId).then(res => {
  88. if (res.status === 0 && res.data) {
  89. this.total = res.data.length;
  90. }
  91. });
  92. uni.showLoading({
  93. title: '加载中...'
  94. });
  95. let userId = this.$queue.getData('userId');
  96. this.$Request.getT('/ordersRelation/team?userId=' + userId + '&type=' + this.index).then(
  97. res => {
  98. if (res.status === 0 && res.data) {
  99. this.list = [];
  100. res.data.data.forEach(d => {
  101. this.list.push(d);
  102. });
  103. }
  104. uni.hideLoading();
  105. });
  106. }
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss">
  112. page {
  113. background: #F8F8F8;
  114. }
  115. .navbar {
  116. display: flex;
  117. height: 40px;
  118. padding: 0 5px;
  119. background: #fff;
  120. position: relative;
  121. z-index: 10;
  122. .nav-item {
  123. flex: 1;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. height: 100%;
  128. font-size: 15px;
  129. color: $font-color-dark;
  130. position: relative;
  131. &.current {
  132. color: $base-color;
  133. &:after {
  134. content: '';
  135. position: absolute;
  136. left: 50%;
  137. bottom: 0;
  138. transform: translateX(-50%);
  139. width: 44px;
  140. height: 0;
  141. border-bottom: 2px solid $base-color;
  142. }
  143. }
  144. }
  145. }
  146. .view1 {
  147. background-color: #ffffff;
  148. width: 93%;
  149. height: 300upx;
  150. margin-left: 26upx;
  151. border-radius: 20upx;
  152. margin-top: 20upx;
  153. }
  154. .view2 {
  155. background-color: #ffffff;
  156. width: 93%;
  157. height: 100%;
  158. margin-left: 26upx;
  159. border-bottom-left-radius: 20rpx;
  160. border-bottom-right-radius: 20rpx;
  161. }
  162. .yaoqing_btn {
  163. width: 80%;
  164. line-height: 80upx;
  165. margin-top: 30upx;
  166. height: 85upx;
  167. color: #FFFFFF;
  168. background-size: 100%;
  169. background: linear-gradient(to right, #ff6d00, #ff0100);
  170. }
  171. </style>