jiedianDetails.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="content">
  3. <view class="bg">
  4. <image src="../../static/img/jiedianBg.png" mode=""></image>
  5. </view>
  6. <view class="box">
  7. <view class="box-left">
  8. <view class="top">
  9. {{childrenNum}}
  10. </view>
  11. <view class="bottom">
  12. 总人数
  13. </view>
  14. </view>
  15. <view class="box-left">
  16. <view class="top">
  17. {{money}}
  18. </view>
  19. <view class="bottom">
  20. 收益
  21. </view>
  22. </view>
  23. </view>
  24. <view class="box-1">
  25. <view class="tuandui-box" v-for="item in childrenList">
  26. <view class="box-img">
  27. <image :src="item.user.avatar" mode=""></image>
  28. </view>
  29. <view class="box-content">
  30. <view class="content-top">
  31. <view class="content-top-left">
  32. <view class="name">
  33. {{item.user.nickname}}
  34. </view>
  35. <view class="time">
  36. {{item.add_time | getTime}}加入
  37. </view>
  38. </view>
  39. <view class="content-top-right">
  40. 收益:{{item.get}}
  41. </view>
  42. </view>
  43. <view class="content-bottom">
  44. <view class="xianlu">
  45. 线路:{{item.way}}
  46. </view>
  47. <!-- <view class="number">
  48. 团队共{{item.parent_id}}人
  49. </view> -->
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <uni-load-more :status="loadingType"></uni-load-more>
  55. </view>
  56. </template>
  57. <script>
  58. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  59. import {
  60. lookSubpoints,
  61. lookOneself
  62. } from '../../api/user.js'
  63. export default {
  64. components: {
  65. uniLoadMore
  66. },
  67. data() {
  68. return {
  69. dtailId: '',
  70. childrenList: [],
  71. jieList: [],
  72. childrenNum: '',
  73. limit:10,
  74. page:1,
  75. loadingType:'more',
  76. money: '',
  77. };
  78. },
  79. filters: {
  80. getTime(val) {
  81. let str = ''
  82. if (val) {
  83. const date = new Date(val * 1000);
  84. const year = date.getFullYear();
  85. const mon = date.getMonth() + 1;
  86. const day = date.getDate();
  87. const hours = date.getHours();
  88. const minu = date.getMinutes();
  89. const sec = date.getSeconds();
  90. str = year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  91. }
  92. return str
  93. }
  94. },
  95. onLoad(option) {
  96. this.detailId = option.id
  97. console.log(this.detailId, '上一个页面');
  98. console.log(option, '22223333');
  99. this.lookDetail()
  100. this.lookMyjiedian()
  101. },
  102. methods: {
  103. lookMyjiedian() {
  104. let obj = this
  105. lookOneself().then(res => {
  106. console.log(res);
  107. obj.jieList = res.data.points.map(e => {
  108. return e
  109. })
  110. console.log(obj.jieList, '11');
  111. obj.childrenNum = obj.jieList[0].children_num
  112. obj.money = obj.jieList[0].get
  113. console.log(obj.childrenNum, obj.money);
  114. })
  115. },
  116. lookDetail() {
  117. let obj = this
  118. if(obj.loadingType=='loading' || obj.loadingType=='noMore'){
  119. return
  120. }
  121. obj.loadingType = 'loading'
  122. lookSubpoints({
  123. page:obj.page,
  124. limit:obj.limit
  125. }, obj.detailId).then(res => {
  126. obj.childrenList =obj.childrenList.concat(res.data.children)
  127. console.log(res,'xuhaolam');
  128. if(res.data.children.length!=obj.limit){
  129. console.log(res, '详细数据123');
  130. obj.loadingType='noMore'
  131. }else{
  132. obj.loadingType='more'
  133. obj.page++
  134. }
  135. console.log(obj.childrenList, '详细数据1');
  136. })
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss">
  142. page,
  143. .content {
  144. padding: 0;
  145. margin: 0;
  146. height: 100%;
  147. width: 100%;
  148. background: #F3F3F3;
  149. }
  150. .box-1 {
  151. // margin: 0 auto;
  152. background: #FFFFFF;
  153. margin-top: 40rpx;
  154. }
  155. .bg {
  156. position: relative;
  157. width: 750rpx;
  158. height: 360rpx;
  159. image {
  160. height: 100%;
  161. width: 100%;
  162. }
  163. }
  164. .box {
  165. position: relative;
  166. display: flex;
  167. justify-content: space-around;
  168. margin-top: -180rpx;
  169. .box-left {
  170. z-index: 99;
  171. width: 280rpx;
  172. height: 160rpx;
  173. display: flex;
  174. flex-direction: column;
  175. text-align: center;
  176. justify-content: center;
  177. background-color: #FFFFFF;
  178. border-radius: 10rpx;
  179. }
  180. .top {
  181. font-size: 36rpx;
  182. font-weight: bold;
  183. }
  184. .bottom {
  185. font-size: 24rpx;
  186. color: #999999;
  187. margin-top: 10rpx;
  188. font-weight: bold;
  189. }
  190. }
  191. .tuandui-box {
  192. margin: 0 auto;
  193. width: 690rpx;
  194. display: flex;
  195. padding: 20rpx;
  196. border-bottom: 2rpx solid #F3F3F3;
  197. ;
  198. .box-img {
  199. border-radius: 50%;
  200. width: 80rpx;
  201. height: 80rpx;
  202. image {
  203. width: 100%;
  204. height: 100%;
  205. }
  206. }
  207. .box-content {
  208. margin-left: 15rpx;
  209. width: 100%;
  210. display: flex;
  211. flex-direction: column;
  212. justify-content: space-between;
  213. .content-top {
  214. display: flex;
  215. justify-content: space-between;
  216. align-items: center;
  217. .content-top-left {
  218. display: flex;
  219. justify-content: space-between;
  220. line-height: 40rpx;
  221. .name {
  222. font-size: 30rpx;
  223. font-weight: bold;
  224. }
  225. .time {
  226. color: #999999;
  227. margin-left: 15rpx;
  228. font-size: 22rpx;
  229. }
  230. }
  231. .content-top-right {
  232. color: #303133;
  233. font-size: 26rpx;
  234. }
  235. }
  236. .content-bottom {
  237. display: flex;
  238. justify-content: space-between;
  239. align-items: center;
  240. .xianlu {
  241. color: #999999;
  242. font-size: 22rpx;
  243. }
  244. .number {
  245. color: #303133;
  246. font-size: 26rpx;
  247. }
  248. }
  249. }
  250. }
  251. </style>