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

update

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