allMiner.vue 4.1 KB

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