This commit is contained in:
shijingjing
2023-02-14 17:10:40 +08:00
parent 8cb77ebeee
commit bb744c49b9
4 changed files with 71 additions and 51 deletions

View File

@@ -15,7 +15,7 @@
<div class="comment" @click="showComment = true;getComment()"> <div class="comment" @click="showComment = true;getComment()">
<img src="https://cdn.cunwuyun.cn/qujing/message.png" alt=""> <img src="https://cdn.cunwuyun.cn/qujing/message.png" alt="">
<div class="comm_num"> <div class="comm_num">
<span>{{ commentList.length || 0}}</span><span v-show="commentList.length > 999">+</span> <span>{{ data.msgCount || 0}}</span><span v-show="data.msgCount > 999">+</span>
</div> </div>
</div> </div>
</div> </div>
@@ -115,6 +115,7 @@ export default {
this.flag = false this.flag = false
this.showSend = false this.showSend = false
this.getComment() this.getComment()
this.getDetail()
} }
}).catch(err=> { }).catch(err=> {
this.flag = false this.flag = false
@@ -242,6 +243,8 @@ export default {
.comment_info { .comment_info {
margin-left: 16px; margin-left: 16px;
width: calc(100% - 80px);
.avatar_info { .avatar_info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@@ -126,7 +126,7 @@ export default {
this.$u.toast('认证成功') this.$u.toast('认证成功')
setTimeout(()=> { setTimeout(()=> {
this.showAuth = false this.showAuth = false
this.$emit('toTest') this.$emit('toTest',id)
}, 500) }, 500)
} }
}).catch((err)=> { }).catch((err)=> {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="OnlineClass"> <div class="OnlineClass">
<div class="search_box"> <div class="search_box">
<u-search placeholder="请输入需要搜索的课程" bg-color="#FFF" v-model="title" :show-action="false"></u-search> <u-search placeholder="请输入需要搜索的课程" bg-color="#FFF" v-model="title" :show-action="false" @search="getList"></u-search>
</div> </div>
<p class="all_class">全部课程</p> <p class="all_class">全部课程</p>

View File

@@ -2,13 +2,15 @@
<div class="testForm"> <div class="testForm">
<u-navbar title="法治学习" :background="backgroundNavbar"></u-navbar> <u-navbar title="法治学习" :background="backgroundNavbar"></u-navbar>
<div class="testForm_info" > <div class="testForm_info" >
<div v-for="(item,index) in list" :key="index">
<div v-if="activeIndex === index">
<div class="type"> <div class="type">
<div class="type_left">单选题</div> <div class="type_left">{{ item.type==0? '单选题':item.type==1? '多选题': '判断题' }}</div>
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{ list.length }}</div> <div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{ list.length }}</div>
</div> </div>
<div class="topic"> <div class="topic">
<div v-for="(item,index) in list" :key="index" > <div>
<div v-if="activeIndex === index"> <div >
<!-- 题目 --> <!-- 题目 -->
<div>{{ item.title }}</div> <div>{{ item.title }}</div>
<!-- 单选 --> <!-- 单选 -->
@@ -29,7 +31,7 @@
<!-- 判断 --> <!-- 判断 -->
<div class="answer_list" v-if="item.type==2"> <div class="answer_list" v-if="item.type==2">
<div class="answer_item" v-for="(opt,inx) in item.items" :key="inx" <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
:class="{'Checked': clickIndex == inx}" :class="{'Checked': clickIndex == inx, 'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && clickIndex == inx && opt.checked == 0}"
@click="itemClick(inx)"> @click="itemClick(inx)">
{{ opt.sort }}: {{ opt.content}} {{ opt.sort }}: {{ opt.content}}
</div> </div>
@@ -45,11 +47,12 @@
<div><span>正确答案</span></div> <div><span>正确答案</span></div>
<div style="margin-top: 8px" v-html="list[activeIndex].analysis"></div> <div style="margin-top: 8px" v-html="list[activeIndex].analysis"></div>
</div> </div>
</div>
<div class="btn" v-show="showNext" @click="nextTopic" v-if="activeIndex < list.length - 1">下一题</div>
<div class="btn" v-show="showConfirm" @click="confirm">确定</div>
</div> </div>
<div class="btn" @click="nextTopic" v-if="activeIndex < list.length - 1 && showNext">下一题</div>
<div class="btn" v-show="showConfirm" @click="confirm">确定</div>
</div>
</div> </div>
</template> </template>
@@ -64,13 +67,13 @@ export default {
}, },
list: [], list: [],
activeIndex: 0, // 当前第几题 activeIndex: 0, // 当前第几题
createdTime: '', // 开始答题时间
endTime: '', // 结束时间 endTime: '', // 结束时间
id: '', // 题库id id: '', // 题库id
showConfirm: false, showConfirm: false,
showNext: false, showNext: false,
clickIndex: '', clickIndex: '',
showAnalysis: false, showAnalysis: false,
subjectConfigs: [],
} }
}, },
methods: { methods: {
@@ -78,21 +81,36 @@ export default {
this.$instance.post(`/app/appexaminationinfo/queryDetailById?id=${id}`).then(res=> { this.$instance.post(`/app/appexaminationinfo/queryDetailById?id=${id}`).then(res=> {
if(res?.data) { if(res?.data) {
this.list = res.data.questions this.list = res.data.questions
this.subjectConfigs = res.data.subjectConfigs
} }
}) })
}, },
itemClick(i) { itemClick(i) {
if(this.list[this.activeIndex].type==2) { // 判断 if (this.showAnalysis) return
if(this.list[this.activeIndex].type==0) { // 单选
} else if(this.list[this.activeIndex].type==1) { // 多选
} else if(this.list[this.activeIndex].type==2) { // 判断
this.clickIndex = i this.clickIndex = i
this.showConfirm = true this.showConfirm = true
// this.list[this.activeIndex].items.myAnswer = this.list[this.activeIndex].i
} }
}, },
nextTopic() { nextTopic() {
this.activeIndex ++; this.activeIndex ++;
this.clickIndex = ''
this.showAnalysis = false
}, },
confirm() { confirm() {
this.showAnalysis = true;
if(this.activeIndex < this.list.length - 1) {
this.showNext = true;
this.showConfirm = false;
} else {
uni.navigateTo({url: './result'}) uni.navigateTo({url: './result'})
}
}, },
}, },
onReachBottom() { onReachBottom() {
@@ -100,7 +118,6 @@ export default {
}, },
onLoad(o) { onLoad(o) {
this.getList(o.id) this.getList(o.id)
// this.createdTime = Date.parse(new Date())
} }
} }
</script> </script>