myTeam.vue 5.5 KB

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