myTeam.vue 5.3 KB

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