<template>
	<view class="content">
		<swiper  style="position: absolute;width: 100%;height: 100%;" :current="current" @change="changee">
			<swiper-item>
				<view class="tab1"  >
					<view class="cg-wrap1">
						<view class="tit">
							第一关
						</view>
						<view class="status">
							{{pool.one_pool_sum | showPool}}
						</view>
					</view>
					
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1 " >
					
					<view class="cg-wrap1">
						<view class="tit">
							第二关
						</view>
						<view class="status" >
							{{pool.two_pool_sum | showPool}}
						</view>
					</view>
					
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<!-- <view class="tip">
						{{pool.three_pool_my && pool.three_pool_my.length > 0 ? '恭喜进入': '未进入'}}
					</view> -->
					<view class="cg-wrap1">
						<view class="tit">
							第三关
						</view>
						<view class="status" >
							{{pool.three_pool_sum | showPool}}
						</view>
					</view>
					
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第四关
						</view>
						<view class="status" >
							{{pool.for_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第五关
						</view>
						<view class="status" >
							{{pool.Five_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第六关
						</view>
						<view class="status" >
							{{pool.Six_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第七关
						</view>
						<view class="status" >
							{{pool.Seven_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第八关
						</view>
						<view class="status" >
							{{pool.Eight_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第九关
						</view>
						<view class="status" >
							{{pool.Nine_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第十关
						</view>
						<view class="status" >
							{{pool.Ten_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第十一关
						</view>
						<view class="status" >
							{{pool.Eleven_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
			<swiper-item >
				<view class="tab1  " >
					<view class="cg-wrap1">
						<view class="tit">
							第十二关
						</view>
						<view class="status" >
							{{pool.Twelve_pool_sum | showPool}}
						</view>
					</view>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import {
		getUserInfo,
		userPool,
		myspread
	} from '@/api/user.js';
	export default {
		data() {
			return {
				current: 0,
				pool: {},
				spread:0,
			}
		},
		onShow() {
			this.userPool()
		},
		computed: {
			...mapState('user', ['userInfo'])
		},
		filters: {
			showPool(val) {
				let str = '未激活';
				if(val) {
					if(val == 1) {
						str = '进行中'
					}
					if(val == 2) {
						str = '已晋级'
					}
				}
				return str
			}
		},
		methods: {
			myspread() {
				myspread().then(res => {
					console.log(res)
					this.spread = res.data.total + res.data.totalLevel
				})
			},
			changee(res) {
				console.log(res);
				this.current = res.detail.current
			},
			userPool() {
				userPool().then(res => {
					console.log(res);
					this.myspread()
					this.pool = res.data
				})
			},
			goNest() {
				++this.current
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: auto;
		min-height: 100%;
	}

	.wrap {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;

		.bg {
			width: 100%;
			height: 100%;
			vertical-align: middle;
		}

		.data-wrap {
			width: 750rpx;
			height: 603rpx;
			position: absolute;
			bottom: 10%;

			image {
				width: 100%;
				height: 100%;
			}

			.cg-tit {
				width: 100%;
				font-size: 36rpx;
				font-family: Source Han Sans SC;
				font-weight: bold;
				color: #FFFFFF;
				line-height: 66rpx;
				text-align: center;
				position: absolute;
				top: 0;
			}

			.data {
				position: absolute;
				top: 126rpx;
				left: 0;
				right: 0;
				margin: auto;
				width: 222rpx;
				height: 222rpx;

				image {
					width: 100%;
					height: 100%;
				}

				.val {
					position: absolute;
					width: 222rpx;
					height: 222rpx;
					top: 0;
					left: 0;
					text-align: center;
					line-height: 222rpx;
					font-size: 48rpx;
					font-weight: bold;
					background-image: linear-gradient(to bottom, yellow, red, yellow, red);
					color: transparent;
					-webkit-background-clip: text;
				}

			}

			.data-tit {
				font-size: 32rpx;
				font-weight: 500;
				color: #333333;
				position: absolute;
				width: 100%;
				bottom: 194rpx;
				text-align: center;
			}

			.next {
				width: 372rpx;
				height: 83rpx;
				background: linear-gradient(0deg, #FF5138 0%, #FF9F2D 100%);
				border: 4px solid #eabb72;
				border-radius: 41rpx;
				font-size: 40rpx;
				font-weight: 800;
				color: #FFFFFF;
				text-align: center;
				margin: auto;
			}
		}
	}

	.num {
		color: #FF5F36;
		font-weight: bold;
		padding: 0 10rpx;
	}
	.tab1 {
		background-color:#ffce73;
		// position: absolute;
		background-image: url('../../static/img/xccg.png');
		background-size: 100%;
		background-repeat: no-repeat;
		width: 100%;
		height: 100%;
		color: #ffce73;
		text-align: center;
		align-items: center;
		padding-top: 1rpx;
		.cg-wrap {
			margin-top: 349rpx;
			background-image: url('../../static/img/cg-wrap.png');
			background-size: 100%;
			background-repeat: no-repeat;
			width: 750rpx;
			height: 1113rpx;
			padding-top: 180rpx;
		}
		.cg-wrap1 {
			margin-top: 349rpx;
			background-image: url('../../static/img/xcbg1.png');
			background-size: 100%;
			background-repeat: no-repeat;
			width: 750rpx;
			height: 721rpx;
			padding-top: 180rpx;
		}
		.tit {
			font-size: 124rpx;
			font-weight: bold;
			letter-spacing:20rpx;
			line-height: 1;
			background-image: linear-gradient(to bottom, #ff9900, rgb(255, 40, 34));
			  background-clip: text;
			  -webkit-background-clip: text;
			  -webkit-text-fill-color: transparent;
		}
		.status {
			display: inline-block;
			margin: auto;
			padding-top: 69rpx;
			font-size: 66rpx;
			padding-bottom: 30rpx;
			border-bottom: 2px solid #fff;
		}
		.val-wrap {
			width: 290rpx;
			height: 290rpx;
			border-radius: 50%;
			border: 5px solid #ff7100;
			font-size: 96rpx;
			line-height: 290rpx;
			margin:92rpx auto 0;
			background-image: linear-gradient(to bottom, #ff9900, rgb(255, 40, 34));
			  background-clip: text;
			  -webkit-background-clip: text;
			  -webkit-text-fill-color: transparent;
			text {
				font-size: 52rpx;
				
			}
		}
		.val {
			// color: #030e8a;
			padding-top: 50rpx;
		}
	}
	.tab2 {
		background-color: #ede1a7;
		color: #2543c7;
		.tip {
			font-size: 64rpx;
			padding: 90rpx 0 110rpx;
		}
		.tit {
			padding-top: 0;
		}
		.btn-list {
			padding-top: 100rpx;
			padding-bottom: 110rpx;
			.btn {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
				border: 2px solid #2543c7;
				line-height: 120rpx;
				font-size: 62rpx;
				font-weight: bold;
				margin:0 auto 15rpx;
			}
		}
		.val {
			font-size: 40rpx;
			color: #333333;
			text {
				color: #2543c7;
			}
		}
	}
	.tab3 {
		background-color: #030e8a;
		color: #dbe045;
		.btn-list {
			.btn {
				border-color: #dbe045;
			}
		}
		.val {
			
			font-size: 40rpx;
			color: #fff;
			text {
				color: #dbe045;
			}
		}
	}
	.tab4 {
		background-color:#ff310e;
		color: #fff;
		.btn-list {
			.btn {
				border-color: #fff;
			}
		}
		.val {
			
			font-size: 40rpx;
			color: #fff;
			text {
				color: #fff;
			}
		}
	}
</style>