<template>
	<view>
		<Headers></Headers>
		<view class="project">
			<view style="width: 1200px;margin: auto;">在线考试系统</view>
		</view>
		
		<view class="project-content ddflex">
			<!-- 成绩区域 -->
			<view class="test-box">
				<view class="test-title">选择考试试卷</view>
				<view>
					<view class="note-item" style="font-size: 16px;" v-for="item,index in testList" :key="index+'test'" @click="toTest(item)">
						<view class="note-item-content">{{index+1}}.  {{item.title}}</view>
					</view>
				</view>
				
				<uni-pagination style="margin-top: 30px;" title="标题文字" show-icon="true" total="50" current="2"></uni-pagination>
				
				<!-- <navigator class="back-btn ddflex" hover-class="none" open-type="navigateBack">
					<image src="/static/images/back3.png"></image>
					<text>返回上一页</text>
				</navigator> -->
			</view>
			<!-- 答题卡区域 -->
			<view class="test-info ddflex" v-if="false">
				<view class="test-people ddflex">
					<image :src="examResult.avatar"></image>
					<view class="test-people-info ddflex">
						<view class="ddflex">
							<view class="test-people-label">考生姓名</view>
							<view class="fflex">{{examResult.userName}}</view>
						</view>
						<view class="ddflex">
							<view class="test-people-label">准考证号</view>
							<view class="fflex" style="word-break: break-all;">{{examResult.admissionNo}}</view>
						</view>
						<view class="ddflex">
							<view class="test-people-label">考试科目</view>
							<view class="fflex">{{examResult.title}}</view>
						</view>
					</view>
				</view>
				<view class="note-box">
					<view class="note-title ddflex">
						<image class="note-title-icon" src="/static/images/ksgg.png"></image>
						<view>考试公告</view>
					</view>
					<view>
						<view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
							<view class="note-item-content">{{item.title}}</view>
						</view>
					</view>
				</view>
				<!-- 注意事项 -->
				<view class="note-box">
					<view class="note-title ddflex">
						<image class="note-title-icon" src="/static/images/zysx.png"></image>
						<view>注意事项</view>
					</view>
					<view>
						<view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
							<view class="note-item-content">{{item.title}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<Foot></Foot>
	</view>
</template>

<script>
	const app = getApp();
	const req = require('../../utils/request.js');
	const utils = require('../../utils/util.js');
	const api = require('../../utils/api.js')
	export default {
		data() {
			return {
				paperId:null,
				admissionNo:null,
				paper: '', //试卷详情
				examResult:{},//考试详情
				
				otherInfo:[],
				noteInfo:[],
				
				testList:[]
			}
		},
		onReady() {},
		onLoad(options) {
			this.paperId = options.paperId;
			this.admissionNo = options.admissionNo;
			this.getTestProject()
		},
		methods: {
			jumpUrl(url){
				uni.navigateTo({
					url:url
				})
			},
			// 获取考试项目
			getTestProject(){
				req.getRequest('/api/v3/exam/user/manager',{},res=>{
					this.testList = res
				})
			},
			// 去考试
			toTest(item){
				uni.showModal({
					title:'提示',
					content:`确定开始 ${item.title}？`,
					success: (res) => {
						if(res.confirm){
							uni.navigateTo({
								// url: '/pages/test/test?paperId='+this.paperId,
								url: '/pages/test/test?paperId='+item.id,
								success:()=> {
									this.close()
								}
							});
						}else{
							
						}
					}
				})
			}
		}
	}

</script>

<style>
	@import url('./selectTest.css');
</style>