提交 f6f0a391 authored 作者: lihuihui's avatar lihuihui

update

上级 61b2c398
module.exports = { module.exports = {
domain: 'dev.ezijing.com', domain: 'dev.ezijing.com',
url: 'https://x-exam2.ezijing.com/api', url: 'https://x-exam.ezijing.com/api',
isEnableToIphoneDebugger: false, isEnableToIphoneDebugger: false,
// apiBaseURL: '//demo-login.ezijing.com/', // apiBaseURL: '//demo-login.ezijing.com/',
webpack: { webpack: {
externals: { externals: {
'CKEDITOR': 'window.CKEDITOR', CKEDITOR: 'window.CKEDITOR',
'Base64': 'window.Base64', Base64: 'window.Base64',
'md5': 'window.md5', md5: 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime' regeneratorRuntime: 'window.regeneratorRuntime'
}, },
devServer: { devServer: {
proxy: { proxy: {
...@@ -20,7 +20,7 @@ module.exports = { ...@@ -20,7 +20,7 @@ module.exports = {
secure: false, // 如果是https接口,需要配置这个参数 secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置 changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口 followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口
logLevel: 'info', // 日志打印级别 logLevel: 'info' // 日志打印级别
// headers: { // headers: {
// 'Referer': $GLOBAL.webConf.url // 'Referer': $GLOBAL.webConf.url
// }, // },
...@@ -31,10 +31,6 @@ module.exports = { ...@@ -31,10 +31,6 @@ module.exports = {
} }
} }
}, },
ProvidePlugin: { ProvidePlugin: {},
others: {}
},
others: {
}
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> --> </div> -->
</div> </div>
</div> </div>
<div class="exam-main" :style="{height: this.contentHeight + 'px'}"> <div class="exam-main" :style="{ height: this.contentHeight + 'px' }">
<div class="left"> <div class="left">
<question <question
v-if="Object.keys(questionParams.question).length" v-if="Object.keys(questionParams.question).length"
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
</div> </div>
<div class="foot" id="foot-h"> <div class="foot" id="foot-h">
<div class="exam-btn"> <div class="exam-btn">
<div <div @click="changeIndex('prev')" :class="this.questionParams.questionIndex !== 0 ? 'active' : ''">
@click="changeIndex('prev')" 上一题
:class="this.questionParams.questionIndex !== 0 ? 'active' : ''" </div>
>上一题</div>
<div <div
:class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''" :class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@click="changeIndex('next')" @click="changeIndex('next')"
>下一题</div> >
下一题
</div>
</div> </div>
<div class="rigth-btn"> <div class="rigth-btn">
<div class="sign" @click="signHandle"> <div class="sign" @click="signHandle">
...@@ -104,6 +105,11 @@ export default { ...@@ -104,6 +105,11 @@ export default {
window.onresize = () => { window.onresize = () => {
this.countHeight() this.countHeight()
} }
document.body.addEventListener('touchmove', function (evt) {
if (!evt._isScroller) {
evt.preventDefault()
}
})
}, },
methods: { methods: {
sendExamInfo(status) { sendExamInfo(status) {
...@@ -112,13 +118,16 @@ export default { ...@@ -112,13 +118,16 @@ export default {
exam_id: this.examInfo.exam_id, exam_id: this.examInfo.exam_id,
status: status status: status
} }
action.Login.sendExamInfo(param).then(res => { action.Login.sendExamInfo(param)
}).catch(err => { .then(res => {})
console.log(err) .catch(err => {
}) console.log(err)
})
}, },
countHeight() { 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() { signHandle() {
...@@ -152,19 +161,21 @@ export default { ...@@ -152,19 +161,21 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '关闭', cancelButtonText: '关闭',
type: 'warning' type: 'warning'
}).then(() => {
this.endExamRequest()
}).catch(() => {
}) })
.then(() => {
this.endExamRequest()
})
.catch(() => {})
} else { } else {
this.$confirm(`确定要结束本次考试?还有${count}题未答,结束考试后,将不能返回本次考试`, '提示', { this.$confirm(`确定要结束本次考试?还有${count}题未答,结束考试后,将不能返回本次考试`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => {
this.endExamRequest()
}).catch(() => {
}) })
.then(() => {
this.endExamRequest()
})
.catch(() => {})
} }
} }
}, },
...@@ -186,40 +197,44 @@ export default { ...@@ -186,40 +197,44 @@ export default {
const param = { const param = {
answer: JSON.stringify(this.questionParams.answerRecord) answer: JSON.stringify(this.questionParams.answerRecord)
} }
action.Exam.endExam(this.$route.params.examId, param).then(res => { action.Exam.endExam(this.$route.params.examId, param)
if (!n) { .then(res => {
clearInterval(this.clearTime) if (!n) {
this.$router.replace({ clearInterval(this.clearTime)
path: '/examEnd'
})
}
// this.sendExamInfo(6)
window.localStorage.setItem('showflag', 'true')
}).catch(err => {
if (err.message.indexOf('error') !== -1) {
this.$confirm('网络异常,请保持网络通畅', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '退出考试',
cancelButtonText: '重新提交',
type: 'warning'
}).then(() => {
this.$router.replace({ this.$router.replace({
path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}` path: '/examEnd'
}) })
}).catch(action => { }
action === 'cancel' && (this.endExamRequest()) // this.sendExamInfo(6)
}) window.localStorage.setItem('showflag', 'true')
} else { })
this.$alert(err.message, { .catch(err => {
callback: action => {} if (err.message.indexOf('error') !== -1) {
}) this.$confirm('网络异常,请保持网络通畅', '提示', {
} distinguishCancelAndClose: true,
}) confirmButtonText: '退出考试',
cancelButtonText: '重新提交',
type: 'warning'
})
.then(() => {
this.$router.replace({
path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
})
})
.catch(action => {
action === 'cancel' && this.endExamRequest()
})
} else {
this.$alert(err.message, {
callback: action => {}
})
}
})
}, },
countDown(time) { countDown(time) {
const lefttime = parseInt((time) / 1000) const lefttime = parseInt(time / 1000)
const h = this.addZero(parseInt(lefttime / (60 * 60) % 24)) const h = this.addZero(parseInt((lefttime / (60 * 60)) % 24))
const m = this.addZero(parseInt(lefttime / 60 % 60)) const m = this.addZero(parseInt((lefttime / 60) % 60))
const s = this.addZero(parseInt(lefttime % 60)) const s = this.addZero(parseInt(lefttime % 60))
this.examTime = `${h} : ${m} : ${s} 倒计时` this.examTime = `${h} : ${m} : ${s} 倒计时`
}, },
...@@ -238,10 +253,11 @@ export default { ...@@ -238,10 +253,11 @@ export default {
this.countDown(countTime) this.countDown(countTime)
} }
if (flag) { if (flag) {
parseInt(countTime) <= 5 && (() => { parseInt(countTime) <= 5 &&
this.endExamRequest(1) (() => {
flag = false this.endExamRequest(1)
})() flag = false
})()
} }
}, 1000) }, 1000)
}, },
...@@ -256,30 +272,35 @@ export default { ...@@ -256,30 +272,35 @@ export default {
}, },
changeIndex(type) { changeIndex(type) {
if (type === 'prev') { if (type === 'prev') {
this.questionParams.questionIndex > 0 && (this.questionParams.questionIndex--) this.questionParams.questionIndex > 0 && this.questionParams.questionIndex--
} else { } 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++
} }
}, },
getTopic() { getTopic() {
action.Exam.getTopic(this.$route.params.examId).then(res => { action.Exam.getTopic(this.$route.params.examId)
this.questionParams.question = res .then(res => {
this.getCache() this.questionParams.question = res
}).catch(err => { this.getCache()
this.isExamEnd = true })
console.log(err) .catch(err => {
}) this.isExamEnd = true
console.log(err)
})
}, },
getCache() { getCache() {
action.Exam.getCache(this.$route.params.examId).then(res => { action.Exam.getCache(this.$route.params.examId)
const data = JSON.parse(res.answer) .then(res => {
if (data !== null && data !== 'null') { const data = JSON.parse(res.answer)
this.questionParams.answerRecord = data if (data !== null && data !== 'null') {
this.getSignStu() this.questionParams.answerRecord = data
} this.getSignStu()
}).catch(err => { }
console.log(err) })
}) .catch(err => {
console.log(err)
})
}, },
getSignStu() { getSignStu() {
this.questionParams.question.question_items.map((item, index) => { this.questionParams.question.question_items.map((item, index) => {
...@@ -300,43 +321,43 @@ export default { ...@@ -300,43 +321,43 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.answer-box{ .answer-box {
width: 100%; width: 100%;
height: 100%; height: 100%;
// background: #f9f9f9; // background: #f9f9f9;
.head{ .head {
width: 100%; width: 100%;
height: 80px; height: 80px;
background: #FFFFFF; background: #ffffff;
display: flex; display: flex;
.title{ .title {
padding-left: 30px; padding-left: 30px;
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 80px; line-height: 80px;
} }
.right{ .right {
position: relative; position: relative;
width: 260px; width: 260px;
margin-left: auto; margin-left: auto;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
.count{ .count {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
} }
.time{ .time {
display: flex; display: flex;
.icon{ .icon {
width: 23px; width: 23px;
height: 23px; height: 23px;
background: url(../../assets/images/tick.png); background: url(../../assets/images/tick.png);
background-size:100% 100%; background-size: 100% 100%;
} }
.mun{ .mun {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
...@@ -346,9 +367,9 @@ export default { ...@@ -346,9 +367,9 @@ export default {
} }
} }
} }
.exam-main{ .exam-main {
display: flex; display: flex;
.left{ .left {
flex: 1; flex: 1;
padding: 10px 20px 0 53px; padding: 10px 20px 0 53px;
overflow-y: scroll; overflow-y: scroll;
...@@ -357,7 +378,7 @@ export default { ...@@ -357,7 +378,7 @@ export default {
display: none; display: none;
} }
} }
.right{ .right {
position: relative; position: relative;
width: 220px; width: 220px;
background: #fff; background: #fff;
...@@ -369,50 +390,50 @@ export default { ...@@ -369,50 +390,50 @@ export default {
} }
} }
} }
.foot{ .foot {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 60px; height: 60px;
background: #FFFFFF; background: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
.exam-btn{ .exam-btn {
display: flex; display: flex;
padding-left: 40px; padding-left: 40px;
cursor: pointer; cursor: pointer;
div{ div {
width: 100px; width: 100px;
height: 40px; height: 40px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #CCCCCC; border: 1px solid #cccccc;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
color: #999999; color: #999999;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
margin-right: 20px; margin-right: 20px;
&.active{ &.active {
background: #C01540; background: #c01540;
border-radius: 4px; border-radius: 4px;
color: #fff; color: #fff;
} }
} }
} }
.rigth-btn{ .rigth-btn {
display: flex; display: flex;
margin-left: auto; margin-left: auto;
.end-exam-btn{ .end-exam-btn {
width: 260px; width: 260px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.btn{ .btn {
cursor: pointer; cursor: pointer;
width: 200px; width: 200px;
height: 40px; height: 40px;
background: #C01540; background: #c01540;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
...@@ -421,22 +442,22 @@ export default { ...@@ -421,22 +442,22 @@ export default {
text-align: center; text-align: center;
} }
} }
.sign{ .sign {
margin-right: 20px; margin-right: 20px;
.icon{ .icon {
margin: 0 auto; margin: 0 auto;
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url(../../assets/images/sign.png); background: url(../../assets/images/sign.png);
background-size:100% 100%; background-size: 100% 100%;
&.active{ &.active {
background: url(../../assets/images/sign2.png); background: url(../../assets/images/sign2.png);
background-size:100% 100%; background-size: 100% 100%;
} }
} }
.txt{ .txt {
font-size: 14px; font-size: 14px;
color: #CCCCCC; color: #cccccc;
line-height: 20px; line-height: 20px;
margin-top: 2px; margin-top: 2px;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<!-- 您登录的次数已超过最大限制 --> <!-- 您登录的次数已超过最大限制 -->
<input <input
type="text" type="text"
@click="fullScreen"
v-model="examineeNumber" v-model="examineeNumber"
placeholder="请输入准考证号" placeholder="请输入准考证号"
v-show="!loginParam.is" v-show="!loginParam.is"
......
html, body { html,
body {
font-size: 14px; // 防止html根元素 影响本身DOM元素字体大小继承 font-size: 14px; // 防止html根元素 影响本身DOM元素字体大小继承
padding: 0; padding: 0;
margin: 0; margin: 0;
...@@ -8,47 +9,45 @@ html, body { ...@@ -8,47 +9,45 @@ html, body {
} }
/* 统一字体样式 */ /* 统一字体样式 */
* { * {
font-family: font-family: 'Source Han Sans CN', 'PingFang SC', -apple-system, 'Microsoft YaHei', 'Helvetica', 'Arial', Verdana,
"Source Han Sans CN", 'Hiragino Sans GB', 'Wenquanyi Micro Hei', sans-serif;
"PingFang SC", touch-action: pan-y;
-apple-system,
"Microsoft YaHei",
"Helvetica",
"Arial",
Verdana,
"Hiragino Sans GB",
"Wenquanyi Micro Hei",
sans-serif;
} }
/* Extra small devices (portrait phones, less than 576px) */ /* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {} @media (max-width: 575px) {
}
/* Small devices (landscape phones, 576px and up) */ /* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {} @media (min-width: 576px) and (max-width: 767px) {
}
/* Medium devices (tablets, 768px and up) */ /* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {} @media (min-width: 768px) and (max-width: 991px) {
}
/* Large devices (desktops, 992px and up) */ /* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {} @media (min-width: 992px) and (max-width: 1199px) {
}
/* Extra large devices (large desktops, 1200px and up) */ /* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {} @media (min-width: 1200px) {
}
/* 改变主题色变量 */ /* 改变主题色变量 */
$--color-primary: #b80037; $--color-primary: #b80037;
/* 改变 icon 字体路径变量,必需 */ /* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts'; $--font-path: '~element-ui/lib/theme-chalk/fonts';
/* 引入element-ui对应scss文件,重新编译 */ /* 引入element-ui对应scss文件,重新编译 */
@import "~element-ui/packages/theme-chalk/src/index"; @import '~element-ui/packages/theme-chalk/src/index';
/* 引入隐藏显示样式 */ /* 引入隐藏显示样式 */
@import "~element-ui/lib/theme-chalk/display.css"; @import '~element-ui/lib/theme-chalk/display.css';
/* 引入三方 自定义图标库,方法 vue -> 第三方 自建图标库 中有 */ /* 引入三方 自定义图标库,方法 vue -> 第三方 自建图标库 中有 */
@import "~@/assets/font-icons/iconfont.css"; @import '~@/assets/font-icons/iconfont.css';
[class^="el-icon-self-"], [class*="el-icon-self-"] { [class^='el-icon-self-'],
font-family: "selfAllIcon" !important; [class*='el-icon-self-'] {
font-family: 'selfAllIcon' !important;
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论