today.vue 4.4 KB

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