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

bug fixes

上级 4a2d99d1
import httpRequest from '@/utils/axios' import httpRequest from '@/utils/axios'
/** /**
* 获取考前摸底试题 * 获取模拟测试试题
*/ */
export function getExamQuestion(params) { export function getExamQuestion(params) {
return httpRequest.get('/api/zy/v2/examination/examination-papers', { params }, { headers: { 'Content-Type': 'multipart/form-data' } }) return httpRequest.get(
'/api/zy/v2/examination/examination-papers',
{ params },
{ headers: { 'Content-Type': 'multipart/form-data' } }
)
} }
/** /**
* 缓存考前摸底试题 * 缓存模拟测试试题
*/ */
export function setCache(params) { export function setCache(params) {
return httpRequest.post('/api/zy/v2/examination/examination-papers', params) return httpRequest.post('/api/zy/v2/examination/examination-papers', params)
...@@ -31,9 +35,13 @@ export function setRoles(params) { ...@@ -31,9 +35,13 @@ export function setRoles(params) {
* 获取我的已做试题 * 获取我的已做试题
*/ */
export function getMyQuestion(params) { export function getMyQuestion(params) {
return httpRequest.get('/api/zy/v2/examination/my-question', { params }, { return httpRequest.get(
headers: { 'Content-Type': 'multipart/form-data' } '/api/zy/v2/examination/my-question',
}) { params },
{
headers: { 'Content-Type': 'multipart/form-data' }
}
)
} }
/** /**
...@@ -44,8 +52,8 @@ export function getAllQuestion(params) { ...@@ -44,8 +52,8 @@ export function getAllQuestion(params) {
} }
/** /**
* 缓存错题集 * 缓存错题集
*/ */
export function setMyCache(params) { export function setMyCache(params) {
return httpRequest.post('/api/zy/v2/examination/cache-question', params) return httpRequest.post('/api/zy/v2/examination/cache-question', params)
} }
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
<template v-for="item in datalist"> <template v-for="item in datalist">
<el-submenu :index="item.title" :key="item.title" v-if="item.children"> <el-submenu :index="item.title" :key="item.title" v-if="item.children">
<template slot="title"> <template slot="title">
<i class="iconfont" :class="item.icon"></i> <i class="iconfont" :class="item.icon"></i><span>{{ item.title }}</span>
<span>{{ item.title }}</span>
</template> </template>
<el-menu-item :index="item.path" :key="item.title" v-for="item in item.children"> <el-menu-item :index="item.path" :key="item.title" v-for="item in item.children">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
...@@ -52,7 +51,7 @@ export default { ...@@ -52,7 +51,7 @@ export default {
title: '我的考试', title: '我的考试',
icon: 'icon-bianzuhong', icon: 'icon-bianzuhong',
children: [ children: [
{ title: '考前摸底', path: '/testExam' }, { title: '模拟测试', path: '/testExam' },
{ title: '错题集合', path: '/my/questions/wrong' }, { title: '错题集合', path: '/my/questions/wrong' },
{ title: '收藏试题', path: '/my/questions/collection' } { title: '收藏试题', path: '/my/questions/collection' }
] ]
...@@ -60,7 +59,7 @@ export default { ...@@ -60,7 +59,7 @@ export default {
{ {
title: '实训练习', title: '实训练习',
icon: 'icon-kaoshihong', icon: 'icon-kaoshihong',
children: [{ title: '实训案例练习', path: '/xxxx' }] children: [{ title: '实训案例练习', path: 'https://xtraining.ezijing.com/' }]
}, },
{ {
title: '个人中心', title: '个人中心',
...@@ -162,6 +161,8 @@ export default { ...@@ -162,6 +161,8 @@ export default {
padding: 30px 0; padding: 30px 0;
color: #ccc; color: #ccc;
.iconfont { .iconfont {
display: inline-block;
width: 30px;
font-size: 16px; font-size: 16px;
color: currentColor; color: currentColor;
} }
...@@ -173,13 +174,24 @@ export default { ...@@ -173,13 +174,24 @@ export default {
} }
.is-active .el-submenu__title { .is-active .el-submenu__title {
background: #fff4f7; background: #fff4f7;
font-weight: bold;
color: #c01540; color: #c01540;
} }
.el-submenu__title {
height: 50px;
line-height: 50px;
padding-left: 25px !important;
}
.el-menu-item:hover, .el-menu-item:hover,
.el-menu-item:focus { .el-menu-item:focus {
color: #c01540; color: #c01540;
background: transparent; background: transparent;
} }
.el-submenu .el-menu-item {
height: 36px;
line-height: 36px;
padding-left: 55px !important;
}
} }
} }
</style> </style>
...@@ -10,6 +10,6 @@ export default {} ...@@ -10,6 +10,6 @@ export default {}
<style lang="scss"> <style lang="scss">
.app-main { .app-main {
padding: 30px; padding: 20px;
} }
</style> </style>
...@@ -6,41 +6,53 @@ ...@@ -6,41 +6,53 @@
<div class="cs_time"><span>测试时间:</span>{{ questionsData.created_time }}</div> <div class="cs_time"><span>测试时间:</span>{{ questionsData.created_time }}</div>
<div class="charts"> <div class="charts">
<svg width="86%" height="86%" viewBox="0 0 100 100"> <svg width="86%" height="86%" viewBox="0 0 100 100">
<circle r="25" cx="50" cy="50" fill="none" stroke="rgba(255,193,79,1)" stroke-width="50" stroke-dasharray="158 158" /> <circle
r="25"
cx="50"
cy="50"
fill="none"
stroke="rgba(255,193,79,1)"
stroke-width="50"
stroke-dasharray="158 158"
/>
</svg> </svg>
<svg v-show="ratioNum!==0" class="w_svg" width="100%" height="100%" viewBox="0 0 100 100"> <svg v-show="ratioNum !== 0" class="w_svg" width="100%" height="100%" viewBox="0 0 100 100">
<circle r="25" cx="50" cy="50" fill="none" stroke="#07cb78" stroke-width="50" :stroke-dasharray="ratio" /> <circle r="25" cx="50" cy="50" fill="none" stroke="#07cb78" stroke-width="50" :stroke-dasharray="ratio" />
</svg> </svg>
<template v-if="title === '真题实战'"> <template v-if="title === '真题实战'">
<div class="circle"> <div class="circle">
<p class="p1">得分</p> <p class="p1">得分</p>
<p class="p2">{{questionsData.score}}</p> <p class="p2">{{ questionsData.score }}</p>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="circle"> <div class="circle">
<p class="p1">正确率</p> <p class="p1">正确率</p>
<p class="p2">{{ratioNum}}%</p> <p class="p2">{{ ratioNum }}%</p>
</div> </div>
</template> </template>
</div> </div>
<div class="assess"> <div class="assess">
<div class="tit">测试评估:</div> <div class="tit">测试评估:</div>
<img v-show="ratioNum < 20" src="../assets/images/mountain0.png" alt=""> <img v-show="ratioNum < 20" src="../assets/images/mountain0.png" alt="" />
<img v-show="ratioNum >= 20 && ratioNum < 40" src="../assets/images/mountain1.png" alt=""> <img v-show="ratioNum >= 20 && ratioNum < 40" src="../assets/images/mountain1.png" alt="" />
<img v-show="ratioNum >= 40 && ratioNum < 60" src="../assets/images/mountain2.png" alt=""> <img v-show="ratioNum >= 40 && ratioNum < 60" src="../assets/images/mountain2.png" alt="" />
<img v-show="ratioNum >= 60 && ratioNum < 99" src="../assets/images/mountain3.png" alt=""> <img v-show="ratioNum >= 60 && ratioNum < 99" src="../assets/images/mountain3.png" alt="" />
<img v-show="ratioNum == 100" src="../assets/images/mountain4.png" alt=""> <img v-show="ratioNum == 100" src="../assets/images/mountain4.png" alt="" />
<template v-if="title != '考前摸底'"> <template v-if="title != '模拟测试'">
<div v-if="ratioNum == 100" class="txt">成功近在眼前,再接再厉!</div> <div v-if="ratioNum == 100" class="txt">成功近在眼前,再接再厉!</div>
<div v-else class="txt">您离成功还有一段距离,继续努力!</div> <div v-else class="txt">您离成功还有一段距离,继续努力!</div>
</template> </template>
<template v-else> <template v-else>
<div v-if="ratioNum >= 90" class="txt" style="text-align: left;">您的成绩不错呦,保持住,想进一步提升成绩,推荐您使用全部考试服务!</div> <div v-if="ratioNum >= 90" class="txt" style="text-align: left">
<div v-else class="txt" style="text-align: left;">您距离拿证还有一段距离,急速拿证推荐您使用全部考试服务!</div> 您的成绩不错呦,保持住,想进一步提升成绩,推荐您使用全部考试服务!
</div>
<div v-else class="txt" style="text-align: left">
您距离拿证还有一段距离,急速拿证推荐您使用全部考试服务!
</div>
</template> </template>
</div> </div>
<div class="nl-btn" v-if="title == '考前摸底'"> <div class="nl-btn" v-if="title == '模拟测试'">
<!-- <div class="btn" @click="goAbilityExam">重做测试</div> <!-- <div class="btn" @click="goAbilityExam">重做测试</div>
<div class="btn" @click="goCourse">学习课程</div> --> <div class="btn" @click="goCourse">学习课程</div> -->
<div class="new-btn" @click="goVip">全部考试服务</div> <div class="new-btn" @click="goVip">全部考试服务</div>
...@@ -65,35 +77,87 @@ ...@@ -65,35 +77,87 @@
</ul> </ul>
</div> </div>
<div class="question"> <div class="question">
<template v-if="answerData['1'].data.length !=0"> <template v-if="answerData['1'].data.length != 0">
<div class="title" >{{ answerData['1'].title }}</div> <div class="title">{{ answerData['1'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['1'].data"> <template v-for="(item, index) in answerData['1'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.answer == undefined || item.answer.length == 0 ? 'active3' : item.is_right ? 'active1' : 'active2'">{{ item.num }}</li> <li
@click="go(item.id)"
:data-id="item.id"
:key="index"
:class="
item.answer == undefined || item.answer.length == 0
? 'active3'
: item.is_right
? 'active1'
: 'active2'
"
>
{{ item.num }}
</li>
</template> </template>
</ul> </ul>
</template> </template>
<template v-if="answerData['2'].data.length !=0"> <template v-if="answerData['2'].data.length != 0">
<div class="title" >{{ answerData['2'].title }}</div> <div class="title">{{ answerData['2'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['2'].data"> <template v-for="(item, index) in answerData['2'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.answer == undefined || item.answer.length == 0 ? 'active3' : item.is_right ? 'active1' : 'active2'">{{ item.num }}</li> <li
@click="go(item.id)"
:data-id="item.id"
:key="index"
:class="
item.answer == undefined || item.answer.length == 0
? 'active3'
: item.is_right
? 'active1'
: 'active2'
"
>
{{ item.num }}
</li>
</template> </template>
</ul> </ul>
</template> </template>
<template v-if="answerData['6'].data.length !=0"> <template v-if="answerData['6'].data.length != 0">
<div class="title" >{{ answerData['6'].title }}</div> <div class="title">{{ answerData['6'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['6'].data"> <template v-for="(item, index) in answerData['6'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.answer == undefined || item.answer.length == 0 ? 'active3' : item.is_right ? 'active1' : 'active2'">{{ item.num }}</li> <li
@click="go(item.id)"
:data-id="item.id"
:key="index"
:class="
item.answer == undefined || item.answer.length == 0
? 'active3'
: item.is_right
? 'active1'
: 'active2'
"
>
{{ item.num }}
</li>
</template> </template>
</ul> </ul>
</template> </template>
<template v-if="answerData['5'].data.length !=0"> <template v-if="answerData['5'].data.length != 0">
<div class="title" >{{ answerData['5'].title }}</div> <div class="title">{{ answerData['5'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['5'].data"> <template v-for="(item, index) in answerData['5'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.answer == undefined || item.answer.length == 0 ? 'active3' : item.is_right ? 'active1' : 'active2'">{{ item.num }}</li> <li
@click="go(item.id)"
:data-id="item.id"
:key="index"
:class="
item.answer == undefined || item.answer.length == 0
? 'active3'
: item.is_right
? 'active1'
: 'active2'
"
>
{{ item.num }}
</li>
</template> </template>
</ul> </ul>
</template> </template>
...@@ -158,9 +222,13 @@ export default { ...@@ -158,9 +222,13 @@ export default {
}, },
mounted() { mounted() {
if (this.$route.query.course_id || this.$route.query.tag_id) { if (this.$route.query.course_id || this.$route.query.tag_id) {
this.$route.query.type === 2 || this.$route.query.type === '2' ? this.title = '考点练习' : this.title = '章节练习' this.$route.query.type === 2 || this.$route.query.type === '2'
? (this.title = '考点练习')
: (this.title = '章节练习')
} else { } else {
this.$route.query.type === 1 || this.$route.query.type === '1' ? this.title = '考前摸底' : this.title = '真题实战' this.$route.query.type === 1 || this.$route.query.type === '1'
? (this.title = '模拟测试')
: (this.title = '真题实战')
} }
// this.title // this.title
this.initData() this.initData()
...@@ -282,7 +350,7 @@ export default { ...@@ -282,7 +350,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.end_box{ .end_box {
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -290,79 +358,79 @@ export default { ...@@ -290,79 +358,79 @@ export default {
z-index: 99; z-index: 99;
background: #fff; background: #fff;
} }
.head{ .head {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
color: #222; color: #222;
display: flex; display: flex;
padding: .4rem 0; padding: 0.4rem 0;
align-items: center; align-items: center;
i{ i {
font-size: .35rem; font-size: 0.35rem;
margin-left: .28rem; margin-left: 0.28rem;
} }
.title{ .title {
margin-left: .03rem; margin-left: 0.03rem;
font-size: .3rem; font-size: 0.3rem;
} }
} }
#bottom-view3{ #bottom-view3 {
width: 100%; width: 100%;
overflow: scroll; overflow: scroll;
} }
.end_con{ .end_con {
height: 100%; height: 100%;
padding: .4rem 0.4rem 1rem .4rem; padding: 0.4rem 0.4rem 1rem 0.4rem;
.cs_type{ .cs_type {
font-size: .3rem; font-size: 0.3rem;
color: #222; color: #222;
line-height: 100%; line-height: 100%;
span{ span {
font-weight: bold; font-weight: bold;
} }
} }
.cs_time{ .cs_time {
font-size: .3rem; font-size: 0.3rem;
color: #222; color: #222;
line-height: 100%; line-height: 100%;
margin-top: .2rem; margin-top: 0.2rem;
span{ span {
font-weight: bold; font-weight: bold;
} }
} }
.charts{ .charts {
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
margin: .4rem auto; margin: 0.4rem auto;
position: relative; position: relative;
svg{ svg {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
-webkit-transform: translate(-50%,-50%); -webkit-transform: translate(-50%, -50%);
} }
.w_svg{ .w_svg {
-webkit-transform:rotate(-90deg) translate(50%,-50%); -webkit-transform: rotate(-90deg) translate(50%, -50%);
} }
.circle{ .circle {
width: .96rem; width: 0.96rem;
height: .96rem; height: 0.96rem;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
z-index: 999; z-index: 999;
-webkit-transform: translate(-50%,-50%); -webkit-transform: translate(-50%, -50%);
background: #FF8000; background: #ff8000;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
.p1{ .p1 {
font-size: .2rem; font-size: 0.2rem;
color: #fff; color: #fff;
line-height: 100%; line-height: 100%;
margin: 0.18rem 0 0.15rem 0; margin: 0.18rem 0 0.15rem 0;
opacity: .7; opacity: 0.7;
} }
.p2{ .p2 {
font-size: .26rem; font-size: 0.26rem;
color: #fff; color: #fff;
line-height: 100%; line-height: 100%;
font-weight: bold; font-weight: bold;
...@@ -370,173 +438,174 @@ export default { ...@@ -370,173 +438,174 @@ export default {
} }
} }
} }
.assess{ .assess {
.tit{ .tit {
font-size: .3rem; font-size: 0.3rem;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
img{ img {
width: 4rem; width: 4rem;
height: 1.93rem; height: 1.93rem;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
.txt{ .txt {
font-weight: bold; font-weight: bold;
font-size: .3rem; font-size: 0.3rem;
color: #333; color: #333;
text-align: center; text-align: center;
margin-top: .18rem; margin-top: 0.18rem;
} }
} }
.card{ .card {
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
margin-top: .38rem; margin-top: 0.38rem;
.tit{ .tit {
font-size: .3rem; font-size: 0.3rem;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
.card_con{ .card_con {
overflow-y: scroll; overflow-y: scroll;
.flag{ .flag {
border-bottom: 0.01rem solid #EEEEEE; border-bottom: 0.01rem solid #eeeeee;
ul{ ul {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
li{ li {
margin: 0 .4rem 0.1rem .4rem; margin: 0 0.4rem 0.1rem 0.4rem;
text-align: center; text-align: center;
.circle{ .circle {
width: .6rem; width: 0.6rem;
height: .6rem; height: 0.6rem;
border-radius: 50%; border-radius: 50%;
font-size: .26rem; font-size: 0.26rem;
text-align: center; text-align: center;
line-height: .6rem; line-height: 0.6rem;
color: #fff; color: #fff;
} }
.active1{ .active1 {
background: #67C23A; background: #67c23a;
} }
.active2{ .active2 {
background:#FA5555; background: #fa5555;
} }
.active3{ .active3 {
background:rgba(204,204,204,1); background: rgba(204, 204, 204, 1);
} }
.txt{ .txt {
color: #222222; color: #222222;
font-size: .26rem; font-size: 0.26rem;
margin-top: 0.1rem; margin-top: 0.1rem;
} }
} }
} }
} }
.question{ .question {
.title{ .title {
font-size: .3rem; font-size: 0.3rem;
color: #333333; color: #333333;
margin-top: .1rem; margin-top: 0.1rem;
margin-bottom: .4rem; margin-bottom: 0.4rem;
} }
ul{ ul {
list-style: none; list-style: none;
margin-top: .3rem; margin-top: 0.3rem;
padding: 0 0.6rem; padding: 0 0.6rem;
// border-bottom: 0.01rem solid #EEEEEE; // border-bottom: 0.01rem solid #EEEEEE;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
li{ li {
width: .6rem; width: 0.6rem;
height: .6rem; height: 0.6rem;
border-radius: 50%; border-radius: 50%;
font-size: .26rem; font-size: 0.26rem;
text-align: center; text-align: center;
line-height: .6rem; line-height: 0.6rem;
color: #fff; color: #fff;
margin-right: .6rem; margin-right: 0.6rem;
margin-bottom: .4rem; margin-bottom: 0.4rem;
} }
:nth-child(5n+5){ :nth-child(5n + 5) {
margin: 0; margin: 0;
} }
.active1{ .active1 {
background: #67C23A; background: #67c23a;
}
.active2{
background:#FA5555;
} }
.active3{ .active2 {
background:rgba(204,204,204,1); background: #fa5555;
}
.active3 {
background: rgba(204, 204, 204, 1);
} }
} }
} }
} }
} }
} }
.nl-btn{ .nl-btn {
display: flex; display: flex;
margin-top: .3rem; margin-top: 0.3rem;
.btn{ .btn {
width:3rem; width: 3rem;
height:.7rem; height: 0.7rem;
background:linear-gradient(90deg,rgba(43,124,233,1) 0%,rgba(103,168,255,1) 100%); background: linear-gradient(90deg, rgba(43, 124, 233, 1) 0%, rgba(103, 168, 255, 1) 100%);
border-radius:.12rem; border-radius: 0.12rem;
font-size: .3rem; font-size: 0.3rem;
color: #fff; color: #fff;
text-align: center; text-align: center;
line-height: .7rem; line-height: 0.7rem;
} }
.btn:nth-child(2){ .btn:nth-child(2) {
margin-left: auto; margin-left: auto;
} }
.new-btn{ .new-btn {
width: 3.2rem; width: 3.2rem;
height: .9rem; height: 0.9rem;
background: #C62245; background: #c62245;
text-align: center; text-align: center;
line-height: .9rem; line-height: 0.9rem;
color: #fff; color: #fff;
font-size: .3rem; font-size: 0.3rem;
background: url(../assets/images/ability-r-btn.png); background: url(../assets/images/ability-r-btn.png);
background-size: 100% 100%; background-size: 100% 100%;
margin: 0 auto; margin: 0 auto;
} }
} }
.st-btn{ .st-btn {
width: 100%; width: 100%;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
height: 1rem; height: 1rem;
background:rgba(255,255,255,1); background: rgba(255, 255, 255, 1);
box-shadow:0px 0px 6px 0px rgba(0,0,0,0.05); box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.05);
z-index: 99; z-index: 99;
display: flex; display: flex;
align-items: center; align-items: center;
// padding: 0 .4rem; // padding: 0 .4rem;
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
.btn{width:3rem; .btn {
height:.7rem; width: 3rem;
background:#C62245; height: 0.7rem;
border-radius:.12rem; background: #c62245;
border-radius: 0.12rem;
color: #fff; color: #fff;
font-size: .3rem; font-size: 0.3rem;
text-align: center; text-align: center;
line-height: .7rem; line-height: 0.7rem;
margin-left: .4rem; margin-left: 0.4rem;
} }
.btn:nth-child(2){ .btn:nth-child(2) {
margin-left: auto; margin-left: auto;
margin-right: .4rem; margin-right: 0.4rem;
} }
} }
.cent{ .cent {
justify-content: center; justify-content: center;
} }
</style> </style>
...@@ -2,34 +2,34 @@ ...@@ -2,34 +2,34 @@
<app-container title="个人信息"> <app-container title="个人信息">
<el-form :model="ruleForm" :rules="rules" label-width="120px" ref="ruleForm" class="form"> <el-form :model="ruleForm" :rules="rules" label-width="120px" ref="ruleForm" class="form">
<el-form-item label="所在院校" prop="phone"> <el-form-item label="所在院校" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="学院名称" prop="phone"> <el-form-item label="学院名称" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="专业名称" prop="phone"> <el-form-item label="专业名称" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="考证等级" prop="phone"> <el-form-item label="考证等级" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户真实姓名" prop="phone"> <el-form-item label="用户真实姓名" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="身份证号码" prop="phone"> <el-form-item label="身份证号码" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="身份" prop="phone"> <el-form-item label="身份" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="登录帐号" prop="phone"> <el-form-item label="登录帐号" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone" readonly></el-input>
</el-form-item> </el-form-item>
<el-form-item label="账号名" prop="phone"> <el-form-item label="账号名" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.phone"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="常用邮箱" prop="phone"> <el-form-item label="常用邮箱" prop="email">
<el-input type="password" v-model="ruleForm.phone"></el-input> <el-input v-model="ruleForm.email"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
...@@ -48,10 +48,10 @@ export default { ...@@ -48,10 +48,10 @@ export default {
data() { data() {
return { return {
ruleForm: { ruleForm: {
phone: '' email: ''
}, },
rules: { rules: {
phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }] email: [{ required: true, message: '请输入手机号码', trigger: 'blur' }]
}, },
submitLoading: false submitLoading: false
} }
......
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
font-weight: bold; font-weight: bold;
} }
.t2 { .t2 {
font-size: 13px;
margin-top: 5px; margin-top: 5px;
color: #707070; color: #707070;
} }
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<div class="answer-box"> <div class="answer-box">
<div class="head" id="head-h"> <div class="head" id="head-h">
<el-button icon="el-icon-arrow-left" circle @click="$router.back()"></el-button> <el-button icon="el-icon-arrow-left" circle @click="$router.back()"></el-button>
<div class="title">考前摸底</div> <div class="title">模拟测试</div>
<div class="right"> <div class="right">
<div class="count">{{ time.examTimeText }}</div> <div class="count">{{ time.examTimeText }}</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"
...@@ -17,22 +17,20 @@ ...@@ -17,22 +17,20 @@
></question> ></question>
</div> </div>
<div class="right"> <div class="right">
<answer-card <answer-card :questionParams="questionParams" ref="signHandle"></answer-card>
:questionParams="questionParams"
ref="signHandle"
></answer-card>
</div> </div>
</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="collectQuestion"> <div class="sign" @click="collectQuestion">
...@@ -41,7 +39,7 @@ ...@@ -41,7 +39,7 @@
</div> </div>
<div class="sign2" @click="setSign" v-if="!$route.query.id"> <div class="sign2" @click="setSign" v-if="!$route.query.id">
<div :class="isSignText() ? 'icon active' : 'icon'"></div> <div :class="isSignText() ? 'icon active' : 'icon'"></div>
<div class="txt">{{isSignText() ? '已标记' : '标记'}}</div> <div class="txt">{{ isSignText() ? '已标记' : '标记' }}</div>
</div> </div>
<div class="end-exam-btn"> <div class="end-exam-btn">
<div class="btn" @click="endExam" v-if="!$route.query.id">交卷</div> <div class="btn" @click="endExam" v-if="!$route.query.id">交卷</div>
...@@ -102,7 +100,9 @@ export default { ...@@ -102,7 +100,9 @@ export default {
this.handlePapers() this.handlePapers()
}, 3000) }, 3000)
// 赋值页面高度 // 赋值页面高度
this.contentHeight = parseInt(document.documentElement.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight)) this.contentHeight = parseInt(
document.documentElement.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight)
)
this.getTopic() this.getTopic()
}, },
methods: { methods: {
...@@ -114,49 +114,34 @@ export default { ...@@ -114,49 +114,34 @@ export default {
ansRecord[qData.question_item_id] ansRecord[qData.question_item_id]
? ansRecord[qData.question_item_id][qData.id] ? ansRecord[qData.question_item_id][qData.id]
? ansRecord[qData.question_item_id][qData.id].sign ? ansRecord[qData.question_item_id][qData.id].sign
? flag = true ? (flag = true)
: flag = false : (flag = false)
: flag = false : (flag = false)
: flag = false : (flag = false)
} }
return flag return flag
}, },
// 标记 // 标记
setSign() { setSign() {
const data = this.questionParams.question const data = this.questionParams.question
data.sign data.sign ? (data.sign = false) : (data.sign = true)
? data.sign = false
: data.sign = true
this.$refs.signHandle.onSignHandle(data.sign) this.$refs.signHandle.onSignHandle(data.sign)
}, },
// 收藏试题 // 收藏试题
collectQuestion() { collectQuestion() {
const data = this.questionParams.question const data = this.questionParams.question
data.isCollection data.isCollection
? this.removeCall(data.id, () => { ? this.removeCall(data.id, () => { data.isCollection = false }) : this.addCall(data.id, () => { data.isCollection = true })
data.isCollection = false
})
: this.addCall(data.id, () => {
data.isCollection = true
})
}, },
addCall(id, call) { addCall(id, call) {
api api.addCollection({ question_id: id }).then(response => {
.addCollection({ question_id: id }) call(response.list)
.then(response => { })
call(response.list)
})
.finally(() => {
})
}, },
removeCall(id, call) { removeCall(id, call) {
api api.deleteCollection({ type: 2, question_id: id }).then(response => {
.deleteCollection({ type: 2, question_id: id }) call(response.list)
.then(response => { })
call(response.list)
})
.finally(() => {
})
}, },
// 提交考试 // 提交考试
endExam() { endExam() {
...@@ -188,8 +173,9 @@ export default { ...@@ -188,8 +173,9 @@ export default {
}, },
secondToDate(result) { secondToDate(result) {
const h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600) const h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600)
const m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60)) const m =
const s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60)) Math.floor((result / 60) % 60) < 10 ? '0' + Math.floor((result / 60) % 60) : Math.floor((result / 60) % 60)
const s = Math.floor(result % 60) < 10 ? '0' + Math.floor(result % 60) : Math.floor(result % 60)
if (h === 0) { if (h === 0) {
result = m + ':' + s result = m + ':' + s
} else { } else {
...@@ -206,9 +192,10 @@ export default { ...@@ -206,9 +192,10 @@ 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++
} }
this.changeData() this.changeData()
}, },
...@@ -218,33 +205,27 @@ export default { ...@@ -218,33 +205,27 @@ export default {
type: 1, type: 1,
is_create: this.$route.query.id || this.$route.query.is_create === undefined ? 0 : this.$route.query.is_create is_create: this.$route.query.id || this.$route.query.is_create === undefined ? 0 : this.$route.query.is_create
} }
api api.getExamQuestion(param).then(response => {
.getExamQuestion(param) const data = JSON.parse(response.data)
.then(response => { this.beforeChangeData = data.sheet
const data = JSON.parse(response.data) this.questionParams.beforeData = data.sheet
this.beforeChangeData = data.sheet let countData = this.filterData(data)
this.questionParams.beforeData = data.sheet if (this.$route.query.id === 'err') {
let countData = this.filterData(data) const Num = this.countErrNum(countData)
if (this.$route.query.id === 'err') { this.questionParams.question.total_question_count = Num
const Num = this.countErrNum(countData) countData = countData.filter(item => {
this.questionParams.question.total_question_count = Num return item.map(cItem => {
countData = countData.filter(item => { cItem.total_question_count = Num
return item.map(cItem => {
cItem.total_question_count = Num
})
}) })
} })
this.afterChangeData = countData }
this.questionParams.card = countData this.afterChangeData = countData
data.sheet.answers !== null && (this.questionParams.answerRecord = data.sheet.answers) this.questionParams.card = countData
this.$route.query.id && this.$route.query.id.length > 5 data.sheet.answers !== null && (this.questionParams.answerRecord = data.sheet.answers)
? this.analysisInit() this.$route.query.id && this.$route.query.id.length > 5 ? this.analysisInit() : this.changeData()
: this.changeData() this.setClock(data.sheet.remaining_times)
this.setClock(data.sheet.remaining_times) this.time.duration = data.sheet.duration
this.time.duration = data.sheet.duration })
})
.finally(() => {
})
}, },
// 计算错题总数 // 计算错题总数
countErrNum(data) { countErrNum(data) {
...@@ -282,14 +263,18 @@ export default { ...@@ -282,14 +263,18 @@ export default {
// 解析 // 解析
if (this.$route.query.id) { if (this.$route.query.id) {
if (this.$route.query.id.length > 5 || this.$route.query.id === 'all' || this.$route.query.id === 'err') { if (this.$route.query.id.length > 5 || this.$route.query.id === 'all' || this.$route.query.id === 'err') {
const qAnswer = Array.isArray(cItem.question_answer) ? cItem.question_answer : cItem.question_answer = [cItem.question_answer] const qAnswer = Array.isArray(cItem.question_answer)
? cItem.question_answer
: (cItem.question_answer = [cItem.question_answer])
let optGroup = '' let optGroup = ''
const findAB = qAnswer.map(qOpt => { const findAB = qAnswer.map(qOpt => {
const findIndex = cItem.question_options.findIndex(i => { return i.id === qOpt }) const findIndex = cItem.question_options.findIndex(i => {
return i.id === qOpt
})
return this.A_Z()[findIndex] return this.A_Z()[findIndex]
}) })
data.question_analysis = cItem.question_analysis data.question_analysis = cItem.question_analysis
optGroup = (findAB.sort().toString().replace(new RegExp(',', 'g'), '')) optGroup = findAB.sort().toString().replace(new RegExp(',', 'g'), '')
data.question_answer = optGroup data.question_answer = optGroup
} }
} }
...@@ -329,13 +314,11 @@ export default { ...@@ -329,13 +314,11 @@ export default {
let _tmp = null let _tmp = null
arr.length && (_tmp = arr[0][str]) arr.length && (_tmp = arr[0][str])
for (const i in arr) { for (const i in arr) {
arr[i][str] === _tmp arr[i][str] === _tmp ? _t.push(arr[i]) : (() => {
? _t.push(arr[i]) _tmp = arr[i][str]
: (() => { _arr.push(_t)
_tmp = arr[i][str] _t = [arr[i]]
_arr.push(_t) })()
_t = [arr[i]]
})()
} }
_arr.push(_t) _arr.push(_t)
return _arr return _arr
...@@ -351,11 +334,13 @@ export default { ...@@ -351,11 +334,13 @@ export default {
// 结果页进入设置默认点击的题 // 结果页进入设置默认点击的题
analysisInit() { analysisInit() {
this.afterChangeData.map(item => { this.afterChangeData.map(item => {
const findData = item.find(datas => { return datas.id === this.$route.query.id }) const findData = item.find(datas => {
return datas.id === this.$route.query.id
})
if (findData) { if (findData) {
this.questionParams.questionIndex = findData.q_order - 1 this.questionParams.questionIndex = findData.q_order - 1
this.questionParams.questions = findData this.questionParams.questions = findData
findData.q_order === 1 && (this.changeData()) findData.q_order === 1 && this.changeData()
} }
}) })
}, },
...@@ -368,17 +353,13 @@ export default { ...@@ -368,17 +353,13 @@ export default {
answers: JSON.stringify(this.questionParams.answerRecord), answers: JSON.stringify(this.questionParams.answerRecord),
duration: this.time.duration duration: this.time.duration
} }
api api.setCache(param).then(response => {
.setCache(param) if (n) {
.then(response => { this.$router.replace({
if (n) { path: '/testExam/result'
this.$router.replace({ })
path: '/testExam/result' }
}) })
}
})
.finally(() => {
})
} }
}, },
filterData(data) { filterData(data) {
...@@ -401,44 +382,44 @@ export default { ...@@ -401,44 +382,44 @@ 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 {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
height: 80px; height: 80px;
background: #FFFFFF; background: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 40px; padding-left: 40px;
.title{ .title {
padding-left: 20px; padding-left: 20px;
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
color: #222222; color: #222222;
line-height: 80px; line-height: 80px;
} }
.right{ .right {
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;
...@@ -448,9 +429,9 @@ export default { ...@@ -448,9 +429,9 @@ export default {
} }
} }
} }
.exam-main{ .exam-main {
display: flex; display: flex;
.left{ .left {
background: #fff; background: #fff;
flex: 1; flex: 1;
padding: 10px 20px 0 53px; padding: 10px 20px 0 53px;
...@@ -460,7 +441,7 @@ export default { ...@@ -460,7 +441,7 @@ export default {
display: none; display: none;
} }
} }
.right{ .right {
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
position: relative; position: relative;
width: 220px; width: 220px;
...@@ -473,42 +454,42 @@ export default { ...@@ -473,42 +454,42 @@ export default {
} }
} }
} }
.foot{ .foot {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
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 {
background: #fff; background: #fff;
height: 62px; height: 62px;
margin-top: -2px; margin-top: -2px;
...@@ -517,7 +498,7 @@ export default { ...@@ -517,7 +498,7 @@ export default {
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;
...@@ -525,49 +506,49 @@ export default { ...@@ -525,49 +506,49 @@ export default {
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
color: #CCCCCC; color: #cccccc;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
} }
} }
.sign{ .sign {
margin-right: 20px; margin-right: 20px;
margin-top: 8px; margin-top: 8px;
.icon{ .icon {
margin: 0 auto; margin: 0 auto;
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url(@/assets/images/collection.png); background: url(@/assets/images/collection.png);
background-size:100% 100%; background-size: 100% 100%;
&.active{ &.active {
background: url(@/assets/images/collection2.png); background: url(@/assets/images/collection2.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;
} }
} }
.sign2{ .sign2 {
margin-right: 20px; margin-right: 20px;
margin-top: 8px; margin-top: 8px;
.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;
} }
......
<template> <template>
<app-container title="考前摸底介绍"> <app-container title="模拟测试介绍">
<div class="desc-exam"> <div class="desc-exam">
<p>考试时间20分钟。</p> <p>考试时间20分钟。</p>
<p>演示考试题目共10题,全部为单选题。</p> <p>演示考试题目共10题,全部为单选题。</p>
...@@ -45,9 +45,7 @@ export default { ...@@ -45,9 +45,7 @@ export default {
const h = this.$createElement const h = this.$createElement
this.$msgbox({ this.$msgbox({
title: '消息', title: '消息',
message: h('p', null, [ message: h('p', null, [h('span', null, '您上次未做完试题 ')]),
h('span', null, '您上次未做完试题 ')
]),
showCancelButton: true, showCancelButton: true,
confirmButtonText: '继续答题', confirmButtonText: '继续答题',
cancelButtonText: '重新答题', cancelButtonText: '重新答题',
......
...@@ -27,12 +27,12 @@ const courseRoutes = [ ...@@ -27,12 +27,12 @@ const courseRoutes = [
} }
] ]
const examAnswer = [ const examAnswer = [
/* 考前摸底 */ /* 模拟测试 */
{ {
path: '/testExam', path: '/testExam',
component: () => import(/* webpackChunkName: "exam" */ '@/pages/exam/testExam/index') component: () => import(/* webpackChunkName: "exam" */ '@/pages/exam/testExam/index')
}, },
/* 考前摸底结果页 */ /* 模拟测试结果页 */
{ {
path: '/testExam/result', path: '/testExam/result',
component: () => import(/* webpackChunkName: "exam" */ '@/pages/exam/testExam/exam/result') component: () => import(/* webpackChunkName: "exam" */ '@/pages/exam/testExam/exam/result')
...@@ -128,7 +128,7 @@ export default [ ...@@ -128,7 +128,7 @@ export default [
{ path: 'questions', component: () => import(/* webpackChunkName: "my" */ '@/pages/my/questions/questionAll') } { path: 'questions', component: () => import(/* webpackChunkName: "my" */ '@/pages/my/questions/questionAll') }
] ]
}, },
/* 考前摸底考试 */ /* 模拟测试考试 */
{ {
path: '/testExam/exam', path: '/testExam/exam',
component: () => import(/* webpackChunkName: "course-learn" */ '@/pages/exam/testExam/exam/index') component: () => import(/* webpackChunkName: "course-learn" */ '@/pages/exam/testExam/exam/index')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论