myTeam.vue 5.9 KB

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