myTeam.vue 5.7 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. <view class="info-cell">
  17. <view class="cell">{{data.recommend_achievement || 0}}T</view>
  18. <view class="cell-title">分享业绩</view>
  19. </view>
  20. <view class="info-cell" >
  21. <view class="cell">{{data.group_achievenent || 0}}T</view>
  22. <view class="cell-title">我的业绩</view>
  23. </view>
  24. <view class="info-cell" >
  25. <view class="cell">{{data.today_achievement || 0}}T</view>
  26. <view class="cell-title">今日新增业绩</view>
  27. </view>
  28. </view>
  29. <view class="list-cell" v-if="list.length > 0">
  30. <view class="cell-name flex">
  31. <view class="title">成员信息</view>
  32. <view class="title-box flex">
  33. <view class="title">等待算力</view>
  34. <view class="title">算力</view>
  35. <view class="title">等级</view>
  36. </view>
  37. </view>
  38. <view class="cell-box flex" v-for="(ls,index) in list" :key='index'>
  39. <view class="cell-tit flex_item">
  40. <image :src="ls.avatar"></image>
  41. <view class="tit-box">
  42. <!-- <view class="tit-tpl clamp">{{ls.nickname}}</view>
  43. <view class="tit-tip">{{ls.phone}}</view> -->
  44. <view class="tit-tpl clamp">{{ls.phone}}</view>
  45. <view class="tit-tip">{{ls.uid}}</view>
  46. </view>
  47. </view>
  48. <view class="flex num-box">
  49. <view class="num clamp">{{ls.wait_mining}}T</view>
  50. <view class="num clamp">{{ls.mining}}T</view>
  51. <view class="level">V{{ls.level}}</view>
  52. </view>
  53. </view>
  54. <view class="nav flex" v-show="page == 1 && isLast">
  55. <view class="next" @click="last" v-if="page != 1">
  56. 上一页
  57. </view>
  58. <view class="next" v-else>
  59. 已经是第一页了
  60. </view>
  61. <view class="next" v-if="isLast" @click="next">
  62. 下一页
  63. </view>
  64. <view class="next" v-else>
  65. 已经是最后一页了
  66. </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. },
  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.list)
  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-color: #5771DF;
  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. .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>