jiedianDetails.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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.info)">
  26. <view class="box-img" v-if="item.info">
  27. <image :src="item.info.avatar" mode=""></image>
  28. </view>
  29. <view class="box-content">
  30. <view class="content-top" v-if="item.info">
  31. <view class="content-top-left">
  32. <view class="name clamp">
  33. {{item.info.nickname}}
  34. </view>
  35. <!-- <view class="time">
  36. {{item.add_time | getTime}}加入
  37. </view> -->
  38. </view>
  39. <!-- <view class="content-top-right">
  40. 收益:{{item.name == 'A'?A_achievement:item.name == 'B'?B_achievement:C_achievement}}
  41. </view> -->
  42. </view>
  43. <view class="content-top" v-else>
  44. 暂无
  45. </view>
  46. <view class="content-bottom">
  47. <view class="xianlu">
  48. 线路:{{item.name}}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="btn" v-if="parentList.length != 0" @click="back()">
  55. 返回上一层
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. mapState,
  62. mapMutations
  63. } from 'vuex';
  64. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  65. import {
  66. lookSubpoints,
  67. lookOneself
  68. } from '@/api/user.js'
  69. export default {
  70. components: {
  71. uniLoadMore
  72. },
  73. data() {
  74. return {
  75. dtailId: '',
  76. parentList: [], //父亲节点
  77. childrenList: [],
  78. jieList: [],
  79. childrenNum: '',
  80. limit: 10,
  81. page: 1,
  82. loadingType: 'more',
  83. money: '',
  84. A_achievement: '',
  85. B_achievement: '',
  86. C_achievement: ''
  87. };
  88. },
  89. filters: {
  90. getTime(val) {
  91. let str = ''
  92. if (val) {
  93. const date = new Date(val * 1000);
  94. const year = date.getFullYear();
  95. const mon = date.getMonth() + 1;
  96. const day = date.getDate();
  97. const hours = date.getHours();
  98. const minu = date.getMinutes();
  99. const sec = date.getSeconds();
  100. str = year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  101. }
  102. return str
  103. }
  104. },
  105. computed: {
  106. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  107. },
  108. onLoad(option) {
  109. this.detailId = option.id
  110. this.A_achievement = this.userInfo.A_achievement
  111. this.B_achievement = this.userInfo.B_achievement
  112. this.C_achievement = this.userInfo.C_achievement
  113. this.lookDetail()
  114. },
  115. methods: {
  116. lookMyjiedian() {
  117. let obj = this
  118. lookOneself().then(res => {
  119. console.log(res);
  120. obj.jieList = res.data.points;
  121. console.log(obj.jieList, '11');
  122. obj.childrenNum = obj.jieList[0].children_num
  123. obj.money = obj.jieList[0].get
  124. console.log(obj.childrenNum, obj.money);
  125. })
  126. },
  127. lookDetail() {
  128. let obj = this
  129. if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  130. return
  131. }
  132. obj.loadingType = 'loading'
  133. lookSubpoints({
  134. uid: obj.detailId
  135. }).then(res => {
  136. let arr = Object.keys(res.data)
  137. arr.forEach(e => {
  138. let info = {
  139. name: '',
  140. info: ''
  141. };
  142. info.name = e;
  143. if (res.data[e]) {
  144. info.info = res.data[e]
  145. }
  146. obj.childrenList.push(info)
  147. })
  148. console.log(obj.childrenList);
  149. })
  150. },
  151. next(id) {
  152. console.log(id, "id");
  153. if (!id) {
  154. return
  155. }
  156. if (this.parentList.length == 11) {
  157. return
  158. }
  159. this.parentList.push(this.detailId)
  160. this.detailId = id.uid
  161. this.A_achievement = id.A_achievement
  162. this.B_achievement = id.B_achievement
  163. this.C_achievement = id.C_achievement
  164. this.loadingType = 'more'
  165. this.childrenList = []
  166. this.lookDetail()
  167. },
  168. back() {
  169. this.detailId = this.parentList.pop();
  170. this.loadingType = 'more'
  171. this.childrenList = [],
  172. this.lookDetail()
  173. }
  174. }
  175. }
  176. </script>
  177. <style lang="scss">
  178. page,
  179. .content {
  180. padding: 0;
  181. margin: 0;
  182. height: 100%;
  183. width: 100%;
  184. background: #F3F3F3;
  185. }
  186. .box-1 {
  187. // margin: 0 auto;
  188. background: #FFFFFF;
  189. margin-top: 40rpx;
  190. }
  191. .bg {
  192. position: relative;
  193. width: 750rpx;
  194. height: 360rpx;
  195. image {
  196. height: 100%;
  197. width: 100%;
  198. }
  199. }
  200. .box {
  201. position: relative;
  202. display: flex;
  203. justify-content: space-around;
  204. margin-top: -180rpx;
  205. .box-left {
  206. z-index: 99;
  207. width: 280rpx;
  208. height: 160rpx;
  209. display: flex;
  210. flex-direction: column;
  211. text-align: center;
  212. justify-content: center;
  213. background-color: #FFFFFF;
  214. border-radius: 10rpx;
  215. }
  216. .top {
  217. font-size: 36rpx;
  218. font-weight: bold;
  219. }
  220. .bottom {
  221. font-size: 24rpx;
  222. color: #999999;
  223. margin-top: 10rpx;
  224. font-weight: bold;
  225. }
  226. }
  227. .tuandui-box {
  228. margin: 0 auto;
  229. width: 690rpx;
  230. display: flex;
  231. padding: 20rpx;
  232. border-bottom: 2rpx solid #F3F3F3;
  233. ;
  234. .box-img {
  235. border-radius: 50%;
  236. width: 80rpx;
  237. height: 80rpx;
  238. image {
  239. width: 100%;
  240. height: 100%;
  241. }
  242. }
  243. .box-content {
  244. margin-left: 15rpx;
  245. width: 100%;
  246. display: flex;
  247. flex-direction: column;
  248. justify-content: space-between;
  249. .content-top {
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. .content-top-left {
  254. display: flex;
  255. justify-content: space-between;
  256. line-height: 40rpx;
  257. .name {
  258. width: 120rpx;
  259. white-space: nowrap;
  260. overflow: hidden;
  261. text-overflow: ellipsis;
  262. font-size: 30rpx;
  263. font-weight: bold;
  264. }
  265. .time {
  266. color: #999999;
  267. margin-left: 15rpx;
  268. font-size: 22rpx;
  269. }
  270. }
  271. .content-top-right {
  272. color: #303133;
  273. font-size: 26rpx;
  274. }
  275. }
  276. .content-bottom {
  277. display: flex;
  278. justify-content: space-between;
  279. align-items: center;
  280. .xianlu {
  281. color: #999999;
  282. font-size: 22rpx;
  283. }
  284. .number {
  285. color: #303133;
  286. font-size: 26rpx;
  287. }
  288. }
  289. }
  290. }
  291. .btn {
  292. position: fixed;
  293. bottom: 30rpx;
  294. left: 0;
  295. right: 0;
  296. margin: 0 auto;
  297. width: 604rpx;
  298. height: 90rpx;
  299. border: 2px solid #F21F5D;
  300. border-radius: 45rpx;
  301. font-size: 34rpx;
  302. font-family: SourceHanSansCN;
  303. font-weight: 400;
  304. color: #EF0E74;
  305. line-height: 90rpx;
  306. text-align: center;
  307. }
  308. </style>