提交 43b579a0 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 9cc398bf
......@@ -87,7 +87,13 @@ export default class API {
if (res.code === 'ECONNABORTED') {
err = new Error('网络超时,请稍后重试')
} else if (res.response) {
res.response.data.code === 0 ? err = res.response.data : err = new Error(JSON.stringify(res.response))
if (res.response.data) {
res.response.data.code === 0 ? err = res.response.data : new Error(JSON.stringify(res.response))
} else if (res.response.status === 500) {
err = new Error('网络超时,请稍后重试')
} else {
new Error(JSON.stringify(res.response))
}
} else {
err = new Error('msg:' + res.message + 'stack:' + res.stack)
err.code = 500
......
......@@ -2,7 +2,7 @@
<div>
<div class="info">
<div class="shape">
<img :src="info.id_photo" alt="">
<img :src="info.id_photo ? info.id_photo : 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'" alt="">
</div>
<div class="right">
<div class="name">{{ info.name }}</div>
......@@ -137,7 +137,7 @@ export default {
overflow: hidden;
}
img{
width: 75px;
width: 100%;
// transform: scale(1);
display: block;
}
......
......@@ -24,7 +24,7 @@
>
<div @click="changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)">
<div class="icon"></div>
<div class="txt">{{item.option}}</div>
<div class="txt" v-html="item.option"></div>
</div>
</li>
</template>
......@@ -75,15 +75,18 @@
</template>
<script>
import action from '@action'
import Bus from '../../components/common/bus.js'
import Bus from '@/components/common/bus.js'
export default {
components: {
},
props: {
contentHeight: { type: Number, default: () => {} },
questionParams: { type: Object, default: () => {} }
},
data() {
return {
questionData: {}
questionData: {},
clearTime: null
}
},
mounted() {
......@@ -178,9 +181,23 @@ export default {
}
action.Exam.setCache(this.$route.params.examId, param).then(res => {
}).catch(err => {
if (err.message === '网络超时,请稍后重试') {
this.$confirm('网络异常,请保持网络通畅', '提示', {
confirmButtonText: '重新提交',
cancelButtonText: '退出考试',
type: 'warning'
}).then(() => {
this.setCache()
}).catch(() => {
this.$router.replace({
path: `/login/${JSON.parse(window.sessionStorage.getItem('examInfo')).exam_id}`
})
})
} else {
this.$alert(err.message, {
callback: action => {}
})
}
})
},
// 标记
......@@ -304,6 +321,9 @@ export default {
line-height: 28px;
margin-left: 10px;
float: left;
&::v-deep p{
margin: 0;
}
}
}
// .icon{
......
......@@ -124,9 +124,23 @@ export default {
})
window.sessionStorage.setItem('showflag', 'true')
}).catch(err => {
if (err.message === '网络超时,请稍后重试') {
this.$confirm('网络异常,请保持网络通畅', '提示', {
confirmButtonText: '重新提交',
cancelButtonText: '退出考试',
type: 'warning'
}).then(() => {
this.endExamRequest()
}).catch(() => {
this.$router.replace({
path: `/login/${JSON.parse(window.sessionStorage.getItem('examInfo')).exam_id}`
})
})
} else {
this.$alert(err.message, {
callback: action => {}
})
}
})
},
countDown(time) {
......
......@@ -7,17 +7,37 @@
<div class="tit">基本信息确认</div>
<ul>
<template v-for="(item, index) in allForm">
<li :key="index" v-if="item.key != 'gender'">
<div class="name">{{ item.name }}</div>
<input :type="typeInput(item.key)" v-model="form[item.key]" @keydown="keydown($event)">
</li>
<li :key="index" v-else>
<li :key="index" v-if="item.key == 'gender'">
<div class="name">性别</div>
<div class="select-btn">
<div :class="form.gender == 1 && 'active'" @click="selectGender(1)"></div>
<div :class="form.gender == 2 && 'active'" @click="selectGender(2)"></div>
<div :class="form.gender == 1 && 'active'" @click="selectGender(1, item.enabled_edit)"></div>
<div :class="form.gender == 2 && 'active'" @click="selectGender(2, item.enabled_edit)"></div>
</div>
</li>
<li :key="index" v-else-if="item.key == 'educational_background'">
<div class="name">学历</div>
<el-select v-model="form.educational_background" placeholder="请选择" style="width:100%" v-if="item.enabled_edit">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select disabled v-model="form.educational_background" placeholder="请选择" style="width:100%" v-else>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</li>
<li :key="index" v-else>
<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)" disabled v-else>
</li>
</template>
</ul>
<div class="confirm-btn" @click="confirmInfo">确定</div>
......@@ -27,7 +47,10 @@
<div class="explain-box" v-if="isTreaty">
<div class="head">{{ examInfo.name }}</div>
<div class="exp-text">
<p>为保证本考试的公平性和严肃性,本次考试将会:{{examInfo.config.promise_message}}</p>
<div class="t">
<div class="fl">为保证本考试的公平性和严肃性,本次考试将会:</div>
<div class="fl" v-html="examInfo.config.promise_message">为保证本考试的公平性和严肃性,本次考试将会:</div>
</div>
<!-- <p v-html="examInfo.config.promise_message"></p> -->
</div>
<div class="exp-btn">
......@@ -47,9 +70,34 @@ export default {
return {
sInfo: JSON.parse(window.sessionStorage.getItem('studentInfo')),
examInfo: JSON.parse(window.sessionStorage.getItem('examInfo')),
form: {},
form: {
educational_background: ''
},
allForm: [],
isTreaty: false
isTreaty: false,
value: '',
options: [
{
value: '专科',
label: '专科'
},
{
value: '本科',
label: '本科'
},
{
value: '硕士',
label: '硕士'
},
{
value: '博士',
label: '博士'
},
{
value: '其他',
label: '其他'
}
]
}
},
created() {
......@@ -75,8 +123,16 @@ export default {
this.form[key[i]] = ''
value[i].key = key[i]
}
this.allForm = value
console.log(this.allForm)
this.allForm = this.dataFilter(value)
// console.log(this.form, '===')
// this.allForm = value
},
dataFilter(data) {
return data.filter(item => {
if (item.enabled_visible) {
return item
}
})
},
// 禁止input输入空格
keydown (event) {
......@@ -110,16 +166,22 @@ export default {
return countTime
},
// 选择男女
selectGender(t) {
selectGender(t, isInput) {
if (isInput) {
this.form.gender = t
this.$forceUpdate()
console.log(this.form)
}
},
// 默认信息获取
defaultInto() {
const key = Object.keys(this.form)
key.map(item => {
this.form[item] = this.sInfo.info[item]
this.form[item] = item === 'age'
? parseInt(this.sInfo.info[item]) === 0
? ''
: this.sInfo.info[item]
: this.sInfo.info[item]
})
},
// 确认信息
......@@ -139,13 +201,20 @@ export default {
// 验证信息是否为空
verification() {
for (let i = 0; i < this.allForm.length; i++) {
if (!this.allForm[i].required) {
if (this.allForm[i].required) {
if (this.allForm[i].key === 'educational_background') {
if (this.form.educational_background === '') {
this.$alert('请完善信息')
return false
}
} else {
if (this.form[this.allForm[i].key] === '') {
this.$alert('请完善信息')
return false
}
}
}
}
return true
}
}
......@@ -160,6 +229,7 @@ export default {
background-attachment:fixed;
background-position: 0 0;
padding-bottom: 100px;
min-height: 100%;
}
.confirm-mian{
width: 100%;
......@@ -180,6 +250,7 @@ export default {
padding-left: 30px;
}
.info-form{
height: max-content;
margin-top: 40px;
width: 400px;
background: #FFFFFF;
......@@ -278,11 +349,15 @@ export default {
padding: 40px 40px 80px;
margin: 40px auto 0;
margin-top: 40px;
p{
.t{
font-size: 18px;
font-weight: bold;
color: #222222;
line-height: 25px;
display: flex;
&::v-deep p{
margin: 0;
}
}
}
.exp-btn{
......
......@@ -15,7 +15,7 @@
<div :class="loginParam.is ? 'form prohibit' : 'form'">
<div class="tips">{{ tips }}</div>
<!-- 您登录的次数已超过最大限制 -->
<input type="number" @click="fullScreen" v-model="examineeNumber" placeholder="请输入准考证号" v-show="!loginParam.is" @keydown="keydown($event)">
<input type="text" @click="fullScreen" v-model="examineeNumber" placeholder="请输入准考证号" v-show="!loginParam.is" @keydown="keydown($event)">
<input type="text" @click="fullScreen" placeholder="请输入准考证号" readonly="readonly" class="prohibit" v-show="loginParam.is">
<div class="btn" @click="login">登录</div>
<!-- <div class="btn prohibit">登录</div> -->
......@@ -25,12 +25,6 @@
</div>
</div>
<div class="welcome-msg mian-cont900" v-if="data" v-html="data.config.welcome_message"></div>
<!-- <my-dia :title="title" :prompt="prompt" :isPopup="isPopup" v-if="isPopup" @close="closePop">
<template v-slot:button>
<button @click="closePop">我知道了</button>
<button>好的</button>
</template>
</my-dia> -->
</div>
</template>
<script>
......@@ -131,7 +125,10 @@ export default {
},
// 禁止input输入空格
keydown (event) {
event.keyCode === 32 && (event.returnValue = false)
console.log(event.keyCode)
if (event.keyCode === 32 || event.keyCode === 187) {
event.returnValue = false
}
},
// 点击登录
login() {
......@@ -148,9 +145,7 @@ export default {
name: 'confirmInfo'
})
}
status === 1 && (this.$alert('已提交考卷', {
callback: action => {}
}))
status === 1 && (this.$alert('已提交考卷'))
}).catch(err => {
this.$alert(err.message, {
callback: action => {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论