提交 70718cf6 authored 作者: lihuihui's avatar lihuihui

updata

上级 b71cdd5a
......@@ -26,6 +26,10 @@
<div v-if="ratioNum == 100" class="txt">成功近在眼前,再接再厉!</div>
<div v-else class="txt">您离成功还有一段距离,继续努力!</div>
</div>
<div class="nl-btn" v-if="title == '能力自测'">
<div class="btn" @click="$router.go(-1)">重做测试</div>
<div class="btn">学习课程</div>
</div>
<div class="card">
<div class="tit">答题卡:</div>
<div class="card_con">
......@@ -83,6 +87,10 @@
</div>
</div>
</div>
<div class="st-btn">
<div class="btn" @click="go(0)">全部解析</div>
<div class="btn" @click="go(-1)">错误解析</div>
</div>
</div>
</div>
</div>
......@@ -334,4 +342,46 @@ export default {
}
}
}
.nl-btn{
display: flex;
margin-top: .3rem;
.btn{
width:3rem;
height:.7rem;
background:linear-gradient(90deg,rgba(43,124,233,1) 0%,rgba(103,168,255,1) 100%);
border-radius:.12rem;
font-size: .3rem;
color: #fff;
text-align: center;
line-height: .7rem;
}
.btn:nth-child(2){
margin-left: auto;
}
}
.st-btn{
width: 100%;
position: fixed;
bottom: 0;
left: 0;
height: 1rem;
background:rgba(255,255,255,1);
box-shadow:0px 0px 6px 0px rgba(0,0,0,0.05);
z-index: 99;
display: flex;
align-items: center;
padding: 0 .4rem;
.btn{width:3rem;
height:.7rem;
background:rgba(43,124,233,1);
border-radius:.12rem;
color: #fff;
font-size: .3rem;
text-align: center;
line-height: .7rem;
}
.btn:nth-child(2){
margin-left: auto;
}
}
</style>
......@@ -154,7 +154,6 @@ export default {
}
},
beforeDestroy() {
console.log(111111)
clearInterval(this.initTime)
// clearInterval(this.cache)
},
......@@ -356,7 +355,11 @@ export default {
const param = this.requestParam
Exam.getExam(param, this.requestParam.papersUrl).then(res => {
const times = res.sheet.remainingTime ? res.sheet.remainingTime : res.sheet.duration
this.questionsData = res
if (this.$route.query.id === -1 || this.$route.query.id === '-1') {
this.errorQuestion(res)
} else {
this.questionsData = res
}
this.remainingTime = this.secondToDate(times)
this.setClock(times)
if (res.sheet.status === 1 || res.sheet.status === 2) {
......@@ -393,6 +396,19 @@ export default {
}
})
},
errorQuestion(data) {
let count = data.sheet.question_count
data.questions.map((item) => {
item.question_list.map((dItem, index) => {
if (data.score_items[item.id][dItem.id].is_right) {
item.question_list.splice(index, 1)
count--
}
})
})
data.sheet.question_count = count
this.questionsData = data
},
getSecond(time) {
let s = ''
const hour = time.split(':')[0]
......
......@@ -21,6 +21,9 @@ export default {
// { vmid: 'description', name: 'description', content: this.description }
]
}
},
beforeDestroy() {
window.localStorage.isBack = true
}
}
</script>
......
......@@ -70,6 +70,16 @@ png图片,可以方便你直接应用到自己的设计作品中,我们
</div>
</div>
</div>
<div class="exam_submit" v-if="isExamPopTo">
<div class="pop">
<div class="tit">能力自测</div>
<div class="txt">考试还未结束确定退出考试?</div>
<div class="btn_box">
<div class="btn" @click="isExamPopTo = false">看看其他</div>
<div class="btn btn2" @click="goAbilityExam(0)">继续考试</div>
</div>
</div>
</div>
</div>
</template>
......@@ -83,6 +93,7 @@ export default {
data() {
return {
isExamPop: false,
isExamPopTo: false,
tabNav: {
navText: ['能力自测', '随堂小测', '知识点小测'],
navIndex: 0
......@@ -90,6 +101,11 @@ export default {
CourseChapter: []
}
},
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
metaInfo () {
return {
title: '课程测验',
......@@ -101,9 +117,29 @@ export default {
mounted() {
this.getCourseChapterList()
this.scrollDom()
this.init()
},
methods: {
abilityExam() {
async init() {
const param = {
type: 1
}
const isLogin = await this.$store.dispatch('checkLogin')
if (isLogin) {
api.getExamStatus(param).then(res => {
if (res.status === '0' || res.status === '3') {
console.log(11111)
this.isExamPopTo = true
}
})
}
},
async abilityExam() {
const isLogin = await this.$store.dispatch('checkLogin')
if (!isLogin) {
this.goAbilityExam(1)
return false
}
const param = {
type: 1
}
......@@ -154,7 +190,22 @@ export default {
go() {
this.$router.push('/exam/answer')
},
tab(e) {
async tab(e) {
const isLogin = await this.$store.dispatch('checkLogin')
console.log(isLogin)
if (!isLogin) {
if (this.isWeapp) {
// 小程序
wx.miniProgram.navigateTo({
url: `/pages/login/index?redirect_uri=${encodeURIComponent(
`/pages/web/index?src=${window.location.origin}/course/learn`
)}`
})
} else {
this.$router.push({ name: 'login' })
}
return
}
this.tabNav.navIndex = e
this.scrollDom()
},
......
......@@ -13,10 +13,10 @@
<li class="nav-item" @click="onClickNav('courseLearn', true)">
<img src="../../assets/images/home_menu_01.png" alt="课程学习" />
</li>
<li class="nav-item" @click="onClickNav('courseTest')">
<li class="nav-item" @click="onClickNav('examIndex')">
<img src="../../assets/images/home_menu_02.png" alt="课程测验" />
</li>
<li class="nav-item">
<li class="nav-item" @click="onClickNav('mockIndex', true)">
<img src="../../assets/images/home_menu_03.png" alt="模拟考试" />
</li>
</ul>
......@@ -66,7 +66,7 @@ export default {
async onClickNav(name, requireLogin) {
const map = {
courseLearn: `/pages/web/index?src=${window.location.origin}/course/learn`,
courseTest: `/pages/web/index?src=${window.location.origin}/test`
examIndex: `/pages/web/index?src=${window.location.origin}/exam/index?isBack=1`
}
const isLogin = requireLogin
? await this.$store.dispatch('checkLogin')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论