提交 cb6821b7 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 优化代码

上级 80eb10b1
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAn0EINdIXTDCzmR7J5FOjOV+PbXt7GNO6fanoCGe2O0CPRlNf MIIEpAIBAAKCAQEAucCbdPPyAp6vmnr5XObuPsctUhVLyXwqbIpgI5jWzjG7wmk8
2Ea/wv6SlRtJPd0ohmnKqZdUbBpAsiV4ggOdOqeEB6utVYQWY/zhXRKYeRjN/iDu V6z8WJKPO9KZM6D9ejtN/bbbd3j1cRiw7NSl8AUykiVHJWz9TXAflET2EpILLera
WCRY5S+eRVkSzVOJP9DlBn6dnHSsWj55h1PrkIac8B862F/cVno/Wk5dqU55ZUoN I1B2XAcBsc8dZBGGJD/LT97ZvNLYzuQOr7R1wytWH1uisAK5ClzgnSptMenXFyhw
wHGw5Goz3R37w+Q0C9HRS5mrmPqI+Ogy8TJrIRxw9YAj5OlvuqBAeYAW1sNdEfsi 5Xw0Lm3zoeeqYF/KMQ1McAYMGxgu6s6dxXKiA0BcgWQ31yZey0c4HhCt7T7sA/UN
mMB0H2fbbXqEL4AsipE5ppP7Ij3vxVpxvmnl/SO7N6+Fit6r25VeFSvplK+PIV3c ahUsxtCcSNSvdgXay5Pu/l3N88TwW2QzaCzrueILHWRFwkREhpqyrwjN3gkaa+1T
UsK3PCKV2sOo0BDWtWFQh5hW3fK5RYjLpNDHCwIDAQABAoIBAEkiBDMzF5/VfaSD jLxzCsk/pTnPccxlFwc3YQ3hYLMl36NJ/OIpHwIDAQABAoIBACuMmaXYz6OHmroI
jxNblUlzqNoOKqlsEehDblrtxbHQI/uXrhwT4VwarBXtQeU2+rU/P+JBrHM4Wx10 HNCIH9E+F0UIUyVg4/1gj9uoqKvdAx04WPphRyRo8AXhgSOWmfb/UnCqX1fqVvj2
N7L9FecppmgfXqo2zlF8f8HOGFcEHRTm6o1vo6McCwKttQS1qAG2XHZvDtIag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o6tnRphR+DE50oYOX1TSQRm4cDgP2JURYiTK6Z2+ljqMbUx4mNLqe
MA0GCSqGSIb3DQEBCwUAA4IBAQBWSrE/pt//MKeGpf6vMISGD0LZArebPFQ7wlgv +6yG+PGCUX6rX4BsJqlRP2W7WONE/I3/3S6MRfclKmakHSyrGFi8O/JJyNqm+5z9
Y13HpCY5lqwrZItsuXWS5IYMv8ueYarCm081OJOBvSUKHOtYSe6wdFqsXehokUiy 8tnk8c1Cn7FboJZonhX0yszHkXLLeA93xm5+Etkw0+DvRcZGiEqKQivO3CnUh1gs
7oVNief7Li5RvLcf6z5fyjB+i017dds73Dt94mE1imV1DR1WErp1U6QCMEh+TKFa LZg27a8s3dtmAAHbb2icm5jloK9Jgpx/NkGL/cCoNZ8Ng2TZkRvo6GzIp43uS332
PL52V9X5VWiYdImzdm8AWOlNBrgicmVzEEQuglejF5uaALf9iiyAjP36apqXv77T R07dQ6rNWZkPzdxKUdNcT0v3yJJyxD1H3Rk4/bxp78giw4JGHp52Df+U
UtxKgjONB1tnRw4XRqzwrEK+QjeOhziKCn1v2ppFX/Z11YYA7ajICVrG6wGJ+ENc
ukf5+v8r+TU7PqxQmb62zocX22jhe8HM644UJ4FWCiBh4Lb1
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIFFjCCA/6gAwIBAgIQCH4Y+4+qkn7odgoNiYL1EjANBgkqhkiG9w0BAQsFADBh MIIEzzCCA7egAwIBAgIRAPJECC2rqQ2ljHLp8pqTQK4wDQYJKoZIhvcNAQELBQAw
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 fjELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD QS4xJzAlBgNVBAsTHkN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mW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg
AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7
HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
6GAqm4VKQPNriiTsBhYscw==
-----END CERTIFICATE----- -----END CERTIFICATE-----
...@@ -5,13 +5,13 @@ export default class ExamAPI extends BaseAPI { ...@@ -5,13 +5,13 @@ export default class ExamAPI extends BaseAPI {
* 获取考试信息 * 获取考试信息
* @param {[string]} examId resource_id * @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' } })
/** /**
* 进入考试 * 进入考试
*/ */
......
...@@ -5,7 +5,7 @@ export default class TestAPI extends BaseAPI { ...@@ -5,7 +5,7 @@ export default class TestAPI extends BaseAPI {
* 获取考试信息 * 获取考试信息
* @param {[string]} examId resource_id * @param {[string]} examId resource_id
*/ */
getExamInfo = (examId) => this.get(`/xexam/v1/exam/view/${examId}`, {}) getExamInfo = examId => this.get(`/xexam/v1/exam/view/${examId}`, {})
/** /**
* 进入考试 * 进入考试
*/ */
......
...@@ -5,14 +5,14 @@ export default class TestAPI extends BaseAPI { ...@@ -5,14 +5,14 @@ export default class TestAPI extends BaseAPI {
* get传输方式 * get传输方式
* @param {[string]} id resource_id * @param {[string]} id resource_id
*/ */
getTest = (id) => this.get(`/vue-client/get/${id}`, {}) getTest = id => this.get(`/vue-client/get/${id}`, {})
/** /**
* post传输方式 * post传输方式
* @param {[object]} obj * @param {[object]} obj
*/ */
postTest = (obj = {}) => this.post('/passport/rest/login', obj, { headers: { 'Content-Type': 'multipart/form-data' } }) 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' } })
} }
...@@ -3,14 +3,7 @@ ...@@ -3,14 +3,7 @@
<div ref="wrapper"> <div ref="wrapper">
<div class="info"> <div class="info">
<div class="shape"> <div class="shape">
<img <img :src="info.id_photo ? info.id_photo : 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'" />
:src="
info.id_photo
? info.id_photo
: 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'
"
alt=""
/>
</div> </div>
<div class="right"> <div class="right">
<div class="name">{{ info.name }}</div> <div class="name">{{ info.name }}</div>
...@@ -132,8 +125,7 @@ export default { ...@@ -132,8 +125,7 @@ export default {
info: { type: Object, default: () => {} } info: { type: Object, default: () => {} }
}, },
data() { data() {
return { return {}
}
}, },
mounted() { mounted() {
if (!this.isMobile()) { if (!this.isMobile()) {
...@@ -196,7 +188,7 @@ export default { ...@@ -196,7 +188,7 @@ export default {
} }
} }
} }
.order-scroll{ .order-scroll {
// max-height: 100px; // max-height: 100px;
// overflow-y: scroll; // overflow-y: scroll;
} }
......
...@@ -7,21 +7,26 @@ ...@@ -7,21 +7,26 @@
<div class="num">{{ questionData.q_order }}/{{ questionParams.question.total_question_count }}</div> <div class="num">{{ questionData.q_order }}/{{ questionParams.question.total_question_count }}</div>
</div> </div>
<div class="title"> <div class="title">
<div class="num">{{ questionData.q_order }}.</div><div class="des" v-html="questionData.content"></div> <div class="num">{{ questionData.q_order }}.</div>
<div class="des" v-html="questionData.content"></div>
</div> </div>
<!-- <div class="describe" ></div> --> <!-- <div class="describe" ></div> -->
<ul :class="questionData.question_item_type == 2 ? 'check-option' : 'radio-option'"> <ul :class="questionData.question_item_type == 2 ? 'check-option' : 'radio-option'">
<template v-for="(item, index) in questionData.options"> <template v-for="(item, index) in questionData.options">
<li <li
:key="index" :key="index"
:class="questionParams.answerRecord[questionData.question_item_id] :class="
? questionParams.answerRecord[questionData.question_item_id][questionData.id] questionParams.answerRecord[questionData.question_item_id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id => { return id === item.id }) ? questionParams.answerRecord[questionData.question_item_id][questionData.id]
? 'active' ? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id => {
return id === item.id
})
? 'active'
: ''
: '' : ''
: '' : ''
: ''" "
> >
<div @click="changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)"> <div @click="changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)">
<div class="icon"></div> <div class="icon"></div>
<div class="txt" v-html="item.option"></div> <div class="txt" v-html="item.option"></div>
...@@ -37,9 +42,15 @@ ...@@ -37,9 +42,15 @@
<div class="num">{{ questionData.q_order }}/{{ questionParams.question.total_question_count }}</div> <div class="num">{{ questionData.q_order }}/{{ questionParams.question.total_question_count }}</div>
</div> </div>
<div class="title"> <div class="title">
<div class="num">{{ questionData.q_order }}.</div><div class="des" v-html="questionData.content"></div> <div class="num">{{ questionData.q_order }}.</div>
<div class="des" v-html="questionData.content"></div>
</div> </div>
<el-input @input="QAChange(questionData.question_item_id, questionData.id, questionData.textContent)" type="textarea" placeholder="请输入内容" v-model="questionData.textContent"></el-input> <el-input
@input="QAChange(questionData.question_item_id, questionData.id, questionData.textContent)"
type="textarea"
placeholder="请输入内容"
v-model="questionData.textContent"
></el-input>
</template> </template>
<!-- 复合题 --> <!-- 复合题 -->
<template v-if="questionData.question_item_type == 5 || questionData.question_item_type == 7 || questionData.question_item_type == 8"> <template v-if="questionData.question_item_type == 5 || questionData.question_item_type == 7 || questionData.question_item_type == 8">
...@@ -54,29 +65,35 @@ ...@@ -54,29 +65,35 @@
<template v-for="(item, index) in questionData.list"> <template v-for="(item, index) in questionData.list">
<li :key="'type5' + index"> <li :key="'type5' + index">
<div :class="item.q_order === questionParams.questionIndex + 1 ? 'active title' : 'title'"> <div :class="item.q_order === questionParams.questionIndex + 1 ? 'active title' : 'title'">
<div class="num">{{ item.q_order }}.</div><div class="des" v-html="item.content"></div> <div class="num">{{ item.q_order }}.</div>
<div class="des" v-html="item.content"></div>
</div> </div>
<div v-if="item.type == 3" @click="changeIndex(item.q_order)"> <div v-if="item.type == 3" @click="changeIndex(item.q_order)">
<el-input @input="QAChildChange(questionData.question_item_id, item, item.answer)" type="textarea" placeholder="请输入内容" v-model="item.answer"></el-input> <el-input @input="QAChildChange(questionData.question_item_id, item, item.answer)" type="textarea" placeholder="请输入内容" v-model="item.answer"></el-input>
</div> </div>
<!-- <el-input @input="QAChange(questionData.question_item_id, questionData.id)" type="textarea" placeholder="请输入内容" v-model="questionData.textContent"></el-input> --> <!-- <el-input @input="QAChange(questionData.question_item_id, questionData.id)" type="textarea" placeholder="请输入内容" v-model="questionData.textContent"></el-input> -->
<ul v-else :class="item.type == 2 ? 'check-option' : 'radio-option'"><!-- radio-option check-option --> <ul v-else :class="item.type == 2 ? 'check-option' : 'radio-option'">
<!-- radio-option check-option -->
<template v-if="item.options"> <template v-if="item.options">
<template v-for="(items, cIndex) in item.options"> <template v-for="(items, cIndex) in item.options">
<li <li
:id="items.id" :id="items.id"
:key="'c' + cIndex" :key="'c' + cIndex"
:class="questionParams.answerRecord[questionData.question_item_id] :class="
? questionParams.answerRecord[questionData.question_item_id][item.id] questionParams.answerRecord[questionData.question_item_id]
? questionParams.answerRecord[questionData.question_item_id][item.id].answer.find(id => { return id === items.id }) ? questionParams.answerRecord[questionData.question_item_id][item.id]
? 'active' ? questionParams.answerRecord[questionData.question_item_id][item.id].answer.find(id => {
return id === items.id
})
? 'active'
: ''
: '' : ''
: '' : ''
: ''" "
> >
<div @click="changeOptions(item.type, questionData.question_item_id, item.id, items.id, item.q_order)"> <div @click="changeOptions(item.type, questionData.question_item_id, item.id, items.id, item.q_order)">
<div class="icon"></div> <div class="icon"></div>
<div class="txt">{{items.option}}</div> <div class="txt">{{ items.option }}</div>
</div> </div>
</li> </li>
</template> </template>
...@@ -94,8 +111,7 @@ import action from '@action' ...@@ -94,8 +111,7 @@ import action from '@action'
import Bus from '@/components/common/bus.js' import Bus from '@/components/common/bus.js'
import _ from 'lodash' import _ from 'lodash'
export default { export default {
components: { components: {},
},
props: { props: {
contentHeight: { type: Number, default: () => {} }, contentHeight: { type: Number, default: () => {} },
questionParams: { type: Object, default: () => {} } questionParams: { type: Object, default: () => {} }
...@@ -108,11 +124,26 @@ export default { ...@@ -108,11 +124,26 @@ export default {
textarea: '' textarea: ''
} }
}, },
computed: {
examId() {
return this.$route.params.examId
},
changeQuestionIndex() {
return this.questionParams.questionIndex
}
},
watch: {
changeQuestionIndex(newV, oldV) {
this.dataCombined()
this.signCallback()
this.$nextTick(() => {
this.createTag()
})
}
},
beforeDestroy() { beforeDestroy() {
clearInterval(this.setCacheTime) clearInterval(this.setCacheTime)
}, },
created() {
},
mounted() { mounted() {
clearInterval(this.setCacheTime) clearInterval(this.setCacheTime)
this.setCacheTime = setInterval(() => { this.setCacheTime = setInterval(() => {
...@@ -128,7 +159,9 @@ export default { ...@@ -128,7 +159,9 @@ export default {
this.questionParams.question.question_items.map((item, index) => { this.questionParams.question.question_items.map((item, index) => {
if (parseInt(item.question_item_type) === 5 || parseInt(item.question_item_type) === 7 || parseInt(item.question_item_type) === 8) { if (parseInt(item.question_item_type) === 5 || parseInt(item.question_item_type) === 7 || parseInt(item.question_item_type) === 8) {
item.question_list.map(cItem => { item.question_list.map(cItem => {
const currentItem = cItem.list.find(items => { return items.q_order === this.questionParams.questionIndex + 1 }) const currentItem = cItem.list.find(items => {
return items.q_order === this.questionParams.questionIndex + 1
})
if (currentItem) { if (currentItem) {
this.questionData = {} this.questionData = {}
this.questionData.common_content = cItem.common_content this.questionData.common_content = cItem.common_content
...@@ -148,7 +181,7 @@ export default { ...@@ -148,7 +181,7 @@ export default {
this.questionData.list.map(el => { this.questionData.list.map(el => {
if (el.type === 3) { if (el.type === 3) {
if (this.questionParams.answerRecord[pId]) { if (this.questionParams.answerRecord[pId]) {
this.questionParams.answerRecord[pId][el.id] ? el.answer = this.questionParams.answerRecord[pId][el.id].answer[0] : el.answer = '' this.questionParams.answerRecord[pId][el.id] ? (el.answer = this.questionParams.answerRecord[pId][el.id].answer[0]) : (el.answer = '')
} else { } else {
el.answer = '' el.answer = ''
} }
...@@ -161,7 +194,9 @@ export default { ...@@ -161,7 +194,9 @@ export default {
}) })
this.$forceUpdate() this.$forceUpdate()
} else { } else {
const currentItem = item.question_list.find(items => { return items.q_order === this.questionParams.questionIndex + 1 }) const currentItem = item.question_list.find(items => {
return items.q_order === this.questionParams.questionIndex + 1
})
if (currentItem) { if (currentItem) {
this.questionData = currentItem this.questionData = currentItem
const key = ['question_item_id', 'question_item_title', 'question_item_type'] const key = ['question_item_id', 'question_item_title', 'question_item_type']
...@@ -214,19 +249,15 @@ export default { ...@@ -214,19 +249,15 @@ export default {
// 问答题回答 // 问答题回答
QAChange(pId, cId, length) { QAChange(pId, cId, length) {
// if (length.length < 500) { // if (length.length < 500) {
this.questionParams.answerRecord[pId] if (this.questionParams.answerRecord[pId]) {
? this.questionParams.answerRecord[pId][cId] if (this.questionParams.answerRecord[pId][cId]) {
? this.questionParams.answerRecord[pId][cId].answer = [this.questionData.textContent] this.questionParams.answerRecord[pId][cId].answer = [this.questionData.textContent]
: this.questionParams.answerRecord[pId][cId] = { } else {
answer: [this.questionData.textContent], this.questionParams.answerRecord[pId][cId] = { answer: [this.questionData.textContent], sign: false }
sign: false
}
: this.questionParams.answerRecord[pId] = {
[cId]: {
answer: [this.questionData.textContent],
sign: false
}
} }
} else {
this.questionParams.answerRecord[pId] = { [cId]: { answer: [this.questionData.textContent], sign: false } }
}
this.$forceUpdate() this.$forceUpdate()
// } else { // } else {
// this.$message({ // this.$message({
...@@ -245,40 +276,32 @@ export default { ...@@ -245,40 +276,32 @@ export default {
this.questionParams.questionIndex = order - 1 this.questionParams.questionIndex = order - 1
} }
if (parseInt(type) !== 2) { if (parseInt(type) !== 2) {
this.questionParams.answerRecord[pId] if (this.questionParams.answerRecord[pId]) {
? this.questionParams.answerRecord[pId][cId] if (this.questionParams.answerRecord[pId][cId]) {
? this.questionParams.answerRecord[pId][cId].answer = [optId] this.questionParams.answerRecord[pId][cId].answer = [optId]
: this.questionParams.answerRecord[pId][cId] = { } else {
answer: [optId], this.questionParams.answerRecord[pId][cId] = { answer: [optId], sign: false }
sign: false
}
: this.questionParams.answerRecord[pId] = {
[cId]: {
answer: [optId],
sign: false
}
} }
} else {
this.questionParams.answerRecord[pId] = { [cId]: { answer: [optId], sign: false } }
}
} else { } else {
this.questionParams.answerRecord[pId] if (this.questionParams.answerRecord[pId]) {
? this.questionParams.answerRecord[pId][cId] if (this.questionParams.answerRecord[pId][cId]) {
? (() => { const optCheck = this.questionParams.answerRecord[pId][cId].answer.findIndex(item => {
const optChack = this.questionParams.answerRecord[pId][cId].answer.findIndex(item => { return item === optId }) return item === optId
if (optChack === -1) { })
this.questionParams.answerRecord[pId][cId].answer.push(optId) if (optCheck === -1) {
} else { this.questionParams.answerRecord[pId][cId].answer.push(optId)
this.questionParams.answerRecord[pId][cId].answer.splice(optChack, 1) } else {
} this.questionParams.answerRecord[pId][cId].answer.splice(optCheck, 1)
})()
: this.questionParams.answerRecord[pId][cId] = {
answer: [optId],
sign: false
}
: this.questionParams.answerRecord[pId] = {
[cId]: {
answer: [optId],
sign: false
} }
} else {
this.questionParams.answerRecord[pId][cId] = { answer: [optId], sign: false }
} }
} else {
this.questionParams.answerRecord[pId] = { [cId]: { answer: [optId], sign: false } }
}
} }
Bus.$emit('monitoringChanges') Bus.$emit('monitoringChanges')
this.$forceUpdate() this.$forceUpdate()
...@@ -287,27 +310,28 @@ export default { ...@@ -287,27 +310,28 @@ export default {
const param = { const param = {
answer: JSON.stringify(this.questionParams.answerRecord) answer: JSON.stringify(this.questionParams.answerRecord)
} }
action.Exam.setCache(this.$route.params.examId, param).then(res => { action.Exam.setCache(this.examId, param)
}).catch(err => { .then(res => {})
// if (err.message.indexOf('error') !== -1) { .catch(err => {
// this.$confirm('网络异常,请保持网络通畅', '提示', { // if (err.message.indexOf('error') !== -1) {
// confirmButtonText: '退出考试', // this.$confirm('网络异常,请保持网络通畅', '提示', {
// cancelButtonText: '重新提交', // confirmButtonText: '退出考试',
// type: 'warning' // cancelButtonText: '重新提交',
// }).then(() => { // type: 'warning'
// this.$router.replace({ // }).then(() => {
// path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}` // this.$router.replace({
// }) // path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
// }).catch(() => { // })
// this.endExamRequest() // }).catch(() => {
// }) // this.endExamRequest()
// } else { // })
// // this.$alert(err.message, { // } else {
// // callback: action => {} // // this.$alert(err.message, {
// // }) // // callback: action => {}
// console.log(err.message) // // })
// } // console.log(err.message)
}) // }
})
}, },
// 标记 // 标记
onSignHandle() { onSignHandle() {
...@@ -317,11 +341,7 @@ export default { ...@@ -317,11 +341,7 @@ export default {
this.questionData.list.forEach(item => { this.questionData.list.forEach(item => {
if (this.questionParams.answerRecord[pId]) { if (this.questionParams.answerRecord[pId]) {
if (this.questionParams.answerRecord[pId][item.id]) { if (this.questionParams.answerRecord[pId][item.id]) {
if (this.questionParams.answerRecord[pId][item.id].sign) { this.questionParams.answerRecord[pId][item.id].sign = !this.questionParams.answerRecord[pId][item.id].sign
this.questionParams.answerRecord[pId][item.id].sign = false
} else {
this.questionParams.answerRecord[pId][item.id].sign = true
}
} else { } else {
this.questionParams.answerRecord[pId][item.id] = { sign: true, answer: [] } this.questionParams.answerRecord[pId][item.id] = { sign: true, answer: [] }
} }
...@@ -330,21 +350,15 @@ export default { ...@@ -330,21 +350,15 @@ export default {
} }
}) })
} else { } else {
this.questionParams.answerRecord[pId] if (this.questionParams.answerRecord[pId]) {
? this.questionParams.answerRecord[pId][cId] if (this.questionParams.answerRecord[pId][cId]) {
? this.questionParams.answerRecord[pId][cId].sign this.questionParams.answerRecord[pId][cId].sign = !this.questionParams.answerRecord[pId][cId].sign
? this.questionParams.answerRecord[pId][cId].sign = false } else {
: this.questionParams.answerRecord[pId][cId].sign = true this.questionParams.answerRecord[pId][cId] = { sign: true, answer: [] }
: this.questionParams.answerRecord[pId][cId] = {
sign: true,
answer: []
}
: this.questionParams.answerRecord[pId] = {
[cId]: {
sign: true,
answer: []
}
} }
} else {
this.questionParams.answerRecord[pId] = { [cId]: { sign: true, answer: [] } }
}
} }
this.signCallback() this.signCallback()
}, },
...@@ -354,9 +368,9 @@ export default { ...@@ -354,9 +368,9 @@ export default {
let isSign = false let isSign = false
this.questionParams.answerRecord[pId] this.questionParams.answerRecord[pId]
? this.questionParams.answerRecord[pId][cId] ? this.questionParams.answerRecord[pId][cId]
? isSign = this.questionParams.answerRecord[pId][cId].sign ? (isSign = this.questionParams.answerRecord[pId][cId].sign)
: isSign = false : (isSign = false)
: isSign = false : (isSign = false)
this.$emit('isSign', isSign) this.$emit('isSign', isSign)
Bus.$emit('monitoringChanges') Bus.$emit('monitoringChanges')
}, },
...@@ -383,78 +397,65 @@ export default { ...@@ -383,78 +397,65 @@ export default {
$('body').append(script2) $('body').append(script2)
$('body').append(script) $('body').append(script)
} }
},
computed: {
changeQuestionIndex() {
return this.questionParams.questionIndex
}
},
watch: {
changeQuestionIndex(newV, oldV) {
this.dataCombined()
this.signCallback()
this.$nextTick(() => {
this.createTag()
})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep{ ::v-deep {
.el-textarea__inner{ .el-textarea__inner {
height: 150px; height: 150px;
} }
} }
.title-type{ .title-type {
width: 100%; width: 100%;
height: 45px; height: 45px;
border-bottom:1px solid #ccc; border-bottom: 1px solid #ccc;
display: flex; display: flex;
align-items: center; align-items: center;
.type{ .type {
font-size: 18px; font-size: 18px;
color: #222222; color: #222222;
} }
.num{ .num {
margin-left: auto; margin-left: auto;
font-size: 18px; font-size: 18px;
color: #222222; color: #222222;
} }
} }
.title{ .title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 25px; line-height: 25px;
display: flex; display: flex;
.num{ .num {
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 45px; line-height: 45px;
margin-top: 5px; margin-top: 5px;
} }
.des{ .des {
margin-left: 5px; margin-left: 5px;
padding-top: 18px; padding-top: 18px;
&::v-deep p{ &::v-deep p {
margin: 0; margin: 0;
} }
} }
} }
.describe{ .describe {
font-size: 18px; font-size: 18px;
color: #222222; color: #222222;
line-height: 25px; line-height: 25px;
margin-top: 20px; margin-top: 20px;
} }
.radio-option,.check-option{ .radio-option,
.check-option {
padding: 24px 0 0 0; padding: 24px 0 0 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
li{ li {
// cursor: pointer; // cursor: pointer;
margin-bottom: 20px; margin-bottom: 20px;
// display: flex; // display: flex;
...@@ -463,7 +464,7 @@ export default { ...@@ -463,7 +464,7 @@ export default {
div { div {
float: left; float: left;
cursor: pointer; cursor: pointer;
.icon{ .icon {
width: 18px; width: 18px;
height: 18px; height: 18px;
border: 1px solid #999999; border: 1px solid #999999;
...@@ -471,14 +472,14 @@ export default { ...@@ -471,14 +472,14 @@ export default {
margin-top: 3px; margin-top: 3px;
float: left; float: left;
} }
.txt{ .txt {
max-width: 95%; max-width: 95%;
font-size: 18px; font-size: 18px;
color: #222222; color: #222222;
line-height: 28px; line-height: 28px;
margin-left: 10px; margin-left: 10px;
float: left; float: left;
&::v-deep p{ &::v-deep p {
margin: 0; margin: 0;
} }
} }
...@@ -497,36 +498,36 @@ export default { ...@@ -497,36 +498,36 @@ export default {
// line-height: 28px; // line-height: 28px;
// margin-left: 10px; // margin-left: 10px;
// } // }
&.active{ &.active {
.icon{ .icon {
width: 8px; width: 8px;
height: 8px; height: 8px;
border: 6px solid #C01540; border: 6px solid #c01540;
} }
} }
} }
} }
.check-option{ .check-option {
.icon{ .icon {
border-radius: 3px !important; border-radius: 3px !important;
} }
} }
.case-que{ .case-que {
::v-deep{ ::v-deep {
img{ img {
display: block; display: block;
width:100%; width: 100%;
} }
} }
display: flex; display: flex;
.stem{ .stem {
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 28px; line-height: 28px;
} }
.topics{ .topics {
flex: 1; flex: 1;
margin: 0; margin: 0;
padding: 0 0 0 20px; padding: 0 0 0 20px;
...@@ -536,19 +537,19 @@ export default { ...@@ -536,19 +537,19 @@ export default {
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
li{ li {
.title{ .title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 25px; line-height: 25px;
&.active{ &.active {
color: #c01540; color: #c01540;
.num{ .num {
color: #c01540 !important; color: #c01540 !important;
} }
} }
span{ span {
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> --> <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> -->
<!-- <meta http-equiv="Pragma" content="no-cache" /> --> <!-- <meta http-equiv="Pragma" content="no-cache" /> -->
<!-- <meta http-equiv="Expires" content="0" /> --> <!-- <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" /> <meta name="viewport" id="viewport" content="initial-scale=-1,maximum-scale=1,shrink-to-fit=no,user-scalable=no" />
</head> </head>
<body> <body>
......
...@@ -25,12 +25,7 @@ ...@@ -25,12 +25,7 @@
</div> </div>
</div> </div>
<div :class="isMobile() ? 'right scroll' : 'right hidden'" ref="wrapper"> <div :class="isMobile() ? 'right scroll' : 'right hidden'" ref="wrapper">
<answer-card <answer-card :questionParams="questionParams" :changeTime="changeTime" :info="studentInfo" @switchQuestion="switchQuestion"></answer-card>
:questionParams="questionParams"
:changeTime="changeTime"
:info="sInfo.info"
@switchQuestion="switchQuestion"
></answer-card>
</div> </div>
<ul class="flag-tips"> <ul class="flag-tips">
<li> <li>
...@@ -56,10 +51,7 @@ ...@@ -56,10 +51,7 @@
<div @click="changeIndex('prev')" :class="this.questionParams.questionIndex !== 0 ? 'active' : ''"> <div @click="changeIndex('prev')" :class="this.questionParams.questionIndex !== 0 ? 'active' : ''">
上一题 上一题
</div> </div>
<div <div :class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''" @click="changeIndex('next')">
:class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@click="changeIndex('next')"
>
下一题 下一题
</div> </div>
</div> </div>
...@@ -91,7 +83,7 @@ import BScroll from 'better-scroll' ...@@ -91,7 +83,7 @@ import BScroll from 'better-scroll'
export default { export default {
metaInfo() { metaInfo() {
return { return {
title: JSON.parse(window.localStorage.getItem('examInfo')).name || '' title: this.examInfo.name || ''
} }
}, },
components: { components: {
...@@ -100,14 +92,23 @@ export default { ...@@ -100,14 +92,23 @@ export default {
'my-dia': dialogComponent 'my-dia': dialogComponent
}, },
data() { 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 { return {
isExamEnd: false, isExamEnd: false,
isExamTimeDate: true, isExamTimeDate: true,
itemSign: false, itemSign: false,
examTime: '00:00:00 倒计时', examTime: '00:00:00 倒计时',
clearTime: null, clearTime: null,
sInfo: JSON.parse(window.localStorage.getItem('studentInfo')), studentInfo,
examInfo: JSON.parse(window.localStorage.getItem('examInfo')), examInfo,
title: '提示', title: '提示',
prompt: '确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!', prompt: '确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!',
isPopup: false, isPopup: false,
...@@ -125,6 +126,20 @@ export default { ...@@ -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() { mounted() {
// this.sendExamInfo(3) // this.sendExamInfo(3)
this.setTick() this.setTick()
...@@ -149,8 +164,8 @@ export default { ...@@ -149,8 +164,8 @@ export default {
}, },
sendExamInfo(status) { sendExamInfo(status) {
const param = { const param = {
student_id: this.sInfo.info.student_id, student_id: this.studentInfo.student_id,
exam_id: this.examInfo.exam_id, exam_id: this.examId,
status: status status: status
} }
action.Login.sendExamInfo(param) action.Login.sendExamInfo(param)
...@@ -160,9 +175,7 @@ export default { ...@@ -160,9 +175,7 @@ export default {
}) })
}, },
countHeight() { countHeight() {
this.contentHeight = parseInt( this.contentHeight = parseInt(document.body.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight))
document.body.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight)
)
}, },
// 标记 // 标记
signHandle() { signHandle() {
...@@ -178,12 +191,7 @@ export default { ...@@ -178,12 +191,7 @@ export default {
this.$alert('考试时间到', { this.$alert('考试时间到', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$router.replace({ this.$router.replace({ path: '/examEnd', query: { id: this.examId } })
path: '/examEnd',
query: {
id: JSON.parse(window.localStorage.getItem('examInfo')).exam_id
}
})
} }
}) })
} else { } else {
...@@ -229,7 +237,7 @@ export default { ...@@ -229,7 +237,7 @@ 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.examId, param).then(res => {
if (!n) { if (!n) {
clearInterval(this.clearTime) clearInterval(this.clearTime)
this.$router.replace({ this.$router.replace({
...@@ -249,7 +257,7 @@ export default { ...@@ -249,7 +257,7 @@ export default {
// }) // })
// .then(() => { // .then(() => {
// this.$router.replace({ // this.$router.replace({
// path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}` // path: `/login/${this.examId}`
// }) // })
// }) // })
// .catch(action => { // .catch(action => {
...@@ -263,18 +271,18 @@ export default { ...@@ -263,18 +271,18 @@ export default {
// }) // })
}, },
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} 倒计时`
}, },
setTick() { setTick() {
let flag = true let flag = true
this.clearTime = setInterval(() => { this.clearTime = setInterval(() => {
const nowtime = new Date() const nowTime = new Date()
const endtime = new Date(this.examInfo.end_time.replace(/-/g, '/')) const endTime = new Date(this.examInfo.end_time.replace(/-/g, '/'))
const countTime = endtime.getTime() - nowtime.getTime() const countTime = endTime.getTime() - nowTime.getTime()
if (countTime <= 0) { if (countTime <= 0) {
this.isExamTimeDate = false this.isExamTimeDate = false
clearInterval(this.clearTime) clearInterval(this.clearTime)
...@@ -305,8 +313,7 @@ export default { ...@@ -305,8 +313,7 @@ export default {
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 + 1 !== this.questionParams.question.total_question_count && this.questionParams.questionIndex++
this.questionParams.questionIndex++
} }
this.refreshBscroll() this.refreshBscroll()
}, },
...@@ -322,7 +329,7 @@ export default { ...@@ -322,7 +329,7 @@ export default {
this.refreshBscroll() this.refreshBscroll()
}, },
getTopic() { getTopic() {
action.Exam.getTopic(this.$route.params.examId) action.Exam.getTopic(this.examId)
.then(res => { .then(res => {
this.questionParams.question = res this.questionParams.question = res
this.getCache() this.getCache()
...@@ -333,8 +340,8 @@ export default { ...@@ -333,8 +340,8 @@ export default {
}) })
}, },
getCache() { getCache() {
if (this.$route.params.examId) { if (this.examId) {
action.Exam.getCache(this.$route.params.examId) action.Exam.getCache(this.examId)
.then(res => { .then(res => {
const data = JSON.parse(res.answer) const data = JSON.parse(res.answer)
if (data !== null && data !== 'null') { if (data !== null && data !== 'null') {
...@@ -371,16 +378,6 @@ export default { ...@@ -371,16 +378,6 @@ export default {
const isPc = !isPhone && !isAndroid && !isSymbian const isPc = !isPhone && !isAndroid && !isSymbian
return isPc return isPc
} }
},
computed: {
changeQuestionIndex() {
return this.questionParams.questionIndex
}
},
watch: {
changeQuestionIndex(newV, oldV) {
this.refreshBscroll()
}
} }
} }
</script> </script>
......
...@@ -17,26 +17,16 @@ ...@@ -17,26 +17,16 @@
<li :key="index" v-else-if="item.key == 'educational_background'"> <li :key="index" v-else-if="item.key == 'educational_background'">
<div class="name">学历</div> <div class="name">学历</div>
<el-select v-model="form.educational_background" placeholder="请选择" style="width:100%" v-if="item.enabled_edit"> <el-select v-model="form.educational_background" placeholder="请选择" style="width:100%" v-if="item.enabled_edit">
<el-option <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> </el-select>
<el-select disabled v-model="form.educational_background" placeholder="请选择" style="width:100%" v-else> <el-select disabled v-model="form.educational_background" placeholder="请选择" style="width:100%" v-else>
<el-option <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> </el-select>
</li> </li>
<li :key="index" v-else> <li :key="index" v-else>
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
<input :type="typeInput(item.key)" v-model="form[item.key]" @keydown="keydown($event)" v-if="item.enabled_edit"> <input :type="typeInput(item.key)" v-model="form[item.key]" @keydown="keydown($event)" v-if="item.enabled_edit" />
<input :type="typeInput(item.key)" v-model="form[item.key]" @keydown="keydown($event)" disabled v-else> <input :type="typeInput(item.key)" v-model="form[item.key]" @keydown="keydown($event)" disabled v-else />
</li> </li>
</template> </template>
</ul> </ul>
...@@ -68,13 +58,22 @@ import action from '@action' ...@@ -68,13 +58,22 @@ import action from '@action'
export default { export default {
metaInfo() { metaInfo() {
return { return {
title: JSON.parse(window.localStorage.getItem('examInfo')).name || '' title: this.examInfo.name || ''
} }
}, },
data() { 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 { return {
sInfo: JSON.parse(window.localStorage.getItem('studentInfo')), studentInfo,
examInfo: JSON.parse(window.localStorage.getItem('examInfo')) || {}, examInfo,
form: { form: {
educational_background: '' educational_background: ''
}, },
...@@ -109,18 +108,11 @@ export default { ...@@ -109,18 +108,11 @@ export default {
this.setInput() this.setInput()
this.defaultInto() this.defaultInto()
}, },
mounted() {
// console.log(this.examInfo.config.info)
},
computed: {
typeInput() {
return (k) => {
const type = k === 'age' || k === 'mobile' ? 'number' : 'text'
return type
}
}
},
methods: { methods: {
typeInput(k) {
const type = k === 'age' || k === 'mobile' ? 'number' : 'text'
return type
},
setInput() { setInput() {
const key = Object.keys(this.examInfo.config.info) const key = Object.keys(this.examInfo.config.info)
const value = Object.values(this.examInfo.config.info) const value = Object.values(this.examInfo.config.info)
...@@ -141,28 +133,19 @@ export default { ...@@ -141,28 +133,19 @@ export default {
}) })
}, },
// 禁止input输入空格 // 禁止input输入空格
keydown (event) { keydown(event) {
event.keyCode === 32 && (event.returnValue = false) event.keyCode === 32 && (event.returnValue = false)
}, },
agree() { agree() {
// 判断考试时间开始没有 // 判断考试时间开始没有
// console.log(this.isExamStatus(this.examInfo.start_time > 0)) if (this.isExamStatus(this.examInfo.start_time) > 0) {
this.isExamStatus(this.examInfo.start_time) > 0 this.$router.replace({ path: '/examTime' })
? (() => { } else {
this.$router.replace({ this.$router.replace({ path: `/examAnswer/${this.examInfo.exam_id}` })
path: '/examTime' }
})
})()
: (() => {
this.$router.replace({
path: `/examAnswer/${this.examInfo.exam_id}`
})
})()
}, },
disagree() { disagree() {
this.$router.replace({ this.$router.replace({ path: `/login/${this.examInfo.exam_id}` })
path: `/login/${this.examInfo.exam_id}`
})
}, },
// 判断进入考试页面还是倒计时页面 // 判断进入考试页面还是倒计时页面
isExamStatus(date) { isExamStatus(date) {
...@@ -183,37 +166,34 @@ export default { ...@@ -183,37 +166,34 @@ export default {
defaultInto() { defaultInto() {
const key = Object.keys(this.form) const key = Object.keys(this.form)
key.map(item => { key.map(item => {
this.form[item] = item === 'age' this.form[item] = item === 'age' ? (parseInt(this.studentInfo[item]) === 0 ? '' : this.studentInfo[item]) : this.studentInfo[item]
? parseInt(this.sInfo.info[item]) === 0
? ''
: this.sInfo.info[item]
: this.sInfo.info[item]
}) })
}, },
// 确认信息 // 确认信息
confirmInfo() { confirmInfo() {
if (this.verification()) { if (this.verification()) {
action.Login.confirmInfo(this.examInfo.exam_id, this.form).then(res => { action.Login.confirmInfo(this.examInfo.exam_id, this.form)
if (!res.code) { .then(res => {
this.isTreaty = true if (!res.code) {
window.localStorage.setItem('studentInfo', JSON.stringify(res)) this.isTreaty = true
} window.localStorage.setItem('studentInfo', JSON.stringify(res.info))
}).catch(err => { }
if (parseInt(err.status) === 403) { })
this.$alert(err.message, { .catch(err => {
callback: action => { if (parseInt(err.status) === 403) {
this.$router.replace({ this.$alert(err.message, {
path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}` callback: action => {
}) this.$router.replace({
} path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
}) })
} else { }
this.$alert(err.message, { })
callback: action => { } else {
} this.$alert(err.message, {
}) callback: action => {}
} })
}) }
})
} }
}, },
// 验证信息是否为空 // 验证信息是否为空
...@@ -231,13 +211,13 @@ export default { ...@@ -231,13 +211,13 @@ export default {
return false return false
} else { } else {
if (this.allForm[i].key === 'mobile') { if (this.allForm[i].key === 'mobile') {
if (!(/^1[3456789]\d{9}$/.test(this.form.mobile))) { if (!/^1[3456789]\d{9}$/.test(this.form.mobile)) {
this.$alert('手机号格式不正确') this.$alert('手机号格式不正确')
return false return false
} }
} }
if (this.allForm[i].key === 'email') { if (this.allForm[i].key === 'email') {
if (!(/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email))) { if (!/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email)) {
this.$alert('邮箱格式不正确') this.$alert('邮箱格式不正确')
return false return false
} }
...@@ -247,13 +227,13 @@ export default { ...@@ -247,13 +227,13 @@ export default {
} else { } else {
if (this.form[this.allForm[i].key] !== '') { if (this.form[this.allForm[i].key] !== '') {
if (this.allForm[i].key === 'mobile') { if (this.allForm[i].key === 'mobile') {
if (!(/^1[3456789]\d{9}$/.test(this.form.mobile))) { if (!/^1[3456789]\d{9}$/.test(this.form.mobile)) {
this.$alert('手机号格式不正确') this.$alert('手机号格式不正确')
return false return false
} }
} }
if (this.allForm[i].key === 'email') { if (this.allForm[i].key === 'email') {
if (!(/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email))) { if (!/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email)) {
this.$alert('邮箱格式不正确') this.$alert('邮箱格式不正确')
return false return false
} }
...@@ -267,42 +247,42 @@ export default { ...@@ -267,42 +247,42 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box{ .box {
display: flex; display: flex;
justify-content: center; justify-content: center;
background: url(../../assets/images/con-info-bg.png) center; background: url(../../assets/images/con-info-bg.png) center;
background-size: cover; background-size: cover;
background-attachment:fixed; background-attachment: fixed;
background-position: 0 0; background-position: 0 0;
padding-bottom: 100px; padding-bottom: 100px;
min-height: 100%; min-height: 100%;
} }
.confirm-mian{ .confirm-mian {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.con-info{ .con-info {
width: 100%; width: 100%;
height: 100%; height: 100%;
.head{ .head {
position: sticky; position: sticky;
top: 0; top: 0;
height: 80px; height: 80px;
background: #FFFFFF; background: #ffffff;
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 80px; line-height: 80px;
padding-left: 30px; padding-left: 30px;
} }
.info-form{ .info-form {
height: max-content; height: max-content;
margin-top: 40px; margin-top: 40px;
width: 400px; width: 400px;
background: #FFFFFF; background: #ffffff;
border-radius: 8px; border-radius: 8px;
padding-bottom: 30px; padding-bottom: 30px;
.tit{ .tit {
text-align: center; text-align: center;
margin-top: 30px; margin-top: 30px;
font-size: 18px; font-size: 18px;
...@@ -310,48 +290,48 @@ export default { ...@@ -310,48 +290,48 @@ export default {
color: #222222; color: #222222;
line-height: 25px; line-height: 25px;
} }
ul{ ul {
width: 320px; width: 320px;
margin: 0 auto 0 auto; margin: 0 auto 0 auto;
padding: 0; padding: 0;
list-style: none; list-style: none;
li{ li {
margin-bottom: 20px; margin-bottom: 20px;
.name{ .name {
font-size: 14px; font-size: 14px;
color: #222222; color: #222222;
line-height: 20px; line-height: 20px;
margin-bottom: 10px; margin-bottom: 10px;
} }
input{ input {
width: 310px; width: 310px;
height: 45px; height: 45px;
border-radius: 2px; border-radius: 2px;
border: 1px solid #F1F1F1; border: 1px solid #f1f1f1;
font-size: 14px; font-size: 14px;
color: #222222; color: #222222;
padding: 0 0 0 10px; padding: 0 0 0 10px;
outline: none; outline: none;
} }
.select-btn{ .select-btn {
width: 100%; width: 100%;
display: flex; display: flex;
div{ div {
width: 150px; width: 150px;
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: 14px; line-height: 14px;
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
&:nth-child(2){ &:nth-child(2) {
margin-left: auto; margin-left: auto;
} }
&.active{ &.active {
background: #C01540; background: #c01540;
color: #fff; color: #fff;
border: none; border: none;
} }
...@@ -359,80 +339,82 @@ export default { ...@@ -359,80 +339,82 @@ export default {
} }
} }
} }
.confirm-btn{ .confirm-btn {
width: 320px; width: 320px;
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;
color: #FFFFFF; color: #ffffff;
line-height: 14px; line-height: 14px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
margin-top: 30px; margin-top: 30px;
cursor: pointer;
} }
} }
} }
.explain-box{ .explain-box {
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
background: #F9F9F9; background: #f9f9f9;
.head{ .head {
height: 80px; height: 80px;
background: #FFFFFF; background: #ffffff;
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 80px; line-height: 80px;
padding-left: 30px; padding-left: 30px;
} }
.exp-text{ .exp-text {
width: 900px; width: 900px;
background: #FFFFFF; background: #ffffff;
border-radius: 8px; border-radius: 8px;
padding: 40px 40px 80px; padding: 40px 40px 80px;
margin: 40px auto 0; margin: 40px auto 0;
margin-top: 40px; margin-top: 40px;
.t{ .t {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 25px; line-height: 25px;
display: flex; display: flex;
&::v-deep p{ &::v-deep p {
margin: 0; margin: 0;
} }
} }
} }
.exp-btn{ .exp-btn {
position: absolute; position: absolute;
bottom: 40px; bottom: 40px;
left: 50%; left: 50%;
-webkit-transform: translateX(-50%); transform: translateX(-50%);
.tips{ .tips {
font-size: 14px; font-size: 14px;
color: #222222; color: #222222;
line-height: 20px; line-height: 20px;
} }
.btn-box{ .btn-box {
width: 240px; width: 240px;
display: flex; display: flex;
margin: 20px auto 0; margin: 20px auto 0;
div{ div {
width: 100px; width: 100px;
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;
color: #FFFFFF; color: #ffffff;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
&:nth-child(2){ cursor: pointer;
&:nth-child(2) {
border-radius: 4px; border-radius: 4px;
border: 1px solid #CCCCCC; border: 1px solid #cccccc;
background: none; background: none;
color: #999; color: #999;
margin-left: auto; margin-left: auto;
...@@ -441,7 +423,7 @@ export default { ...@@ -441,7 +423,7 @@ export default {
} }
} }
} }
.none{ .none {
display: none; display: none;
} }
</style> </style>
...@@ -13,20 +13,8 @@ ...@@ -13,20 +13,8 @@
<div :class="loginParam.is ? 'form prohibit' : 'form'"> <div :class="loginParam.is ? 'form prohibit' : 'form'">
<div class="tips">{{ tips }}</div> <div class="tips">{{ tips }}</div>
<!-- 您登录的次数已超过最大限制 --> <!-- 您登录的次数已超过最大限制 -->
<input <input type="text" v-model="examineeNumber" placeholder="请输入准考证号" v-show="!loginParam.is" @keydown="keydown($event)" />
type="text" <input type="text" placeholder="请输入准考证号" readonly="readonly" class="prohibit" v-show="loginParam.is" />
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" @click="login">登录</div>
<!-- <div class="btn prohibit">登录</div> --> <!-- <div class="btn prohibit">登录</div> -->
<div class="time-tips" v-show="loginParam.is">{{ loginParam.countTimeText }}</div> <div class="time-tips" v-show="loginParam.is">{{ loginParam.countTimeText }}</div>
...@@ -34,7 +22,7 @@ ...@@ -34,7 +22,7 @@
</div> </div>
</div> </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> </div>
</template> </template>
<script> <script>
...@@ -46,16 +34,16 @@ export default { ...@@ -46,16 +34,16 @@ export default {
}, },
metaInfo() { metaInfo() {
return { return {
title: JSON.parse(window.localStorage.getItem('examInfo')).name || '' title: this.data.name
} }
}, },
data() { data() {
return { return {
tips: '', tips: '',
claerExamTime: null, clearExamTime: null,
title: '提示', title: '提示',
prompt: '不能退出全屏', prompt: '不能退出全屏',
data: '', data: {},
examineeNumber: '', examineeNumber: '',
isPopup: false, isPopup: false,
loginParam: { loginParam: {
...@@ -65,6 +53,11 @@ export default { ...@@ -65,6 +53,11 @@ export default {
} }
} }
}, },
computed: {
examId() {
return this.$route.params.examId
}
},
mounted() { mounted() {
this.getExamInfo() this.getExamInfo()
this.tipsMobileAngle() this.tipsMobileAngle()
...@@ -78,10 +71,7 @@ export default { ...@@ -78,10 +71,7 @@ export default {
const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0 const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0
const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0 const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0
if (winHeight > winWidth) { if (winHeight > winWidth) {
this.$message({ this.$message({ message: '请横屏预览', type: 'warning' })
message: '请横屏预览',
type: 'warning'
})
} }
} }
}, },
...@@ -89,19 +79,19 @@ export default { ...@@ -89,19 +79,19 @@ export default {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
}, },
getExamInfo() { getExamInfo() {
action.Login.getExamInfo(this.$route.params.examId).then(res => { action.Login.getExamInfo(this.examId).then(res => {
window.localStorage.setItem('examInfo', JSON.stringify(res)) window.localStorage.setItem('examInfo', JSON.stringify(res))
this.data = res this.data = res
if (this.getEnabledTime() < 0) { if (this.getEnabledTime() < 0) {
this.examTimeInit() this.examTimeInit()
} else { } else {
let claearTimes = null let clearTimes = null
claearTimes = setInterval(() => { clearTimes = setInterval(() => {
// console.log(this.getAfterTime()) // console.log(this.getAfterTime())
if (this.getAfterTime() <= 0) { if (this.getAfterTime() <= 0) {
this.tips = '超过登录时间' this.tips = '超过登录时间'
this.loginParam.is = true this.loginParam.is = true
clearInterval(claearTimes) clearInterval(clearTimes)
} }
}, 1000) }, 1000)
this.loginParam.is = false this.loginParam.is = false
...@@ -109,11 +99,7 @@ export default { ...@@ -109,11 +99,7 @@ export default {
}) })
}, },
sendExamInfo(studentId) { sendExamInfo(studentId) {
const param = { const param = { student_id: studentId, exam_id: this.examId, status: 2 }
student_id: studentId,
exam_id: this.data.exam_id,
status: 2
}
action.Login.sendExamInfo(param) action.Login.sendExamInfo(param)
.then(res => {}) .then(res => {})
.catch(err => { .catch(err => {
...@@ -126,25 +112,23 @@ export default { ...@@ -126,25 +112,23 @@ export default {
}, },
getAfterTime() { getAfterTime() {
const curTime = new Date() const curTime = new Date()
const endtTime = new Date(this.data.end_time) const endTime = new Date(this.data.end_time)
const countTime = endtTime.getTime() - curTime.getTime() const countTime = endTime.getTime() - curTime.getTime()
return countTime return countTime
}, },
getEnabledTime() { getEnabledTime() {
const curTime = new Date() const curTime = new Date()
const setCurTime = this.data.config.enabled_before const setCurTime = this.data.config.enabled_before ? new Date(curTime.setMinutes(curTime.getMinutes() + this.data.config.before_login)) : curTime
? new Date(curTime.setMinutes(curTime.getMinutes() + this.data.config.before_login))
: curTime
const startTime = new Date(this.data.start_time) const startTime = new Date(this.data.start_time)
const countTime = setCurTime.getTime() - startTime.getTime() const countTime = setCurTime.getTime() - startTime.getTime()
return countTime return countTime
}, },
examTimeInit() { examTimeInit() {
this.loginParam.is = true this.loginParam.is = true
this.claerExamTime = setInterval(() => { this.clearExamTime = setInterval(() => {
const date = this.getEnabledTime() const date = this.getEnabledTime()
if (date >= 0) { if (date >= 0) {
clearInterval(this.claerExamTime) clearInterval(this.clearExamTime)
this.loginParam.is = false this.loginParam.is = false
} else { } else {
this.countDown(Math.abs(date)) this.countDown(Math.abs(date))
...@@ -156,21 +140,23 @@ export default { ...@@ -156,21 +140,23 @@ export default {
}, },
// 倒计时 // 倒计时
countDown(time) { countDown(time) {
const lefttime = parseInt(time / 1000) const leftTime = parseInt(time / 1000)
const datSec = 24 * 60 * 60 const datSec = 24 * 60 * 60
const hourSer = 60 * 60 const hourSer = 60 * 60
const minuteSec = 60 const minuteSec = 60
const dd = Math.floor(lefttime / datSec) const dd = Math.floor(leftTime / datSec)
const hh = Math.floor((lefttime % datSec) / hourSer) const hh = Math.floor((leftTime % datSec) / hourSer)
const mm = Math.floor((lefttime % hourSer) / minuteSec) const mm = Math.floor((leftTime % hourSer) / minuteSec)
const ss = lefttime % 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)}秒` 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() { fullScreen() {
const el = document.documentElement const el = document.documentElement
const rfs = const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
if (typeof rfs !== 'undefined' && rfs) { if (typeof rfs !== 'undefined' && rfs) {
rfs.call(el) rfs.call(el)
} }
...@@ -189,17 +175,16 @@ export default { ...@@ -189,17 +175,16 @@ export default {
this.$alert('请输入准考证号') this.$alert('请输入准考证号')
return false return false
} }
action.Login.userLogin(this.data.exam_id, { examinee_number: this.examineeNumber }) action.Login.userLogin(this.examId, { examinee_number: this.examineeNumber })
.then(res => { .then(res => {
window.localStorage.setItem('studentInfo', JSON.stringify(res)) window.localStorage.setItem('studentInfo', JSON.stringify(res.info))
const status = parseInt(res.sheet_status) const status = parseInt(res.sheet_status)
// this.sendExamInfo(res.info.student_id) // this.sendExamInfo(res.info.student_id)
if (status === 0) { if (status === 0) {
this.$router.replace({ this.$router.push({ name: 'confirmInfo', params: { examId: this.examId } })
name: 'confirmInfo' } else if (status === 1) {
}) this.$alert('已提交考卷')
} }
status === 1 && this.$alert('已提交考卷')
}) })
.catch(err => { .catch(err => {
if (err.message.indexOf('error') !== -1) { if (err.message.indexOf('error') !== -1) {
...@@ -232,7 +217,7 @@ export default { ...@@ -232,7 +217,7 @@ export default {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 50%; left: 50%;
-webkit-transform: translateX(-50%); transform: translateX(-50%);
margin-bottom: -115px; margin-bottom: -115px;
} }
} }
...@@ -335,6 +320,7 @@ export default { ...@@ -335,6 +320,7 @@ export default {
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
font-style: normal; font-style: normal;
cursor: pointer;
&.prohibit { &.prohibit {
color: #ccc; color: #ccc;
background: #eee; background: #eee;
......
export default [ export default [
{ path: '/', redirect: '*' }, { path: '/', redirect: '*' },
/* 测试页面 */ /* 测试页面 */
...@@ -6,7 +5,7 @@ export default [ ...@@ -6,7 +5,7 @@ export default [
/* 登录页面 */ /* 登录页面 */
{ path: '/login/:examId', component: () => import('../pages/login/index.vue') }, { 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') }, { path: '/examTime', name: 'examTime', component: () => import('../pages/exam/examTime.vue') },
/* 答题 */ /* 答题 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论