jiedian.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="contant">
  3. <view class="jiedian-box" v-for="(item, index) in jieList">
  4. <view class="box-top">
  5. <view class="title-top">
  6. <view class="img">
  7. <image src="../../static/img/jiedian01.png" mode=""></image>
  8. </view>
  9. <view class="title">节点</view>
  10. </view>
  11. <view class="xiangqing" @click="navTo(item.id)">
  12. 详情
  13. <text>></text>
  14. </view>
  15. <!-- <text class="xiangqing" @click="navTo(item.id)">
  16. 详情>
  17. </text> -->
  18. </view>
  19. <view class="box-bottom">
  20. <view class="shouyi">
  21. <view class="jiedian">节点收益</view>
  22. <view class="number">{{ item.get }}</view>
  23. </view>
  24. <view class="shouyi">
  25. <view class="jiedian">团队人数</view>
  26. <view class="number">{{ item.children_num }}</view>
  27. </view>
  28. <view class="shouyi">
  29. <view class="jiedian">参加时间</view>
  30. <view class="number">{{ item.add_time | getTime }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <uni-load-more :status="loadingType"></uni-load-more>
  35. </view>
  36. </template>
  37. <script>
  38. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  39. import {
  40. lookOneself
  41. } from '../../api/user.js';
  42. export default {
  43. data() {
  44. return {
  45. jieList: [],
  46. page: 1, //当前页数
  47. limit: 10, //每次信息条数
  48. loadingType: 'more'
  49. };
  50. },
  51. filters: {
  52. getTime(val) {
  53. let str = '';
  54. if (val) {
  55. const date = new Date(val * 1000);
  56. const year = date.getFullYear();
  57. const mon = date.getMonth() + 1;
  58. const day = date.getDate();
  59. const hours = date.getHours();
  60. const minu = date.getMinutes();
  61. const sec = date.getSeconds();
  62. str = year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  63. }
  64. return str;
  65. }
  66. },
  67. // onLoad() {
  68. // this.lookMyjiedian()
  69. // },
  70. onShow() {
  71. this.lookMyjiedian();
  72. },
  73. onReachBottom() {
  74. this.lookMyjiedian();
  75. },
  76. methods: {
  77. lookMyjiedian() {
  78. let obj = this;
  79. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  80. return;
  81. }
  82. obj.loadingType = 'loading';
  83. lookOneself({
  84. page: obj.page,
  85. limit: obj.limit
  86. }).then(res => {
  87. console.log(res);
  88. obj.jieList = obj.jieList.concat(res.data.points);
  89. if (res.data.points.length != obj.limit) {
  90. obj.loadingType = 'noMore';
  91. } else {
  92. obj.loadingType = 'more';
  93. obj.page++;
  94. }
  95. console.log(obj.loadingType, '2222222');
  96. });
  97. },
  98. navTo(id) {
  99. uni.navigateTo({
  100. url: './jiedianDetails?id=' + id
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. page,
  108. .contant {
  109. // background: #F3F3F3;
  110. margin: 0;
  111. padding: 0;
  112. height: 100%;
  113. width: 100%;
  114. }
  115. .jiedian-box {
  116. background: #ffffff;
  117. display: flex;
  118. flex-direction: column;
  119. padding: 30rpx;
  120. justify-content: space-between;
  121. margin: 20rpx 30rpx;
  122. border-radius: 15rpx;
  123. box-shadow: 2px 2px 0px #ebeef5;
  124. }
  125. .box-top {
  126. display: flex;
  127. justify-content: space-between;
  128. text-align: center;
  129. line-height: 1;
  130. .title-top {
  131. display: flex;
  132. justify-content: center;
  133. text-align: center;
  134. .img {
  135. width: 40rpx;
  136. height: 40rpx;
  137. image {
  138. width: 100%;
  139. height: 100%;
  140. }
  141. }
  142. .title {
  143. margin-left: 5rpx;
  144. font-size: 32rpx;
  145. font-weight: bold;
  146. }
  147. }
  148. .xiangqing {
  149. color: red;
  150. font-size: 28rpx;
  151. line-height: 40rpx;
  152. text {
  153. display: inline-block;
  154. margin-left: 10rpx;
  155. }
  156. }
  157. }
  158. .box-bottom {
  159. margin-top: 20rpx;
  160. display: flex;
  161. flex-direction: column;
  162. justify-content: space-between;
  163. text-align: center;
  164. }
  165. .shouyi {
  166. margin: 6rpx 0;
  167. display: flex;
  168. justify-content: space-between;
  169. }
  170. .jiedian {
  171. font-size: 26rpx;
  172. color: #999999;
  173. }
  174. .number {}
  175. </style>