jiedianDetails.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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" @click="next(item.id)">
  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 clamp">
  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>
  48. </view>
  49. </view>
  50. </view>
  51. <uni-load-more :status="loadingType"></uni-load-more>
  52. <view class="btn" v-if="parentList.length != 0" @click="back()">
  53. 返回上一层
  54. </view>
  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. parentList:[],//父亲节点
  71. childrenList: [],
  72. jieList: [],
  73. childrenNum: '',
  74. limit:10,
  75. page:1,
  76. loadingType:'more',
  77. money: '',
  78. };
  79. },
  80. filters: {
  81. getTime(val) {
  82. let str = ''
  83. if (val) {
  84. const date = new Date(val * 1000);
  85. const year = date.getFullYear();
  86. const mon = date.getMonth() + 1;
  87. const day = date.getDate();
  88. const hours = date.getHours();
  89. const minu = date.getMinutes();
  90. const sec = date.getSeconds();
  91. str = year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  92. }
  93. return str
  94. }
  95. },
  96. onLoad(option) {
  97. this.detailId = option.id
  98. this.lookDetail()
  99. this.lookMyjiedian()
  100. },
  101. methods: {
  102. lookMyjiedian() {
  103. let obj = this
  104. lookOneself().then(res => {
  105. console.log(res);
  106. obj.jieList = res.data.points;
  107. console.log(obj.jieList, '11');
  108. obj.childrenNum = obj.jieList[0].children_num
  109. obj.money = obj.jieList[0].get
  110. console.log(obj.childrenNum, obj.money);
  111. })
  112. },
  113. lookDetail() {
  114. let obj = this
  115. if(obj.loadingType=='loading' || obj.loadingType=='noMore'){
  116. console.log("进入");
  117. return
  118. }
  119. obj.loadingType = 'loading'
  120. lookSubpoints({
  121. page:obj.page,
  122. limit:obj.limit
  123. }, obj.detailId).then(res => {
  124. obj.childrenList =obj.childrenList.concat(res.data.children)
  125. console.log(res,'xuhaolam');
  126. if(res.data.children.length!=obj.limit){
  127. console.log(res, '详细数据123');
  128. obj.loadingType='noMore'
  129. }else{
  130. obj.loadingType='more'
  131. obj.page++
  132. }
  133. console.log(obj.childrenList, '详细数据1');
  134. })
  135. },
  136. next(id) {
  137. console.log(id,"id");
  138. if(this.parentList.length == 11) {
  139. return
  140. }
  141. this.parentList.push(this.detailId)
  142. this.detailId = id
  143. this.loadingType='more'
  144. this.childrenList = [],
  145. this.lookDetail()
  146. },
  147. back() {
  148. this.detailId = this.parentList.pop();
  149. this.loadingType='more'
  150. this.childrenList = [],
  151. this.lookDetail()
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. page,
  158. .content {
  159. padding: 0;
  160. margin: 0;
  161. height: 100%;
  162. width: 100%;
  163. background: #F3F3F3;
  164. }
  165. .box-1 {
  166. // margin: 0 auto;
  167. background: #FFFFFF;
  168. margin-top: 40rpx;
  169. }
  170. .bg {
  171. position: relative;
  172. width: 750rpx;
  173. height: 360rpx;
  174. image {
  175. height: 100%;
  176. width: 100%;
  177. }
  178. }
  179. .box {
  180. position: relative;
  181. display: flex;
  182. justify-content: space-around;
  183. margin-top: -180rpx;
  184. .box-left {
  185. z-index: 99;
  186. width: 280rpx;
  187. height: 160rpx;
  188. display: flex;
  189. flex-direction: column;
  190. text-align: center;
  191. justify-content: center;
  192. background-color: #FFFFFF;
  193. border-radius: 10rpx;
  194. }
  195. .top {
  196. font-size: 36rpx;
  197. font-weight: bold;
  198. }
  199. .bottom {
  200. font-size: 24rpx;
  201. color: #999999;
  202. margin-top: 10rpx;
  203. font-weight: bold;
  204. }
  205. }
  206. .tuandui-box {
  207. margin: 0 auto;
  208. width: 690rpx;
  209. display: flex;
  210. padding: 20rpx;
  211. border-bottom: 2rpx solid #F3F3F3;
  212. ;
  213. .box-img {
  214. border-radius: 50%;
  215. width: 80rpx;
  216. height: 80rpx;
  217. image {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. .box-content {
  223. margin-left: 15rpx;
  224. width: 100%;
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: space-between;
  228. .content-top {
  229. display: flex;
  230. justify-content: space-between;
  231. align-items: center;
  232. .content-top-left {
  233. display: flex;
  234. justify-content: space-between;
  235. line-height: 40rpx;
  236. .name {
  237. width: 120rpx;
  238. white-space: nowrap;
  239. overflow: hidden;
  240. text-overflow: ellipsis;
  241. font-size: 30rpx;
  242. font-weight: bold;
  243. }
  244. .time {
  245. color: #999999;
  246. margin-left: 15rpx;
  247. font-size: 22rpx;
  248. }
  249. }
  250. .content-top-right {
  251. color: #303133;
  252. font-size: 26rpx;
  253. }
  254. }
  255. .content-bottom {
  256. display: flex;
  257. justify-content: space-between;
  258. align-items: center;
  259. .xianlu {
  260. color: #999999;
  261. font-size: 22rpx;
  262. }
  263. .number {
  264. color: #303133;
  265. font-size: 26rpx;
  266. }
  267. }
  268. }
  269. }
  270. .btn {
  271. position: fixed;
  272. bottom: 30rpx;
  273. left: 0;
  274. right: 0;
  275. margin: 0 auto;
  276. width: 604rpx;
  277. height: 90rpx;
  278. border: 2px solid #F21F5D;
  279. border-radius: 45rpx;
  280. font-size: 34rpx;
  281. font-family: SourceHanSansCN;
  282. font-weight: 400;
  283. color: #EF0E74;
  284. line-height: 90rpx;
  285. text-align: center;
  286. }
  287. </style>