Ver Fonte

Merge branch 'master' of http://git.liuniu946.com/xuhaolan/paopaoShop

hwq há 3 anos atrás
pai
commit
ce8a77ecfb
6 ficheiros alterados com 452 adições e 51 exclusões
  1. 22 0
      pages.json
  2. 167 37
      pages/user/jiedian.vue
  3. 262 14
      pages/user/jiedianDetails.vue
  4. 1 0
      pages/user/user.vue
  5. BIN
      static/img/jiedian01.png
  6. BIN
      static/img/jiedianBg.png

+ 22 - 0
pages.json

@@ -31,6 +31,28 @@
 					}
 				}
 			}
+		},
+		{
+			"path": "pages/user/jiedianDetails",
+			"style": {
+				"navigationBarTitleText": "节点团队",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
+				}
+			}
+		},
+		{
+			"path": "pages/user/jiedianDetails",
+			"style": {
+				"navigationBarTitleText": "节点团队",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
+				}
+			}
 		}, {
 			"path": "pages/public/login",
 			"style": {

+ 167 - 37
pages/user/jiedian.vue

@@ -1,55 +1,124 @@
 <template>
 	<view class="contant">
-		<view class="jiedian-box" v-for="(item,index) in jieList" @click="navTo(item.id)">
-			<view class="box">
-				<view class="box-title">
-					<text>用户ID</text>
-					{{item.id}}
+		<view class="jiedian-box" v-for="(item,index) in jieList">
+			<view class="box-top">
+				<view class="title-top">
+					<view class="img">
+						<image src="../../static/img/jiedian01.png" mode=""></image>
+					</view>
+					<view class="title">
+						响亮节点
+					</view>
 				</view>
-				<view class="box-content">
-					<text>团队人数</text>
-					{{item.children_num}}
+				<!-- <view class="xiangqing" @click="navTo(item.id)">
+					详情>
+				</view> -->
+				<text class="xiangqing" @click="navTo(item.id)">
+						详情>
+					</text>
+			</view>
+			<view class="box-bottom">
+				<view class="shouyi">
+					<view class="jiedian">
+						节点收益
+					</view>
+					<view class="number">
+						{{item.get}}
+					</view>
 				</view>
-				<view class="box-bottom">
-					<text>收益</text>
-					{{item.get}}
+				<view class="shouyi">
+					<view class="jiedian">
+						团队人数
+					</view>
+					<view class="number">
+						{{item.children_num}}
+					</view>
+				</view>
+				<view class="shouyi">
+					<view class="jiedian">
+						参加时间
+					</view>
+					<view class="number">
+						{{item.add_time | getTime}}
+					</view>
 				</view>
 			</view>
-			<view class="img">
-				<image src="../../static/tabBar/tab-home.png" mode="" ></image>
-			</view>
+
 		</view>
+		<uni-load-more  :status="loadingType"></uni-load-more>
 	</view>
 </template>
 
 <script>
-	import {lookSubpoints, lookOneself } from '../../api/user.js'
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	// import getTime from '../../utils/rocessor.js'
+	import {
+		lookSubpoints,
+		lookOneself
+	} from '../../api/user.js'
 	export default {
 		data() {
 			return {
-				jieList:[]
+				jieList: [],
+				page: 1, //当前页数
+				limit: 10, //每次信息条数
+				loadingType: 'more',
 			};
 		},
-		onLoad() {
-			this.lookMyjiedian()
+		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() {
+		// 	this.lookMyjiedian()
+		// },
 		onShow() {
 			this.lookMyjiedian()
 		},
-		methods:{
-			lookMyjiedian(){
+		onReachBottom(){
+			this.lookMyjiedian()
+		},
+		methods: {
+			lookMyjiedian() {
 				let obj = this
-				lookOneself().then(res=>{
+				if(obj.loadingType=="noMore" ||obj.loadingType=='loading'){
+					return
+					
+				}
+				obj.loadingType ='loading'
+				lookOneself(
+				{
+					page: obj.page,
+					limit: obj.limit
+				}).then(res => {
+					
 					console.log(res);
-					obj.jieList = res.data.points.map(e =>{
-						return e
-					})
-					console.log(obj.jieList,'2222222');
+					obj.jieList = obj.jieList.concat(res.data.points)
+					if(res.data.points.length!=obj.limit){
+						obj.loadingType='noMore'
+						
+					}else{
+						obj.loadingType = 'more'
+						obj.page++
+					}
+					console.log(obj.loadingType, '2222222');
 				})
 			},
-			navTo(id){
+			navTo(id) {
 				uni.navigateTo({
-					url:'./jiedianDetails?id='+id
+					url: './jiedianDetails?id=' + id
 				})
 			}
 		}
@@ -57,19 +126,80 @@
 </script>
 
 <style lang="scss">
-	.jiedian-box{
+	page,.contant {
+		// background: #F3F3F3;
+		
+		margin: 0;
+		padding: 0;
+		height: 100%;
+		width: 100%;
+	}
+
+	.jiedian-box {
+
+		background: #FFFFFF;
 		display: flex;
+		flex-direction: column;
+		padding: 30rpx;
 		justify-content: space-between;
-		margin: 30rpx ;
+		margin: 20rpx 30rpx;
+		border-radius: 15rpx;
+		box-shadow: 2px 2px 0px #EBEEF5;
 	}
 
-.img{
-	width: 50rpx;
-	height: 50rpx
-	;
-	image{
-		width: 100%;
-		height: 100%;
+	.box-top {
+		display: flex;
+		justify-content: space-between;
+		text-align: center;
+
+		.title-top {
+			display: flex;
+			justify-content: center;
+			text-align: center;
+
+			.img {
+				width: 40rpx;
+				height: 40rpx;
+
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.title {
+				margin-left: 5rpx;
+				font-size: 32rpx;
+				font-weight: bold;
+
+			}
+		}
+
+		.xiangqing {
+			color: red;
+			font-size: 28rpx;
+			line-height: 40rpx;
+		}
 	}
-}
+
+	.box-bottom {
+		margin-top: 20rpx;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		text-align: center;
+	}
+
+	.shouyi {
+		margin: 6rpx 0;
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.jiedian {
+		font-size: 26rpx;
+		color: #999999;
+	}
+
+	.number {}
 </style>

+ 262 - 14
pages/user/jiedianDetails.vue

@@ -1,33 +1,148 @@
 <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">
+				<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">
+								{{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 class="number">
+							团队共{{item.parent_id}}人
+						</view> -->
+					</view>
+				</view>
+			</view>
+		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
 	</view>
 </template>
 
 <script>
-	import {lookSubpoints, lookOneself } from '../../api/user.js'
+	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:'',
-				childrenList:[]
+				dtailId: '',
+				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
-			console.log(this.detailId,'上一个页面');
+			console.log(this.detailId, '上一个页面');
+			console.log(option, '22223333');
 			this.lookDetail()
-			
+			this.lookMyjiedian()
+
 		},
-		methods:{
-			lookDetail(){
+		methods: {
+			lookMyjiedian() {
 				let obj = this
-				lookSubpoints(
-				{},obj.detailId
-				).then(res=>{
-					console.log(res,'详细数据');
-					obj.childrenList = res.data.children
-					console.log(obj.childrenList,'详细数据');
+				lookOneself().then(res => {
+
+					console.log(res);
+					obj.jieList = res.data.points.map(e => {
+						return e
+					})
+					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'){
+					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');
 				})
 			}
 		}
@@ -35,5 +150,138 @@
 </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 {
+						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;
+				}
+			}
+		}
+	}
 </style>

+ 1 - 0
pages/user/user.vue

@@ -154,6 +154,7 @@
 						></image>
 					</scroll-view> -->
 					<uni-list>
+						<uni-list-item title="我的节点" @click="navTo('/pages/user/jiedian')" thumb="/static/icon/img10.png"></uni-list-item>
 						<uni-list-item title="我的钱包" @click="navTo('/pages/money/wallet')" thumb="/static/icon/img11.png"></uni-list-item>
 						<uni-list-item title="我的卡卷" @click="navTo('/pages/user/coupon')" thumb="/static/icon/img12.png"></uni-list-item>
 						<uni-list-item title="我的收藏" @click="navTo('/pages/user/favorites')" thumb="/static/icon/img02.png"></uni-list-item>

BIN
static/img/jiedian01.png


BIN
static/img/jiedianBg.png