提交 3ad33ebe authored 作者: lihuihui's avatar lihuihui

update

上级 cb0a7d22
......@@ -4,20 +4,32 @@
<div class="mian-cont900 por">
<div class="title">{{ data.name }}</div>
<div class="exam-time">
<div class="tit">考试时间1</div>
<div class="tit">考试时间</div>
<div class="line"></div>
<div class="time">
{{ data.start_time }} - {{ data.end_time }}
</div>
<div class="time">{{ data.start_time }} - {{ data.end_time }}</div>
</div>
<div class="mian-form">
<!-- <div class="form prohibit"> -->
<div :class="loginParam.is ? 'form prohibit' : 'form'">
<div class="tips">{{ tips }}</div>
<!-- 您登录的次数已超过最大限制 -->
<input type="text" @click="fullScreen" v-model="examineeNumber" placeholder="请输入准考证号" v-show="!loginParam.is" @keydown="keydown($event)">
<input type="text" @click="fullScreen" placeholder="请输入准考证号" readonly="readonly" class="prohibit" v-show="loginParam.is">
<div class="btn" @click="login">登录</div>
<input
type="text"
@click="fullScreen"
v-model="examineeNumber"
placeholder="请输入准考证号"
v-show="!loginParam.is"
@keydown="keydown($event)"
/>
<input
type="text"
@click="fullScreen"
placeholder="请输入准考证号"
readonly="readonly"
class="prohibit"
v-show="loginParam.is"
/>
<div class="btn" @click="login">登录1</div>
<!-- <div class="btn prohibit">登录</div> -->
<div class="time-tips" v-show="loginParam.is">{{ loginParam.countTimeText }}</div>
</div>
......@@ -56,7 +68,8 @@ export default {
}
},
mounted() {
action.Login.getExamInfo(this.$route.params.examId).then(res => {
action.Login.getExamInfo(this.$route.params.examId)
.then(res => {
window.localStorage.setItem('examInfo', JSON.stringify(res))
this.data = res
if (this.getEnabledTime() < 0) {
......@@ -73,8 +86,8 @@ export default {
}, 1000)
this.loginParam.is = false
}
}).finally(res => {
})
.finally(res => {})
},
methods: {
sendExamInfo(studentId) {
......@@ -83,8 +96,9 @@ export default {
exam_id: this.data.exam_id,
status: 2
}
action.Login.sendExamInfo(param).then(res => {
}).catch(err => {
action.Login.sendExamInfo(param)
.then(res => {})
.catch(err => {
console.log(err)
})
},
......@@ -124,23 +138,24 @@ export default {
},
// 倒计时
countDown(time) {
const lefttime = parseInt((time) / 1000)
const h = this.addZero(parseInt(lefttime / (60 * 60) % 24))
const m = this.addZero(parseInt(lefttime / 60 % 60))
const lefttime = parseInt(time / 1000)
const h = this.addZero(parseInt((lefttime / (60 * 60)) % 24))
const m = this.addZero(parseInt((lefttime / 60) % 60))
const s = this.addZero(parseInt(lefttime % 60))
this.loginParam.countTimeText = `距离开考还有: ${h} : ${m} : ${s}`
},
// 开启全屏
fullScreen() {
const el = document.documentElement
const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
const rfs =
el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
if (typeof rfs !== 'undefined' && rfs) {
rfs.call(el)
}
return false
},
// 禁止input输入空格
keydown (event) {
keydown(event) {
console.log(event.keyCode)
if (event.keyCode === 32 || event.keyCode === 187 || event.keyCode === 107) {
event.returnValue = false
......@@ -153,7 +168,8 @@ export default {
this.$alert('请输入准考证号')
return false
}
action.Login.userLogin(this.data.exam_id, { examinee_number: this.examineeNumber }).then(res => {
action.Login.userLogin(this.data.exam_id, { examinee_number: this.examineeNumber })
.then(res => {
window.localStorage.setItem('studentInfo', JSON.stringify(res))
const status = parseInt(res.sheet_status)
// this.sendExamInfo(res.info.student_id)
......@@ -162,8 +178,9 @@ export default {
name: 'confirmInfo'
})
}
status === 1 && (this.$alert('已提交考卷'))
}).catch(err => {
status === 1 && this.$alert('已提交考卷')
})
.catch(err => {
if (err.message.indexOf('error') !== -1) {
this.$alert('网络异常,请保持网络通畅', {
callback: action => {}
......@@ -180,18 +197,17 @@ export default {
}
</script>
<style lang="scss" scoped>
.welcome-msg{
.welcome-msg {
padding-top: 130px;
&::v-deep img{
&::v-deep img {
width: 100%;
display: block;
}
}
.mian-cont900{
.mian-cont900 {
margin: 0 auto;
width: 900px;
&.por{
&.por {
position: absolute;
bottom: 0;
left: 50%;
......@@ -199,119 +215,119 @@ export default {
margin-bottom: -115px;
}
}
.login-box{
.login-box {
width: 100%;
height: 100%;
background: #fff;
.content{
.content {
position: relative;
width: 100%;
height: 50%;
// height: 387px;
background: url(../../assets/images/login-bg.png);
background-size: 100% 100%;
.title{
.title {
padding-top: 110px;
font-size: 36px;
font-weight: 600;
color: #FFFFFF;
color: #ffffff;
line-height: 50px;
letter-spacing: 7px;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}
.exam-time{
.exam-time {
padding-top: 20px;
.tit{
.tit {
font-size: 18px;
font-weight: bold;
color: #FFFFFF;
color: #ffffff;
line-height: 25px;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}
.line{
.line {
width: 24px;
height: 2px;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.5);
margin: 10px 0;
}
.time{
.time {
height: 25px;
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
color: #ffffff;
line-height: 25px;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}
}
.mian-form{
.mian-form {
width: 100%;
height: 230px;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(177, 186, 195, 0.3);
border-radius: 5px;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
.form{
.form {
position: relative;
display: flex;
&.prohibit{
input{
background: #EEEEEE;
border: 1px solid #CCCCCC;
&.prohibit {
input {
background: #eeeeee;
border: 1px solid #cccccc;
}
.btn{
.btn {
color: #ccc;
background: #eee;
}
}
}
input{
input {
padding-left: 15px;
width: 585px;
height: 40px;
border-radius: 4px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
font-size: 14px;
outline: none;
&::-webkit-input-placeholder{
&::-webkit-input-placeholder {
color: #999999;
}
&.prohibit{
background: #EEEEEE;
border: 1px solid #CCCCCC;
&.prohibit {
background: #eeeeee;
border: 1px solid #cccccc;
}
}
.btn{
.btn {
width: 180px;
height: 42px;
background: #C01540;
background: #c01540;
border-radius: 4px;
margin-left: 20px;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
color: #ffffff;
line-height: 40px;
text-align: center;
font-style: normal;
&.prohibit{
&.prohibit {
color: #ccc;
background: #eee;
}
}
.tips{
.tips {
position: absolute;
top: -80%;
left: 0;
font-size: 18px;
font-weight: 400;
color: #C01540;
color: #c01540;
line-height: 25px;
}
.time-tips{
.time-tips {
position: absolute;
bottom: -80%;
left: 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论