myTeam.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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" @click="navto()">
  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. console.log(this.isLast)
  119. });
  120. },
  121. nav(url){
  122. uni.navigateTo({
  123. url:url
  124. })
  125. },
  126. navto(url){
  127. uni.navigateTo({
  128. url:'/pages/finance/today?num=' + this.data.today_achievement
  129. })
  130. },
  131. next(){
  132. this.page = this.page + 1;
  133. this.loadData();
  134. this.loadDataNext();
  135. console.log(this.page)
  136. },
  137. last(){
  138. if(this.page != 1){
  139. this.page = this.page - 1;
  140. }
  141. this.loadData();
  142. this.loadDataNext();
  143. }
  144. }
  145. };
  146. </script>
  147. <style lang="scss">
  148. page {
  149. min-height: 100%;
  150. background-color: #ffffff;
  151. .container {
  152. width: 100%;
  153. }
  154. }
  155. .list-box{
  156. width: 100%;
  157. padding: 50rpx 41rpx;
  158. padding-top: 80rpx !important;
  159. background-color: #5771DF;
  160. position: relative;
  161. .list-title{
  162. position: absolute;
  163. top: 80rpx;
  164. color: #FFFFFF;
  165. left: 40%;
  166. font-size: 36rpx;
  167. }
  168. .list-tpl{
  169. background-color: #FFFFFF;
  170. width: 314rpx;
  171. height: 168rpx;
  172. text-align: center;
  173. padding-top:40rpx;
  174. border-radius: 15rpx;
  175. .num{
  176. font-size: 36rpx;
  177. font-weight: bold;
  178. color: #333333;
  179. padding-bottom: 15rpx;
  180. }
  181. .name{
  182. font-size: 26rpx;
  183. font-weight: 500;
  184. color: #999999;
  185. }
  186. }
  187. }
  188. .info-box{
  189. // padding: 25rpx 25rpx;
  190. .info-name{
  191. padding: 40rpx 0rpx;
  192. .info-cell{
  193. width: 33.33%;
  194. text-align: center;
  195. .cell{
  196. font-size: 38rpx;
  197. font-weight: bold;
  198. color: #333333;
  199. }
  200. .cell-title{
  201. font-size: 26rpx;
  202. font-weight: 500;
  203. color: #999999;
  204. padding-top: 20rpx;
  205. }
  206. }
  207. }
  208. .list-cell{
  209. padding: 40rpx 25rpx;
  210. .cell-name{
  211. padding:50rpx 50rpx;
  212. .title-box{
  213. width: 60%;
  214. }
  215. }
  216. .cell-box{
  217. margin-bottom: 94rpx;
  218. .cell-tit{
  219. width: 40%;
  220. image{
  221. width: 80rpx;
  222. height: 80rpx;
  223. border-radius: 100%;
  224. }
  225. .tit-box{
  226. padding-left: 15rpx;
  227. width: 70%;
  228. .tit-tpl{
  229. font-size: 30rpx;
  230. font-weight: 500;
  231. color: #333333;
  232. }
  233. .tit-tip{
  234. font-size: 24rpx;
  235. font-weight: 500;
  236. color: #999999;
  237. padding-top: 20rpx;
  238. }
  239. }
  240. }
  241. .num-box{
  242. width: 60%;
  243. .num{
  244. width: 33.33%;
  245. text-align: center;
  246. }
  247. .level{
  248. background-color: #FED82F;
  249. border-radius: 25rpx;
  250. padding: 8rpx 50rpx;
  251. font-size: 26rpx;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. .empty-box{
  258. margin-top: 60rpx;
  259. width: 100%;
  260. height: 500rpx;
  261. }
  262. .nav{
  263. .next{
  264. margin: 40rpx;
  265. width: 50%;
  266. background-color: #5771DF;
  267. color: #FFFFFF;
  268. text-align: center;
  269. padding:10rpx 0rpx;
  270. border-radius: 50rpx;
  271. }
  272. }
  273. </style>