Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-exam-show
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-exam-show
Commits
cb6821b7
提交
cb6821b7
authored
7月 27, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 优化代码
上级
80eb10b1
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
125 行增加
和
151 行删除
+125
-151
dev.ezijing.com.key
build/dev.ezijing.com.key
+27
-27
dev.ezijing.com.pem
build/dev.ezijing.com.pem
+0
-0
exam_api.js
src/api/exam_api.js
+4
-4
login_api.js
src/api/login_api.js
+1
-1
test_api.js
src/api/test_api.js
+4
-4
answerCard.vue
src/components/exam/answerCard.vue
+3
-11
question.vue
src/components/exam/question.vue
+0
-0
index.html
src/index.html
+1
-1
examAnswer.vue
src/pages/exam/examAnswer.vue
+45
-48
confirmInfo.vue
src/pages/login/confirmInfo.vue
+0
-0
index.vue
src/pages/login/index.vue
+39
-53
routes.js
src/router/routes.js
+1
-2
没有找到文件。
build/dev.ezijing.com.key
浏览文件 @
cb6821b7
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAn0EINdIXTDCzmR7J5FOjOV+PbXt7GNO6fanoCGe2O0CPRlNf
2Ea/wv6SlRtJPd0ohmnKqZdUbBpAsiV4ggOdOqeEB6utVYQWY/zhXRKYeRjN/iDu
WCRY5S+eRVkSzVOJP9DlBn6dnHSsWj55h1PrkIac8B862F/cVno/Wk5dqU55ZUoN
wHGw5Goz3R37w+Q0C9HRS5mrmPqI+Ogy8TJrIRxw9YAj5Olvu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svx0cDZ
VbEXByA0+CG3q47/UrVqETRhtyuVnxuKrceKU8/zib1dvvTMNjeYLKosjyG49xO6
gDx7nVBwYHmQN/iEuWTobLg1vtSNyd99WgG4cFHvqF7kIJb2W0IaGrsCgYEAzL70
VHn9BUP3CGecoU8Fnck9/7GWhvGgFU58Q/dU3Jr8g6lroeDas9zQU2tCnJN0e7cr
13thq2kQQHTYCY4J6EUtjO89sNVx4bO83xqQhobZBwZXkE5QDWIKCbiYGRLAb1+f
AAEwIEdPBgM88YFHOU5YbPTYH8TLkJfxyvMonu0CgYEArGWE3n3PdVeT1zs3O52g
8jrrpVGNF1QmWCgJ2VKJwkW0F4iFhMRYzzH3vPNcPj+Q/cjUn4lIJWMzkWrJ0mP4
ScyPUm1PApRNLPy7RRd5XtYm40wN52F+k8fRnlFiSUqTEejoZFGR8Xm/c1qFsS6y
9ofGZ6F6ewmM3uAQGGd1xxcCgYBFhjoVTW8bkJ6b3gMTy2+Oyr0gzD7fB8FiOsp7
kcrhNke0tZz01ROuq7aZ/Pwbiv6s2+ApRZ4+xGheWs7ZP8AhfQwgpUR/fZs0FwJ1
h+G3rKaZeg/V0qHgSYA7GNGdAf8SUpf9OmoLK+urkQHqyAlVbkMcjG+vKfYt3Uqf
rb4HaQKBgQCxm1oz9QrmxWKJ4eYKHSsD9UPu4QZhltBECH1btgvTwAEmwuXaCcta
RaFNhMe609sQ+YVIxa9fK0MXBiq7DG6nSLGvnLfVEYo4nGe6EvL9nQ7IFZywJjTb
/Fw4rTMwT59VSWJdv8BPznV7Gk7p17fcXM55iJxxu65r3ZuOXjQSGA==
-----END RSA PRIVATE KEY-----
\ No newline at end of file
build/dev.ezijing.com.pem
浏览文件 @
cb6821b7
差异被折叠。
点击展开。
src/api/exam_api.js
浏览文件 @
cb6821b7
...
...
@@ -5,13 +5,13 @@ export default class ExamAPI extends BaseAPI {
* 获取考试信息
* @param {[string]} examId resource_id
*/
getTopic
=
(
examId
)
=>
this
.
get
(
`/xexam/v1/exam/sheet/
${
examId
}
`
,
{})
getTopic
=
examId
=>
this
.
get
(
`/xexam/v1/exam/sheet/
${
examId
}
`
,
{})
/* 缓存考试 */
setCache
=
(
examId
=
{}
,
obj
=
{})
=>
this
.
post
(
`/xexam/v1/exam/cache/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
setCache
=
(
examId
=
''
,
obj
=
{})
=>
this
.
post
(
`/xexam/v1/exam/cache/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
/* 获取缓存 */
getCache
=
(
examId
)
=>
this
.
get
(
`/xexam/v1/exam/cache/
${
examId
}
`
,
{})
getCache
=
examId
=>
this
.
get
(
`/xexam/v1/exam/cache/
${
examId
}
`
,
{})
/* 缓存考试 */
endExam
=
(
examId
=
{}
,
obj
=
{})
=>
this
.
post
(
`/xexam/v1/exam/sheet/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
endExam
=
(
examId
=
''
,
obj
=
{})
=>
this
.
post
(
`/xexam/v1/exam/sheet/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
/**
* 进入考试
*/
...
...
src/api/login_api.js
浏览文件 @
cb6821b7
...
...
@@ -5,7 +5,7 @@ export default class TestAPI extends BaseAPI {
* 获取考试信息
* @param {[string]} examId resource_id
*/
getExamInfo
=
(
examId
)
=>
this
.
get
(
`/xexam/v1/exam/view/
${
examId
}
`
,
{})
getExamInfo
=
examId
=>
this
.
get
(
`/xexam/v1/exam/view/
${
examId
}
`
,
{})
/**
* 进入考试
*/
...
...
src/api/test_api.js
浏览文件 @
cb6821b7
...
...
@@ -5,14 +5,14 @@ export default class TestAPI extends BaseAPI {
* get传输方式
* @param {[string]} id resource_id
*/
getTest
=
(
id
)
=>
this
.
get
(
`/vue-client/get/
${
id
}
`
,
{})
getTest
=
id
=>
this
.
get
(
`/vue-client/get/
${
id
}
`
,
{})
/**
* post传输方式
* @param {[object]} obj
*/
postTest
=
(
obj
=
{})
=>
this
.
post
(
'/passport/rest/login'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
/**
* 当前登录用户,检测是否该系统有权限
*/
getInfo
=
()
=>
this
.
post
(
'/user_center/get_user_info'
,
{},
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
* 当前登录用户,检测是否该系统有权限
*/
getInfo
=
()
=>
this
.
post
(
'/user_center/get_user_info'
,
{},
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
src/components/exam/answerCard.vue
浏览文件 @
cb6821b7
...
...
@@ -3,14 +3,7 @@
<div
ref=
"wrapper"
>
<div
class=
"info"
>
<div
class=
"shape"
>
<img
:src=
"
info.id_photo
? info.id_photo
: 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'
"
alt=
""
/>
<img
:src=
"info.id_photo ? info.id_photo : 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'"
/>
</div>
<div
class=
"right"
>
<div
class=
"name"
>
{{
info
.
name
}}
</div>
...
...
@@ -132,8 +125,7 @@ export default {
info
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
data
()
{
return
{
}
return
{}
},
mounted
()
{
if
(
!
this
.
isMobile
())
{
...
...
@@ -196,7 +188,7 @@ export default {
}
}
}
.order-scroll
{
.order-scroll
{
// max-height: 100px;
// overflow-y: scroll;
}
...
...
src/components/exam/question.vue
浏览文件 @
cb6821b7
差异被折叠。
点击展开。
src/index.html
浏览文件 @
cb6821b7
...
...
@@ -11,7 +11,7 @@
<!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> -->
<!-- <meta http-equiv="Pragma" content="no-cache" /> -->
<!-- <meta http-equiv="Expires" content="0" /> -->
<title>
标题
</title>
<title></title>
<meta
name=
"viewport"
id=
"viewport"
content=
"initial-scale=-1,maximum-scale=1,shrink-to-fit=no,user-scalable=no"
/>
</head>
<body>
...
...
src/pages/exam/examAnswer.vue
浏览文件 @
cb6821b7
...
...
@@ -25,12 +25,7 @@
</div>
</div>
<div
:class=
"isMobile() ? 'right scroll' : 'right hidden'"
ref=
"wrapper"
>
<answer-card
:questionParams=
"questionParams"
:changeTime=
"changeTime"
:info=
"sInfo.info"
@
switchQuestion=
"switchQuestion"
></answer-card>
<answer-card
:questionParams=
"questionParams"
:changeTime=
"changeTime"
:info=
"studentInfo"
@
switchQuestion=
"switchQuestion"
></answer-card>
</div>
<ul
class=
"flag-tips"
>
<li>
...
...
@@ -56,10 +51,7 @@
<div
@
click=
"changeIndex('prev')"
:class=
"this.questionParams.questionIndex !== 0 ? 'active' : ''"
>
上一题
</div>
<div
:class=
"questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@
click=
"changeIndex('next')"
>
<div
:class=
"questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@
click=
"changeIndex('next')"
>
下一题
</div>
</div>
...
...
@@ -91,7 +83,7 @@ import BScroll from 'better-scroll'
export
default
{
metaInfo
()
{
return
{
title
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
))
.
name
||
''
title
:
this
.
examInfo
.
name
||
''
}
},
components
:
{
...
...
@@ -100,14 +92,23 @@ export default {
'my-dia'
:
dialogComponent
},
data
()
{
let
studentInfo
=
{}
let
examInfo
=
{}
try
{
studentInfo
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'studentInfo'
))
examInfo
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
))
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
{
isExamEnd
:
false
,
isExamTimeDate
:
true
,
itemSign
:
false
,
examTime
:
'00:00:00 倒计时'
,
clearTime
:
null
,
s
Info
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'studentInfo'
))
,
examInfo
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
))
,
s
tudentInfo
,
examInfo
,
title
:
'提示'
,
prompt
:
'确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!'
,
isPopup
:
false
,
...
...
@@ -125,6 +126,20 @@ export default {
}
}
},
computed
:
{
examId
()
{
return
this
.
$route
.
params
.
examId
||
this
.
examInfo
.
exam_id
},
changeQuestionIndex
()
{
return
this
.
questionParams
.
questionIndex
}
},
watch
:
{
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
refreshBscroll
()
}
},
mounted
()
{
// this.sendExamInfo(3)
this
.
setTick
()
...
...
@@ -149,8 +164,8 @@ export default {
},
sendExamInfo
(
status
)
{
const
param
=
{
student_id
:
this
.
s
Info
.
i
nfo
.
student_id
,
exam_id
:
this
.
examI
nfo
.
exam_i
d
,
student_id
:
this
.
s
tudentI
nfo
.
student_id
,
exam_id
:
this
.
examId
,
status
:
status
}
action
.
Login
.
sendExamInfo
(
param
)
...
...
@@ -160,9 +175,7 @@ export default {
})
},
countHeight
()
{
this
.
contentHeight
=
parseInt
(
document
.
body
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
)
)
this
.
contentHeight
=
parseInt
(
document
.
body
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
},
// 标记
signHandle
()
{
...
...
@@ -178,12 +191,7 @@ export default {
this
.
$alert
(
'考试时间到'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
this
.
$router
.
replace
({
path
:
'/examEnd'
,
query
:
{
id
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
)).
exam_id
}
})
this
.
$router
.
replace
({
path
:
'/examEnd'
,
query
:
{
id
:
this
.
examId
}
})
}
})
}
else
{
...
...
@@ -229,7 +237,7 @@ export default {
const
param
=
{
answer
:
JSON
.
stringify
(
this
.
questionParams
.
answerRecord
)
}
action
.
Exam
.
endExam
(
this
.
$route
.
params
.
examId
,
param
).
then
(
res
=>
{
action
.
Exam
.
endExam
(
this
.
examId
,
param
).
then
(
res
=>
{
if
(
!
n
)
{
clearInterval
(
this
.
clearTime
)
this
.
$router
.
replace
({
...
...
@@ -249,7 +257,7 @@ export default {
// })
// .then(() => {
// this.$router.replace({
// path: `/login/${
JSON.parse(window.localStorage.getItem('examInfo')).exam_i
d}`
// path: `/login/${
this.examI
d}`
// })
// })
// .catch(action => {
...
...
@@ -263,18 +271,18 @@ export default {
// })
},
countDown
(
time
)
{
const
left
t
ime
=
parseInt
(
time
/
1000
)
const
h
=
this
.
addZero
(
parseInt
((
left
t
ime
/
(
60
*
60
))
%
24
))
const
m
=
this
.
addZero
(
parseInt
((
left
t
ime
/
60
)
%
60
))
const
s
=
this
.
addZero
(
parseInt
(
left
t
ime
%
60
))
const
left
T
ime
=
parseInt
(
time
/
1000
)
const
h
=
this
.
addZero
(
parseInt
((
left
T
ime
/
(
60
*
60
))
%
24
))
const
m
=
this
.
addZero
(
parseInt
((
left
T
ime
/
60
)
%
60
))
const
s
=
this
.
addZero
(
parseInt
(
left
T
ime
%
60
))
this
.
examTime
=
`
${
h
}
:
${
m
}
:
${
s
}
倒计时`
},
setTick
()
{
let
flag
=
true
this
.
clearTime
=
setInterval
(()
=>
{
const
now
t
ime
=
new
Date
()
const
end
t
ime
=
new
Date
(
this
.
examInfo
.
end_time
.
replace
(
/-/g
,
'/'
))
const
countTime
=
end
time
.
getTime
()
-
nowt
ime
.
getTime
()
const
now
T
ime
=
new
Date
()
const
end
T
ime
=
new
Date
(
this
.
examInfo
.
end_time
.
replace
(
/-/g
,
'/'
))
const
countTime
=
end
Time
.
getTime
()
-
nowT
ime
.
getTime
()
if
(
countTime
<=
0
)
{
this
.
isExamTimeDate
=
false
clearInterval
(
this
.
clearTime
)
...
...
@@ -305,8 +313,7 @@ export default {
if
(
type
===
'prev'
)
{
this
.
questionParams
.
questionIndex
>
0
&&
this
.
questionParams
.
questionIndex
--
}
else
{
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
this
.
questionParams
.
questionIndex
++
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
this
.
questionParams
.
questionIndex
++
}
this
.
refreshBscroll
()
},
...
...
@@ -322,7 +329,7 @@ export default {
this
.
refreshBscroll
()
},
getTopic
()
{
action
.
Exam
.
getTopic
(
this
.
$route
.
params
.
examId
)
action
.
Exam
.
getTopic
(
this
.
examId
)
.
then
(
res
=>
{
this
.
questionParams
.
question
=
res
this
.
getCache
()
...
...
@@ -333,8 +340,8 @@ export default {
})
},
getCache
()
{
if
(
this
.
$route
.
params
.
examId
)
{
action
.
Exam
.
getCache
(
this
.
$route
.
params
.
examId
)
if
(
this
.
examId
)
{
action
.
Exam
.
getCache
(
this
.
examId
)
.
then
(
res
=>
{
const
data
=
JSON
.
parse
(
res
.
answer
)
if
(
data
!==
null
&&
data
!==
'null'
)
{
...
...
@@ -371,16 +378,6 @@ export default {
const
isPc
=
!
isPhone
&&
!
isAndroid
&&
!
isSymbian
return
isPc
}
},
computed
:
{
changeQuestionIndex
()
{
return
this
.
questionParams
.
questionIndex
}
},
watch
:
{
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
refreshBscroll
()
}
}
}
</
script
>
...
...
src/pages/login/confirmInfo.vue
浏览文件 @
cb6821b7
差异被折叠。
点击展开。
src/pages/login/index.vue
浏览文件 @
cb6821b7
...
...
@@ -13,20 +13,8 @@
<div
:class=
"loginParam.is ? 'form prohibit' : 'form'"
>
<div
class=
"tips"
>
{{
tips
}}
</div>
<!-- 您登录的次数已超过最大限制 -->
<input
type=
"text"
v-model=
"examineeNumber"
placeholder=
"请输入准考证号"
v-show=
"!loginParam.is"
@
keydown=
"keydown($event)"
/>
<input
type=
"text"
placeholder=
"请输入准考证号"
readonly=
"readonly"
class=
"prohibit"
v-show=
"loginParam.is"
/>
<input
type=
"text"
v-model=
"examineeNumber"
placeholder=
"请输入准考证号"
v-show=
"!loginParam.is"
@
keydown=
"keydown($event)"
/>
<input
type=
"text"
placeholder=
"请输入准考证号"
readonly=
"readonly"
class=
"prohibit"
v-show=
"loginParam.is"
/>
<div
class=
"btn"
@
click=
"login"
>
登录
</div>
<!--
<div
class=
"btn prohibit"
>
登录
</div>
-->
<div
class=
"time-tips"
v-show=
"loginParam.is"
>
{{
loginParam
.
countTimeText
}}
</div>
...
...
@@ -34,7 +22,7 @@
</div>
</div>
</div>
<div
class=
"welcome-msg mian-cont900"
v-if=
"data"
v-html=
"data.config.welcome_message"
></div>
<div
class=
"welcome-msg mian-cont900"
v-if=
"data
&& data.config
"
v-html=
"data.config.welcome_message"
></div>
</div>
</
template
>
<
script
>
...
...
@@ -46,16 +34,16 @@ export default {
},
metaInfo
()
{
return
{
title
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
)).
name
||
''
title
:
this
.
data
.
name
}
},
data
()
{
return
{
tips
:
''
,
cl
ae
rExamTime
:
null
,
cl
ea
rExamTime
:
null
,
title
:
'提示'
,
prompt
:
'不能退出全屏'
,
data
:
''
,
data
:
{}
,
examineeNumber
:
''
,
isPopup
:
false
,
loginParam
:
{
...
...
@@ -65,6 +53,11 @@ export default {
}
}
},
computed
:
{
examId
()
{
return
this
.
$route
.
params
.
examId
}
},
mounted
()
{
this
.
getExamInfo
()
this
.
tipsMobileAngle
()
...
...
@@ -78,10 +71,7 @@ export default {
const
winWidth
=
window
.
innerWidth
||
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
||
0
const
winHeight
=
window
.
innerHeight
||
document
.
documentElement
.
clientHeight
||
document
.
body
.
clientHeight
||
0
if
(
winHeight
>
winWidth
)
{
this
.
$message
({
message
:
'请横屏预览'
,
type
:
'warning'
})
this
.
$message
({
message
:
'请横屏预览'
,
type
:
'warning'
})
}
}
},
...
...
@@ -89,19 +79,19 @@ export default {
return
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i
.
test
(
navigator
.
userAgent
)
},
getExamInfo
()
{
action
.
Login
.
getExamInfo
(
this
.
$route
.
params
.
examId
).
then
(
res
=>
{
action
.
Login
.
getExamInfo
(
this
.
examId
).
then
(
res
=>
{
window
.
localStorage
.
setItem
(
'examInfo'
,
JSON
.
stringify
(
res
))
this
.
data
=
res
if
(
this
.
getEnabledTime
()
<
0
)
{
this
.
examTimeInit
()
}
else
{
let
cl
a
earTimes
=
null
cl
a
earTimes
=
setInterval
(()
=>
{
let
clearTimes
=
null
clearTimes
=
setInterval
(()
=>
{
// console.log(this.getAfterTime())
if
(
this
.
getAfterTime
()
<=
0
)
{
this
.
tips
=
'超过登录时间'
this
.
loginParam
.
is
=
true
clearInterval
(
cl
a
earTimes
)
clearInterval
(
clearTimes
)
}
},
1000
)
this
.
loginParam
.
is
=
false
...
...
@@ -109,11 +99,7 @@ export default {
})
},
sendExamInfo
(
studentId
)
{
const
param
=
{
student_id
:
studentId
,
exam_id
:
this
.
data
.
exam_id
,
status
:
2
}
const
param
=
{
student_id
:
studentId
,
exam_id
:
this
.
examId
,
status
:
2
}
action
.
Login
.
sendExamInfo
(
param
)
.
then
(
res
=>
{})
.
catch
(
err
=>
{
...
...
@@ -126,25 +112,23 @@ export default {
},
getAfterTime
()
{
const
curTime
=
new
Date
()
const
end
t
Time
=
new
Date
(
this
.
data
.
end_time
)
const
countTime
=
end
t
Time
.
getTime
()
-
curTime
.
getTime
()
const
endTime
=
new
Date
(
this
.
data
.
end_time
)
const
countTime
=
endTime
.
getTime
()
-
curTime
.
getTime
()
return
countTime
},
getEnabledTime
()
{
const
curTime
=
new
Date
()
const
setCurTime
=
this
.
data
.
config
.
enabled_before
?
new
Date
(
curTime
.
setMinutes
(
curTime
.
getMinutes
()
+
this
.
data
.
config
.
before_login
))
:
curTime
const
setCurTime
=
this
.
data
.
config
.
enabled_before
?
new
Date
(
curTime
.
setMinutes
(
curTime
.
getMinutes
()
+
this
.
data
.
config
.
before_login
))
:
curTime
const
startTime
=
new
Date
(
this
.
data
.
start_time
)
const
countTime
=
setCurTime
.
getTime
()
-
startTime
.
getTime
()
return
countTime
},
examTimeInit
()
{
this
.
loginParam
.
is
=
true
this
.
cl
ae
rExamTime
=
setInterval
(()
=>
{
this
.
cl
ea
rExamTime
=
setInterval
(()
=>
{
const
date
=
this
.
getEnabledTime
()
if
(
date
>=
0
)
{
clearInterval
(
this
.
cl
ae
rExamTime
)
clearInterval
(
this
.
cl
ea
rExamTime
)
this
.
loginParam
.
is
=
false
}
else
{
this
.
countDown
(
Math
.
abs
(
date
))
...
...
@@ -156,21 +140,23 @@ export default {
},
// 倒计时
countDown
(
time
)
{
const
left
t
ime
=
parseInt
(
time
/
1000
)
const
left
T
ime
=
parseInt
(
time
/
1000
)
const
datSec
=
24
*
60
*
60
const
hourSer
=
60
*
60
const
minuteSec
=
60
const
dd
=
Math
.
floor
(
lefttime
/
datSec
)
const
hh
=
Math
.
floor
((
lefttime
%
datSec
)
/
hourSer
)
const
mm
=
Math
.
floor
((
lefttime
%
hourSer
)
/
minuteSec
)
const
ss
=
lefttime
%
minuteSec
this
.
loginParam
.
countTimeText
=
dd
>
0
?
`距离开考还有:
${
dd
}
天
${
this
.
addZero
(
hh
)}
时
${
this
.
addZero
(
mm
)}
分
${
this
.
addZero
(
ss
)}
秒`
:
`距离开考还有:
${
this
.
addZero
(
hh
)}
时
${
this
.
addZero
(
mm
)}
分
${
this
.
addZero
(
ss
)}
秒`
const
dd
=
Math
.
floor
(
leftTime
/
datSec
)
const
hh
=
Math
.
floor
((
leftTime
%
datSec
)
/
hourSer
)
const
mm
=
Math
.
floor
((
leftTime
%
hourSer
)
/
minuteSec
)
const
ss
=
leftTime
%
minuteSec
this
.
loginParam
.
countTimeText
=
dd
>
0
?
`距离开考还有:
${
dd
}
天
${
this
.
addZero
(
hh
)}
时
${
this
.
addZero
(
mm
)}
分
${
this
.
addZero
(
ss
)}
秒`
:
`距离开考还有:
${
this
.
addZero
(
hh
)}
时
${
this
.
addZero
(
mm
)}
分
${
this
.
addZero
(
ss
)}
秒`
},
// 开启全屏
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
)
}
...
...
@@ -189,17 +175,16 @@ export default {
this
.
$alert
(
'请输入准考证号'
)
return
false
}
action
.
Login
.
userLogin
(
this
.
data
.
exam_i
d
,
{
examinee_number
:
this
.
examineeNumber
})
action
.
Login
.
userLogin
(
this
.
examI
d
,
{
examinee_number
:
this
.
examineeNumber
})
.
then
(
res
=>
{
window
.
localStorage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
))
window
.
localStorage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
.
info
))
const
status
=
parseInt
(
res
.
sheet_status
)
// this.sendExamInfo(res.info.student_id)
if
(
status
===
0
)
{
this
.
$router
.
replace
({
name
:
'confirmInfo'
}
)
this
.
$router
.
push
({
name
:
'confirmInfo'
,
params
:
{
examId
:
this
.
examId
}
})
}
else
if
(
status
===
1
)
{
this
.
$alert
(
'已提交考卷'
)
}
status
===
1
&&
this
.
$alert
(
'已提交考卷'
)
})
.
catch
(
err
=>
{
if
(
err
.
message
.
indexOf
(
'error'
)
!==
-
1
)
{
...
...
@@ -232,7 +217,7 @@ export default {
position
:
absolute
;
bottom
:
0
;
left
:
50%
;
-webkit-
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
margin-bottom
:
-115px
;
}
}
...
...
@@ -335,6 +320,7 @@ export default {
line-height
:
40px
;
text-align
:
center
;
font-style
:
normal
;
cursor
:
pointer
;
&
.prohibit
{
color
:
#ccc
;
background
:
#eee
;
...
...
src/router/routes.js
浏览文件 @
cb6821b7
export
default
[
{
path
:
'/'
,
redirect
:
'*'
},
/* 测试页面 */
...
...
@@ -6,7 +5,7 @@ export default [
/* 登录页面 */
{
path
:
'/login/:examId'
,
component
:
()
=>
import
(
'../pages/login/index.vue'
)
},
/* 确认信息 */
{
path
:
'/confirmInfo'
,
name
:
'confirmInfo'
,
component
:
()
=>
import
(
'../pages/login/confirmInfo.vue'
)
},
{
path
:
'/confirmInfo
/:examId
'
,
name
:
'confirmInfo'
,
component
:
()
=>
import
(
'../pages/login/confirmInfo.vue'
)
},
/* 考试倒计时 */
{
path
:
'/examTime'
,
name
:
'examTime'
,
component
:
()
=>
import
(
'../pages/exam/examTime.vue'
)
},
/* 答题 */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论