jiedian.vue 3.6 KB

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