allMiner.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="container">
  3. <view class="info-box">
  4. <view class="list-cell" v-if="list.length > 0">
  5. <view class="cell-name flex">
  6. <view class="title">成员信息</view>
  7. <view class="title-box flex">
  8. <view class="title">等待算力</view>
  9. <view class="title">算力</view>
  10. <view class="title">等级</view>
  11. </view>
  12. </view>
  13. <view class="cell-box flex" v-for="(ls,index) in list" :key='index'>
  14. <view class="cell-tit flex_item">
  15. <image :src="ls.avatar"></image>
  16. <view class="tit-box">
  17. <view class="tit-tpl clamp">{{ls.nickname}}</view>
  18. <view class="tit-tip">{{ls.phone}}</view>
  19. </view>
  20. </view>
  21. <view class="flex num-box">
  22. <view class="num clamp">{{ls.wait_mining}}T</view>
  23. <view class="num clamp">{{ls.mining}}T</view>
  24. <view class="level">V{{ls.level}}</view>
  25. </view>
  26. </view>
  27. <view class="nav flex" v-show="page != 1 || isLast">
  28. <view class="next" @click="last" >
  29. 上一页
  30. </view>
  31. <view class="next" @click="next">
  32. 下一页
  33. </view>
  34. </view>
  35. </view>
  36. <view class="empty-box" v-show="list.length === 0"><empty></empty></view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import { miner } from '@/api/finance.js';
  42. import empty from '@/components/empty';
  43. export default {
  44. components: {
  45. empty
  46. },
  47. data() {
  48. return {
  49. loadingType: 'more',
  50. data:'',
  51. list:'',
  52. page: 1,
  53. limit: 5,
  54. isLast: true,
  55. };
  56. },
  57. onLoad(option){
  58. this.loadData("add");
  59. },
  60. onShow() {
  61. },
  62. methods: {
  63. // 请求载入数据
  64. async loadData() {
  65. let obj = this;
  66. // if (type === 'add'){
  67. // if (obj.loadingType === 'nomore'){
  68. // return;
  69. // }
  70. // obj.loadingType = 'loading';
  71. // }else {
  72. // obj.loadingType = 'more';
  73. // }
  74. miner({
  75. page: obj.page,
  76. limit: obj.limit,
  77. }).then(({ data }) => {
  78. console.log(data);
  79. obj.data = data;
  80. obj.list = data.list;
  81. });
  82. },
  83. async loadDataNext() {
  84. let obj = this;
  85. console.log(obj.page)
  86. miner({
  87. page: obj.page + 1,
  88. limit: obj.limit,
  89. }).then(({ data }) => {
  90. if(data.list.length === 0){
  91. obj.isLast = false;
  92. }else{
  93. obj.isLast = true;
  94. }
  95. });
  96. },
  97. next(){
  98. let that = this;
  99. this.page = this.page + 1;
  100. this.loadDataNext();
  101. if(this.isLast){
  102. this.loadData();
  103. }else{
  104. this.page = this.page - 1;
  105. that.$api.msg('已经是最后一页了')
  106. }
  107. },
  108. last(){
  109. let that = this;
  110. if(this.page != 1){
  111. this.page = this.page - 1;
  112. this.loadData();
  113. this.loadDataNext();
  114. }else{
  115. that.$api.msg('已经是第一页了')
  116. }
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. page {
  123. min-height: 100%;
  124. background-color: #ffffff;
  125. .container {
  126. width: 100%;
  127. }
  128. }
  129. .info-box{
  130. .info-name{
  131. padding: 40rpx 0rpx;
  132. .info-cell{
  133. width: 33.33%;
  134. text-align: center;
  135. .cell{
  136. font-size: 38rpx;
  137. font-weight: bold;
  138. color: #333333;
  139. }
  140. .cell-title{
  141. font-size: 26rpx;
  142. font-weight: 500;
  143. color: #999999;
  144. padding-top: 20rpx;
  145. }
  146. }
  147. }
  148. .list-cell{
  149. padding: 10rpx 25rpx;
  150. .cell-name{
  151. padding:50rpx 50rpx;
  152. .title-box{
  153. width: 60%;
  154. }
  155. }
  156. .cell-box{
  157. margin-bottom: 94rpx;
  158. .cell-tit{
  159. width: 40%;
  160. image{
  161. width: 80rpx;
  162. height: 80rpx;
  163. border-radius: 100%;
  164. }
  165. .tit-box{
  166. padding-left: 15rpx;
  167. width: 70%;
  168. .tit-tpl{
  169. font-size: 30rpx;
  170. font-weight: 500;
  171. color: #333333;
  172. }
  173. .tit-tip{
  174. font-size: 24rpx;
  175. font-weight: 500;
  176. color: #999999;
  177. padding-top: 20rpx;
  178. }
  179. }
  180. }
  181. .num-box{
  182. width: 60%;
  183. .num{
  184. width: 33.33%;
  185. text-align: center;
  186. }
  187. .level{
  188. background-color: #FED82F;
  189. border-radius: 25rpx;
  190. padding: 8rpx 50rpx;
  191. font-size: 26rpx;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. .empty-box{
  198. margin-top: 60rpx;
  199. width: 100%;
  200. height: 500rpx;
  201. }
  202. .nav{
  203. position: fixed;
  204. bottom: 50rpx;
  205. left: 0;
  206. right: 0;
  207. width: 100%;
  208. .next{
  209. margin: 40rpx;
  210. width: 50%;
  211. background-color: #5771DF;
  212. color: #FFFFFF;
  213. text-align: center;
  214. padding:10rpx 0rpx;
  215. border-radius: 50rpx;
  216. }
  217. }
  218. </style>