<template>
	<view style="position: relative;">
		<Headers></Headers>
		
		<image class="top-bg" src="/static/images/certificate_top_bg.png" mode="widthFix"></image>
		
		<view class="content-box ddflex">
			<view>
				<view class="ddflex re-item">
					<view class="re-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</view>
					<view class="re-li dflex">
						<input v-model="name" placeholder="姓名" maxlength="-1" placeholder-class="placeholder" class="re-ipt flex" />
					</view>
				</view>
				<view class="ddflex re-item">
					<view class="re-label">证书编号</view>
					<view class="re-li dflex">
						<input v-model="certificateNo" placeholder="证书编号" maxlength="-1" placeholder-class="placeholder" class="re-ipt flex" />
					</view>
				</view>
				<view class="ddflex re-item">
					<view class="re-label">身份证号</view>
					<view class="re-li dflex">
						<input v-model="idNumber" placeholder="身份证号" maxlength="-1" placeholder-class="placeholder" class="re-ipt flex" />
					</view>
				</view>
				<view class="note ddflex">
					<image src="/static/images/note.png"></image>
					<text>任意输入以上两项内容即可查询</text>
				</view>
				<view class="query-btn" @click="query">
					立即查询
				</view>
			</view>
		</view>
		
		<view class="ddflex" style="z-index: 1;position: relative;justify-content: center;text-align: center;margin-bottom: 60px;padding: 30px;">
			<view>
				<view>
					第三方证书查询平台
				</view>
				<view class="ddflex" style="justify-content: center;margin-top: 18px">
					<view class="link-btn" v-for="item in 6">国家职业资格证书查询</view>
				</view>
			</view>
		</view>
		<image class="bottom_bg" src="/static/images/certificate_bottom_bg.png" mode="widthFix"></image>
		<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 {
				name:'',
				idNumber:'',
				certificateNo:''
			}
		},
		methods: {
			query(){
				let ql = [this.name,this.idNumber,this.certificateNo]
				if(ql.filter(item=>{return item}).length<2) return req.msg('请填写两项内容查询')
				
				req.getRequest('/api/v3/exam/user/manager/certificate',{name:this.name,idNumber:this.idNumber,certificateNo:this.certificateNo},res=>{
					req.setStorage('options',{name:this.name,idNumber:this.idNumber,certificateNo:this.certificateNo})
					uni.navigateTo({
						url:'/pages/certificateDetail/certificateDetail'
					})
				})
			}
		}
	}
</script>

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