myTeam.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="container">
  3. <view class="list-box flex">
  4. <view class="list-tpl">
  5. <view class="num">{{ data.recommend_num || 0 }}</view>
  6. <view class="name">推荐会员数</view>
  7. </view>
  8. <view class="list-tpl" @click="nav('/pages/finance/allMiner')">
  9. <view class="num">{{ data.group_num || 0 }}</view>
  10. <view class="name">团队会员数</view>
  11. </view>
  12. <!-- <view class="list-title">我的团队</view> -->
  13. </view>
  14. <view class="info-box">
  15. <view class="info-name flex">
  16. <scroll-view scroll-x="true" style="width: 750rpx;">
  17. <view class="flex">
  18. <view class="info-cell">
  19. <view class="cell">{{ data.recommend_achievement || 0 }}T</view>
  20. <view class="cell-title">分享业绩</view>
  21. </view>
  22. <view class="info-cell">
  23. <view class="cell">{{ data.group_achievenent || 0 }}T</view>
  24. <view class="cell-title">团队总业绩</view>
  25. </view>
  26. <view class="info-cell">
  27. <view class="cell">{{ data.today_achievement || 0 }}T</view>
  28. <view class="cell-title">今日新增业绩</view>
  29. </view>
  30. <!-- <view class="info-cell">
  31. <view class="cell">{{ data.small_group_achievenent || 0 }}T</view>
  32. <view class="cell-title">小区业绩</view>
  33. </view> -->
  34. </view>
  35. </scroll-view>
  36. </view>
  37. <view class="list-cell" v-if="list.length > 0">
  38. <view class="cell-name flex">
  39. <view class="title">成员信息</view>
  40. <view class="title-box flex">
  41. <view class="title">等待算力</view>
  42. <view class="title">算力</view>
  43. <view class="title">等级</view>
  44. </view>
  45. </view>
  46. <view class="cell-box flex" v-for="(ls, index) in list" :key="index" @click="nav('/pages/user/rake?uid=' + ls.uid)">
  47. <view class="cell-tit flex_item">
  48. <image :src="ls.avatar"></image>
  49. <view class="tit-box">
  50. <!-- <view class="tit-tpl clamp">{{ls.nickname}}</view>
  51. <view class="tit-tip">{{ls.phone}}</view> -->
  52. <view class="tit-tpl ">{{ ls.phone }}</view>
  53. <view class="tit-tip">UID:{{ ls.uid }}</view>
  54. </view>
  55. </view>
  56. <view class="flex num-box">
  57. <view class="num clamp">{{ ls.wait_mining }}T</view>
  58. <view class="num clamp">{{ ls.mining }}T</view>
  59. <view class="level">V{{ ls.level }}</view>
  60. </view>
  61. </view>
  62. <view class="nav flex" v-show="page == 1 && isLast">
  63. <view class="next" @click="last" v-if="page != 1">上一页</view>
  64. <view class="next" v-else>已经是第一页了</view>
  65. <view class="next" v-if="isLast" @click="next">下一页</view>
  66. <view class="next" v-else>已经是最后一页了</view>
  67. </view>
  68. </view>
  69. <view class="empty-box" v-show="list.length === 0"><empty></empty></view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import { spread } from '@/api/finance.js';
  75. import empty from '@/components/empty';
  76. export default {
  77. components: {
  78. empty
  79. },
  80. data() {
  81. return {
  82. page: 1,
  83. limit: 5,
  84. data: '',
  85. list: '',
  86. isLast: true
  87. };
  88. },
  89. onLoad(option) {
  90. this.loadData();
  91. this.loadDataNext();
  92. },
  93. onShow() {},
  94. methods: {
  95. // 请求载入数据
  96. async loadData() {
  97. let obj = this;
  98. spread({
  99. page: obj.page,
  100. limit: obj.limit
  101. }).then(({ data }) => {
  102. obj.data = data;
  103. obj.list = data.list;
  104. console.log(obj);
  105. });
  106. },
  107. async loadDataNext() {
  108. let obj = this;
  109. console.log(obj.page);
  110. spread({
  111. page: obj.page + 1,
  112. limit: obj.limit
  113. }).then(({ data }) => {
  114. if (data.list.length === 0) {
  115. obj.isLast = false;
  116. } else {
  117. obj.isLast = true;
  118. }
  119. });
  120. },
  121. nav(url) {
  122. uni.navigateTo({
  123. url: url
  124. });
  125. },
  126. next() {
  127. this.page = this.page + 1;
  128. this.loadData();
  129. this.loadDataNext();
  130. },
  131. last() {
  132. if (this.page != 1) {
  133. this.page = this.page - 1;
  134. }
  135. this.loadData();
  136. this.loadDataNext();
  137. }
  138. }
  139. };
  140. </script>
  141. <style lang="scss">
  142. page {
  143. min-height: 100%;
  144. background-color: #ffffff;
  145. .container {
  146. width: 100%;
  147. }
  148. }
  149. .list-box {
  150. width: 100%;
  151. padding: 50rpx 41rpx;
  152. padding-top: 80rpx !important;
  153. background-image: url(../../static/user/bg.png);
  154. position: relative;
  155. .list-title {
  156. position: absolute;
  157. top: 80rpx;
  158. color: #ffffff;
  159. left: 40%;
  160. font-size: 36rpx;
  161. }
  162. .list-tpl {
  163. background-color: #ffffff;
  164. width: 314rpx;
  165. height: 168rpx;
  166. text-align: center;
  167. padding-top: 40rpx;
  168. border-radius: 15rpx;
  169. .num {
  170. font-size: 36rpx;
  171. font-weight: bold;
  172. color: #333333;
  173. padding-bottom: 15rpx;
  174. }
  175. .name {
  176. font-size: 26rpx;
  177. font-weight: 500;
  178. color: #999999;
  179. }
  180. }
  181. }
  182. .info-box {
  183. // padding: 25rpx 25rpx;
  184. .info-name {
  185. padding: 40rpx 0rpx;
  186. .info-cell {
  187. width: 33.33%;
  188. text-align: center;
  189. flex-shrink: 0;
  190. .cell {
  191. font-size: 38rpx;
  192. font-weight: bold;
  193. color: #333333;
  194. }
  195. .cell-title {
  196. font-size: 26rpx;
  197. font-weight: 500;
  198. color: #999999;
  199. padding-top: 20rpx;
  200. }
  201. }
  202. }
  203. .list-cell {
  204. padding: 40rpx 25rpx;
  205. .cell-name {
  206. padding: 50rpx 50rpx;
  207. .title-box {
  208. width: 60%;
  209. }
  210. }
  211. .cell-box {
  212. margin-bottom: 94rpx;
  213. .cell-tit {
  214. width: 40%;
  215. image {
  216. width: 80rpx;
  217. height: 80rpx;
  218. border-radius: 100%;
  219. }
  220. .tit-box {
  221. padding-left: 15rpx;
  222. width: 70%;
  223. .tit-tpl {
  224. font-size: 30rpx;
  225. font-weight: 500;
  226. color: #333333;
  227. }
  228. .tit-tip {
  229. font-size: 24rpx;
  230. font-weight: 500;
  231. color: #999999;
  232. padding-top: 20rpx;
  233. }
  234. }
  235. }
  236. .num-box {
  237. width: 60%;
  238. .num {
  239. width: 33.33%;
  240. text-align: center;
  241. }
  242. .level {
  243. background-color: #fed82f;
  244. border-radius: 25rpx;
  245. padding: 8rpx 50rpx;
  246. font-size: 26rpx;
  247. }
  248. }
  249. }
  250. }
  251. }
  252. .empty-box {
  253. margin-top: 60rpx;
  254. width: 100%;
  255. height: 500rpx;
  256. }
  257. .nav {
  258. .next {
  259. margin: 40rpx;
  260. width: 50%;
  261. background-color: #5771df;
  262. color: #ffffff;
  263. text-align: center;
  264. padding: 26rpx 0rpx;
  265. border-radius: 50rpx;
  266. }
  267. }
  268. </style>