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

@@ -98,8 +98,8 @@ export default {
handleToTest(id) { handleToTest(id) {
// 没有认证 // 没有认证
// if(!this.user.areaId) { // if(!this.user.areaId) {
// this.showAuth = true; // this.showAuth = true;
// 已认证 // 已认证
// } else { // } else {
this.$emit('toTest',id) this.$emit('toTest',id)
// } // }
@@ -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

@@ -1,55 +1,58 @@
<template> <template>
<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 class="type"> <div v-for="(item,index) in list" :key="index">
<div class="type_left">单选题</div> <div v-if="activeIndex === index">
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{ list.length }}</div> <div class="type">
</div> <div class="type_left">{{ item.type==0? '单选题':item.type==1? '多选题': '判断题' }}</div>
<div class="topic"> <div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{ list.length }}</div>
<div v-for="(item,index) in list" :key="index" > </div>
<div v-if="activeIndex === index"> <div class="topic">
<!-- 题目 --> <div>
<div>{{ item.title }}</div> <div >
<!-- 单选 --> <!-- 题目 -->
<div class="answer_list" v-if="item.type==0"> <div>{{ item.title }}</div>
<!-- 'succeed': clickIndex==inx && opt.checked == 1, 'item-error': clickIndex == inx && item.checked == 0 --> <!-- 单选 -->
<div class="answer_item" v-for="(opt,inx) in item.items" :key="inx" <div class="answer_list" v-if="item.type==0">
:class="{'Checked': clickIndex == inx}"> <!-- 'succeed': clickIndex==inx && opt.checked == 1, 'item-error': clickIndex == inx && item.checked == 0 -->
{{ opt.sort }}: {{ opt.content}} <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
</div> :class="{'Checked': clickIndex == inx}">
</div> {{ opt.sort }}: {{ opt.content}}
<!-- 多选 --> </div>
<div class="answer_list" v-if="item.type==1"> </div>
<div class="answer_item" v-for="(opt,inx) in item.items" :key="inx" <!-- 多选 -->
@click="itemClick(inx)"> <div class="answer_list" v-if="item.type==1">
{{ opt.sort }}: {{ opt.content}} <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
</div> @click="itemClick(inx)">
</div> {{ opt.sort }}: {{ opt.content}}
<!-- 判断 --> </div>
<div class="answer_list" v-if="item.type==2"> </div>
<div class="answer_item" v-for="(opt,inx) in item.items" :key="inx" <!-- 判断 -->
:class="{'Checked': clickIndex == inx}" <div class="answer_list" v-if="item.type==2">
@click="itemClick(inx)"> <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
{{ opt.sort }}: {{ opt.content}} :class="{'Checked': clickIndex == inx, 'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && clickIndex == inx && opt.checked == 0}"
@click="itemClick(inx)">
{{ opt.sort }}: {{ opt.content}}
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="type mar-top" v-if="showAnalysis">
<div class="type_left">答案解析</div>
</div>
<div class="topic mar-top" v-if="showAnalysis">
<div><span>正确答案</span></div>
<div style="margin-top: 8px" v-html="list[activeIndex].analysis"></div>
</div>
</div> </div>
</div> </div>
<div class="type mar-top" v-if="showAnalysis"> <div class="btn" @click="nextTopic" v-if="activeIndex < list.length - 1 && showNext">下一题</div>
<div class="type_left">答案解析</div>
</div>
<div class="topic mar-top" v-if="showAnalysis">
<div><span>正确答案</span></div>
<div style="margin-top: 8px" v-html="list[activeIndex].analysis"></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 class="btn" v-show="showConfirm" @click="confirm">确定</div>
</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() {
uni.navigateTo({url: './result'})
this.showAnalysis = true;
if(this.activeIndex < this.list.length - 1) {
this.showNext = true;
this.showConfirm = false;
} else {
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>