123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <template>
- <view class="content">
- <view class="bg">
- <image src="../../static/img/jiedianBg.png" mode=""></image>
- </view>
- <view class="box">
- <view class="box-left">
- <view class="top">
- {{childrenNum}}
- </view>
- <view class="bottom">
- 总人数
- </view>
- </view>
- <view class="box-left">
- <view class="top">
- {{money}}
- </view>
- <view class="bottom">
- 收益
- </view>
- </view>
- </view>
- <view class="box-1">
- <view class="tuandui-box" v-for="item in childrenList" @click="next(item.id)">
- <view class="box-img">
- <image :src="item.user.avatar" mode=""></image>
- </view>
- <view class="box-content">
- <view class="content-top">
- <view class="content-top-left">
- <view class="name clamp">
- {{item.user.nickname}}
- </view>
- <view class="time">
- {{item.add_time | getTime}}加入
- </view>
- </view>
- <view class="content-top-right">
- 收益:{{item.get}}
- </view>
- </view>
- <view class="content-bottom">
- <view class="xianlu">
- 线路:{{item.way}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- <view class="btn" v-if="parentList.length != 0" @click="back()">
- 返回上一层
- </view>
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import {
- lookSubpoints,
- lookOneself
- } from '../../api/user.js'
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- dtailId: '',
- parentList:[],//父亲节点
- childrenList: [],
- jieList: [],
- childrenNum: '',
- limit:10,
- page:1,
- loadingType:'more',
- money: '',
- };
- },
- filters: {
- getTime(val) {
- let str = ''
- if (val) {
- const date = new Date(val * 1000);
- const year = date.getFullYear();
- const mon = date.getMonth() + 1;
- const day = date.getDate();
- const hours = date.getHours();
- const minu = date.getMinutes();
- const sec = date.getSeconds();
- str = year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
- }
- return str
- }
- },
- onLoad(option) {
- this.detailId = option.id
- this.lookDetail()
- this.lookMyjiedian()
- },
- methods: {
- lookMyjiedian() {
- let obj = this
- lookOneself().then(res => {
- console.log(res);
- obj.jieList = res.data.points;
- console.log(obj.jieList, '11');
- obj.childrenNum = obj.jieList[0].children_num
- obj.money = obj.jieList[0].get
- console.log(obj.childrenNum, obj.money);
- })
- },
- lookDetail() {
- let obj = this
- if(obj.loadingType=='loading' || obj.loadingType=='noMore'){
- console.log("进入");
- return
- }
- obj.loadingType = 'loading'
- lookSubpoints({
- page:obj.page,
- limit:obj.limit
- }, obj.detailId).then(res => {
- obj.childrenList =obj.childrenList.concat(res.data.children)
- console.log(res,'xuhaolam');
- if(res.data.children.length!=obj.limit){
- console.log(res, '详细数据123');
-
- obj.loadingType='noMore'
-
- }else{
- obj.loadingType='more'
- obj.page++
- }
- console.log(obj.childrenList, '详细数据1');
- })
- },
- next(id) {
- console.log(id,"id");
- if(this.parentList.length == 11) {
- return
- }
- this.parentList.push(this.detailId)
- this.detailId = id
- this.loadingType='more'
- this.childrenList = [],
- this.lookDetail()
- },
- back() {
- this.detailId = this.parentList.pop();
- this.loadingType='more'
- this.childrenList = [],
- this.lookDetail()
- }
- }
- }
- </script>
- <style lang="scss">
- page,
- .content {
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- background: #F3F3F3;
- }
- .box-1 {
- // margin: 0 auto;
- background: #FFFFFF;
- margin-top: 40rpx;
- }
- .bg {
- position: relative;
- width: 750rpx;
- height: 360rpx;
- image {
- height: 100%;
- width: 100%;
- }
- }
- .box {
- position: relative;
- display: flex;
- justify-content: space-around;
- margin-top: -180rpx;
- .box-left {
- z-index: 99;
- width: 280rpx;
- height: 160rpx;
- display: flex;
- flex-direction: column;
- text-align: center;
- justify-content: center;
- background-color: #FFFFFF;
- border-radius: 10rpx;
- }
- .top {
- font-size: 36rpx;
- font-weight: bold;
- }
- .bottom {
- font-size: 24rpx;
- color: #999999;
- margin-top: 10rpx;
- font-weight: bold;
- }
- }
- .tuandui-box {
- margin: 0 auto;
- width: 690rpx;
- display: flex;
- padding: 20rpx;
- border-bottom: 2rpx solid #F3F3F3;
- ;
- .box-img {
- border-radius: 50%;
- width: 80rpx;
- height: 80rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .box-content {
- margin-left: 15rpx;
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .content-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .content-top-left {
- display: flex;
- justify-content: space-between;
- line-height: 40rpx;
- .name {
- width: 120rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 30rpx;
- font-weight: bold;
- }
- .time {
- color: #999999;
- margin-left: 15rpx;
- font-size: 22rpx;
- }
- }
- .content-top-right {
- color: #303133;
- font-size: 26rpx;
- }
- }
- .content-bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .xianlu {
- color: #999999;
- font-size: 22rpx;
- }
- .number {
- color: #303133;
- font-size: 26rpx;
- }
- }
- }
- }
- .btn {
- position: fixed;
- bottom: 30rpx;
- left: 0;
- right: 0;
- margin: 0 auto;
- width: 604rpx;
- height: 90rpx;
- border: 2px solid #F21F5D;
- border-radius: 45rpx;
- font-size: 34rpx;
- font-family: SourceHanSansCN;
- font-weight: 400;
- color: #EF0E74;
- line-height: 90rpx;
- text-align: center;
- }
- </style>
|