<template>
	<view class="fullHeight">
		<!-- <image src="/static/onlineTest_bg.png" class="onlineTest_bg"></image> -->
		<view class="centerBox">
			<image src="/static/aqjy.png" class="aqjyImg"></image>
			<view class="inputContent">
				<input class="inputBox" type="text" v-model="idCard" placeholder="请输入身份证号码" />
				<text class="confirmBtn" @click="verifyFn">开始培训</text>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				idCard:'',
				projectSn:'',
				eduId:''
			}
		},
		onLoad(options) {
			
			this.projectSn=JSON.parse(uni.getStorageSync('projectDetail')).projectSn
			this.eduId=options.eduId
		},
		methods: {
			verifyFn(){
				if(this.idCard==''){
					uni.showToast({
						title:'请输入身份证号码'
					})
					return
				}
				this.sendRequest({
					url: "xmgl/safeEducationQuestionAnswer/getAnswerWorkerInfo",
					data: {idCard:this.idCard,projectSn:this.projectSn},
					method: "post",
					success:(res)=> {
						if(res.result){
							uni.showToast({
								title:'验证成功！'
							})
							setTimeout(()=>{
								uni.navigateTo({
									url:'./videoLearning?eduId='+this.eduId+'&workerId='+res.result.id
								})
							},1000)
						}
						
						
					}
				})
			}
		}
	}
</script>

<style scoped>
.onlineTest_bg{
	width: 100%;
	height: 100%;
}
.centerBox{
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%,-50%);
	text-align: center;
}
.aqjyImg{
	width: 120px;
	height: 100px;
	margin-bottom: 30px;
}
.inputContent{
	/* position: fixed;
	bottom: 10%;
	left: 0; */
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.inputBox{
	background-color: white;
	border-radius: 4px;
	padding: 10px 10px;
	width: 200px;
	font-size: 15px;
	display: inline-block;
	margin-right: 10px;
	border: 1px solid rgba(63,83,110,0.5);
}
.confirmBtn{
	background-color: #4181FE;
	color: white;
	font-size: 15px;
	padding: 10px 20px;
	border-radius: 4px;
	width: 60px;
}
</style>
