<template>
	<view class="my_duty">
		<uni-nav-bar @clickLeft="goBack()" height="110rpx" leftWidth="200rpx" leftText="考前须知" leftIcon="left" border
			backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
		<view class='wrap'>
			<view class="subTitle">
				考试信息
			</view>
			<view class="examContent">
				<view>考试名称：<text>{{currentExam.name}}</text> </view>
				<view>考试总分：<text>{{currentExam.paper_total_score}}</text>分</view>
				<view v-if="currentExam.paper_limit>0">考试时长：<text>{{currentExam.paper_limit}}</text>分钟</view>
				<view v-else>考试时长：<text>不限时长</text></view>
				<!-- <view>题目分布：单选<text>{{currentExam.paper_.danxuan_count}}</text>道;多选<text>{{currentExam.paper_.duoxuan_count}}</text>道;判断<text>{{currentExam.paper_.panduan_count}}</text>道</view> -->
				<!-- <view>判分规则：单选{{currentExam.paper_.danxuan_score}}分,多选{{currentExam.paper_.duoxuan_score}}分,多选{{currentExam.paper_.panduan_score}}分,错选少选均不得分</view> -->
			</view>
			<!-- <view class="subTitle">答题须知</view> -->
			<view class="tipsArea">
				<ul>
					<li class="tipsTitle">答题须知。</li>
					<li>1.进入答题后请不要后退或返回。</li>
					<li>2.可点击上一题/下一题切换。</li>
					<li>3.可点击答题卡复查</li>
					<li>4.请合理安排时间答题,可提前交卷</li>
				</ul>
			</view>
			<u-button type="primary" @click="start()" class="start">开始答题</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'ticket',
		data() {
			return {
				currentExam:{},
			}
		},
		onShow() {
			this.currentExam = uni.getStorageSync('currentExam')
		},
		methods: {
			start(){
				this.$u.api.startExam(this.currentExam.id).then(res=>{
					console.log('currentExam',res)
					let currentExam =uni.getStorageSync('currentExam');
					currentExam.examrecord = res.id;
					currentExam.questions_ = res.detail;
					uni.setStorageSync('currentExam',currentExam)
					uni.reLaunch({
						url:'/pages/exam/main'
					})
				})
				
			},
			goBack() {
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style scoped>
	.empty-view {
		height: 120rpx;
	}

>>>.uni-navbar__header,
	>>>.uni-status-bar{
		background-image: linear-gradient(270deg,
				#0ca7ee 0%,
				#005aff 100%,
				#2a8cff 100%,
				#54bdff 100%),
			linear-gradient(#e60012,
				#e60012);
	}
.wrap{
	padding: 24rpx;
	font-size: 30rpx;
}
.subTitle {
	font-size: $u-font-size-title;
	font-weight: bold;
	// color: $theme-color;
	text-align: center;
	margin: 40rpx auto 20rpx auto;
}
.examContent {
	line-height: 50rpx;
	margin-left: 80rpx;
	view{
		margin-bottom: 6rpx;
	}
	text {
		font-weight: bold;
		color:$theme-color;;
	}
}
.tipsArea {
	padding: 20rpx 40rpx;
	margin-left: 0rpx;
	margin-bottom: 30rpx;
	border: 1px solid #2581e4;
	border-radius: 20rpx;
	font-size: 28rpx;
	margin-top: 50rpx;
	.tipsTitle{
		font-weight: bold;
		color: #2581e4;
	}
}
ul{
	    list-style: none;
	    padding-left: 0;
}
ul {
	margin: 0 30rpx;
	line-height: 50rpx;
}
.start{
	width: 50%;
	font-size: 30rpx;
	height: 110rpx;
	line-height: 105rpx;
	color: #ffffff;
	border-color: #2581e4;
	background-color: #2581e4;
	border-radius: 10rpx;
	text-align: center;
	margin: auto;
}
</style>
