<template>
	<view class="container">
		<view class="header">
			<image src="../../static/img/img39.png" mode="scaleToFill"></image>
				<view class="counts">385<text>人</text></view>
				<view class="people">我的推广人数</view>
		</view>
		<!-- 推广 -->
		<view class="navbar">
			<view class="one">5</view>
			<view class="line"></view>
			<view class="two">120</view>
			<view class="nav-item" v-for="(item, index) in navList" :key="index"
				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
		</view>
		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
			>
			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
				<!-- 空白页 -->
				<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
				<!-- 推广奖励 -->
				<scroll-view class="scorll" scroll-y="true" >
					<view class="cost">
						<view class="award" v-for="item in 10">
							<image src="../../static/tabBar/tab-my-current.png" mode="scaleToFill"></image>
							<view class="award-left">
								<view class="text">xxx</view>
								<view class="time">2021-8-26 09:30</view>
							</view>
						</view>
					</view>
				</scroll-view>
		
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
export default {
	data () {
		return {
			height: '',
				tabCurrentIndex: 0,
				navList: [{
						state: 1,
						text: '一级推广',
						loadingType: 'more',
						orderList: [],
						page: 1, //当前页数
						limit: 10 //每次信息条数
					},
					{
						state: 2,
						text: '二级推广',
						loadingType: 'more',
						orderList: [],
						page: 1, //当前页数
						limit: 10 //每次信息条数
					}
				],
				list: [],
				money: ''
		}
	},
	methods: {
		//swiper 切换
		changeTab (e) {
			this.tabCurrentIndex = e.target.current;
			this.loadData('tabChange')
		},
		//顶部tab点击
		tabClick(index) {
			this.tabCurrentIndex = index;
		}
	}
}
</script>

<style lang="scss">
	.container {
		width: 750rpx;
		height: 1334rpx;
		background-color: #fff;
	
		.header {
			position: relative;
			image {
				width: 750rpx;
				height: 460rpx;
			}
			.counts {
				font-size: 72rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #3F7C1F;
				position: absolute;
				top: 35%;
				margin-left: 310rpx;
				text {
					font-size: 12rpx;
				}
			}
			.people {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #3F7C1F;
				position: absolute;
				top: 55%;
				margin-left: 286rpx;
			}
		}
	
		.swiper-box {
			height: calc(100% - 700rpx);
			background-color: #FFFFFF;
		}
		.scorll {
			height: 100%;
		}
		.navbar {
			display: flex;
			padding: 0 5rpx;
			background: #fff;
			position: relative;
			z-index: 10;
			width: 702rpx;
			height: 120rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
			border-radius: 10rpx;
			margin-top: -70rpx;
			margin-left: 25rpx;
			.one {
				position: absolute;
				top: 10%;
				left: 25%;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FF0000;
			}
			.two {
				position: absolute;
				top: 10%;
				left: 70%;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FF0000;
			}
			.line {
				width: 2rpx;
				height: 54rpx;
				background: #EEEEEE;
				position: absolute;
				top: 30%;
				left: 50%;
			}
	
			.nav-item {
				flex: 1;
				display: flex;
				justify-content: center;
				align-items: center;
				height: 100%;
				font-size: 30rpx;
				color: #999999;
				position: relative;
				padding-top: 40rpx;
	
				&.current {
					color: #333333;
	
					&:after {
						content: '';
						position: absolute;
						left: 50%;
						bottom: 0;
						transform: translateX(-50%);
						width: 44px;
						height: 0;
						border-bottom: 2px solid #3F7C1F;
					}
				}
			}
		}
	
		.cost {
			width: 750rpx;
			height: auto;
			background-color: #fff;
	
			.award {
				width: 701rpx;
				height: 132rpx;
				border-bottom: 1px solid #F0F4F8;
				margin-left: 25rpx;
				display: flex;
				align-items: center;
				image {
					width: 80rpx;
					height: 80rpx;
				}
	
				.award-left {
					width: 221rpx;
					height: 40rpx;
					margin-left: 30rpx;
					margin-bottom: 35rpx;
	
					.text {
						width: 58rpx;
						height: 28rpx;
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #3F454B;
						margin-bottom: 16rpx;
					}
	
					.time {
						width: 221rpx;
						height: 20rpx;
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #AEAEAE;
					}
				}
			}
		}
	}
</style>
