<template>
	<view>
		<view class="top">
			<navigator url="/pages2/bank/question_statistics">
				<view class="left">
					<view class="title">做题统计</view>
					<view class="progress">
						<view class="item-left">
							<view class="desc">
								<text>总进度</text>
							</view>
							<view class="percent">
								68
								<text class="per">%</text>
							</view>
						</view>
						<view class="item-right">
							<view class='up'>
								<text class="orange">58</text>
								<text>/100</text>
							</view>
							
							<view class='down'>
								<text class="orange">已答</text>
								<text>/未答</text>
							</view>
						</view>
					</view>
				</view>
			</navigator>
			<view class="right">
				<view class="title">
					错题集 >
				</view>
				<view class="number">
					35
				</view>
			</view>
			<view class="right">
				<view class="title">
					收藏集 >
				</view>
				<view class="number">
					1
				</view>
			</view>
		</view>
		<view class="title-list">
			<view class="content">
				<view class="list" v-for="(item1,index) in outline">
					<view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
						2Z106010 施工承发包的模式-2Z106020 施工合同...
					</view>
					<view class="article" v-if="item1.showList" :class="{active:index1 == 0}" v-for="(article,index1) in item1.list">
						施工承发包模式-施工合同与物资采购合同二
						<navigator url="/pages2/bank/questionBankTest">
							<view v-if="index1 == 0" class="btn">做题</view>
							<view v-if="index1 == 1" class="btn">继续</view>
							<view v-if="index1 == 2" class="btn">重做</view>
						</navigator>
						
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
	data() {
		return {
			outline:[{
				list:[1,2,3],
				showList:false,
			},{
				list:[1,2,3],
				showList:false,
			},{
				list:[1,2,3],
				showList:false,
			},{
				list:[1,2,3],
				showList:false,
			}]
		};
	},
	onUnload() {
		
	},
	computed: { ...mapGetters(['userInfo']) },
	onLoad(option) {

	},
	onShow() {
		
	},
	methods: {
		
		changeItem(e) {
			let index = e.currentTarget.dataset.index
			this.outline.forEach((arrItem,i) => {
				if(i == index) {
					arrItem.showList = !arrItem.showList
				}
			})
			
		}
	}
};
</script>
<style >
	page{
		background-color: #EAEEF1;
	}
</style>
<style lang="scss" scope>
	
	.top {
		padding:16rpx 16rpx 0;
		display: flex;
		justify-content: space-between;
		.left {
			width: 326rpx;
			height: 180rpx;
			background: #FFFFFF;
			box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
			border-radius: 16rpx;
			background:#fff;
			padding:20rpx;
			
			.title {
				font-size: 24rpx;
				line-height: 24rpx;
				color: #333333;
			}
			
			.progress {
				margin-top:10rpx;
				display: flex;
				
				.item-left {
					flex:1;
					border-right:1rpx solid #EEEEEE;
					.desc {
						text {
							line-height: 24rpx;
							font-size: 24rpx;
							color: #999999;
						}
					}
					
					.percent {
						margin-top:10rpx;
						line-height: 64rpx;
						font-size: 64rpx;
						font-weight: bold;
						color: #007AFF;
					}
					
					.per {
						font-size: 30rpx;
						color: #007AFF;
					}
				}
				
				.item-right {
					padding-left:10rpx;
					flex:1;
					
					text {
						
						line-height: 24rpx;
						font-size: 24rpx;
						color: #999999;
					}
					
					.orange {
						line-height: 24rpx;
						font-size: 24rpx;
						font-weight: bold;
						color: #FF9500;
					}
					
					.down {
						margin-top:40rpx;
					}
				}
			}
		}
		
		.right {
			width: 180rpx;
			height: 180rpx;
			background: #FFFFFF;
			box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
			background:#fff;
			padding:20rpx;
			
			.title {
				font-size: 24rpx;
				line-height: 24rpx;
				color: #333333;
			}
			
			.number {
				font-weight: bold;
				text-align: center;
				margin-top:46rpx;
				font-size: 64rpx;
				line-height: 64rpx;
				color: #007AFF;
			}
		}
	}
	
	.title-list {
		background: #EAEEF1;
		padding:16rpx 16rpx 124rpx;
		.content {
			
			.list {
				background:#fff;
				margin-bottom:30rpx;
				overflow: hidden;
				border-radius: 16rpx;
				padding:10rpx 16rpx;
				
				.section {
					padding:30rpx 0;
					border-bottom: 1rpx solid #EEEEEE;
					font-size: 24rpx;
					color: #666666;
					
					&::before {
						content:'^';
						display: inline-block;
						margin-right:20rpx;
					}
					
					&.up {
						border:0;
						&::before {
							transform: rotate(180deg);
						}
					}
				}
				
				.article {
					height:80rpx;
					display: flex;
					align-items: center;
					margin-left:88rpx;
					font-size: 24rpx;
					color: #666666;
					border-bottom: 1rpx solid #EEEEEE;
					
					.btn {
						width: 96rpx;
						height: 48rpx;
						line-height: 48rpx;
						text-align: center;
						color:#fff;
						font-size: 30rpx;
						border-radius:24rpx;
						background: #007AFF;
						margin-left:36rpx;
						border-radius: 24rpx;
					}
					
					&:nth-last-of-type(1) {
						border:0;
					}
					
					&.active {
						color:#007AFF;
					}
				}
			}
		}
	}
	
</style>
