选项
This commit is contained in:
@@ -44,7 +44,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
back() {
|
||||
uni.navigateBack({
|
||||
delta: 2,
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
}
|
||||
|
||||
@@ -1,28 +1,44 @@
|
||||
<template>
|
||||
<div class="testForm">
|
||||
<u-navbar title="法治学习" :background="backgroundNavbar"></u-navbar>
|
||||
<div @touchstart="touchStart" @touchend="touchEnd">
|
||||
<div class="type">
|
||||
<div class="type_left">单选题</div>
|
||||
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{questionList.length}}</div>
|
||||
</div>
|
||||
<div class="topic">
|
||||
<div v-for="(item,index) in questionList" :key="index" >
|
||||
<div v-if="activeIndex === index">
|
||||
<div>{{ item.subject }}</div>
|
||||
<div>
|
||||
|
||||
<div class="type">
|
||||
<div class="type_left">单选题</div>
|
||||
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{questionList.length}}</div>
|
||||
</div>
|
||||
<div class="topic">
|
||||
<div v-for="(item,index) in questionList" :key="index" >
|
||||
<div v-if="activeIndex === index">
|
||||
<!-- 题目 -->
|
||||
<div>{{ item.subject }}</div>
|
||||
<!-- 单选 -->
|
||||
<div class="answer_list">
|
||||
<div class="answer_item error">
|
||||
{{ options[index] }}: {{ item.answer}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 多选 -->
|
||||
<!-- <div class="answer_list">
|
||||
<div class="answer_item error">
|
||||
{{ options[index] }}: {{ item.answer}}
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="btn" @click="next" v-if="activeIndex < questionList.length - 1">下一题</div> -->
|
||||
<div class="type mar-top">
|
||||
<div class="type_left">答案解析</div>
|
||||
</div>
|
||||
<div class="topic mar-top">
|
||||
<div><span>正确答案:</span></div>
|
||||
<div>获悉,党的十八大以来,曲靖市深入学习贯彻习近平新时代中国特色社会主义思想,坚持以习近平法治思想为根本遵循和行动指南。</div>
|
||||
</div>
|
||||
<div class="btn" @click="nextTopic" v-if="activeIndex < questionList.length - 1">下一题</div>
|
||||
<div class="btn" @click="confirm">确定</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
customNavigation: true,
|
||||
data() {
|
||||
@@ -69,13 +85,34 @@ export default {
|
||||
moveX: 0, // 滑动的x轴距离
|
||||
activeIndex: 0, // 当前第几题
|
||||
newIndex: 0, // 滑动到第几题
|
||||
list: [{
|
||||
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
|
||||
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
|
||||
},
|
||||
{
|
||||
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
|
||||
title: '身无彩凤双飞翼,心有灵犀一点通'
|
||||
},
|
||||
{
|
||||
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
|
||||
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
|
||||
}
|
||||
],
|
||||
createdTime: '', // 开始答题时间
|
||||
endTime: '', // 结束时间
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSwiper() {
|
||||
console.log(e);
|
||||
},
|
||||
onSlideChange(o) {
|
||||
console.log(o);
|
||||
},
|
||||
getList() {
|
||||
console.log('题目列表');
|
||||
},
|
||||
next() {
|
||||
nextTopic() {
|
||||
this.activeIndex ++;
|
||||
},
|
||||
touchStart(e) {
|
||||
@@ -105,6 +142,9 @@ export default {
|
||||
onReachBottom() {
|
||||
this.current ++;
|
||||
},
|
||||
onLoad() {
|
||||
this.createdTime = Date.parse(new Date())
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -138,6 +178,40 @@ export default {
|
||||
margin-top: 80px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
|
||||
|
||||
.answer_list {
|
||||
margin-top: 32px;
|
||||
|
||||
.answer_item {
|
||||
background: #FBFCFE;
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 16px;
|
||||
padding: 28px 24px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.myChoice {
|
||||
width: 136px;
|
||||
height: 48px;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #E23C3C;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.succeed {
|
||||
border: 2px solid #2D7EFE;
|
||||
color: #2D7DFF;
|
||||
}
|
||||
|
||||
.error {
|
||||
border: 2px solid #E23C3C;
|
||||
color: #E23C3C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mar-top {
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
@@ -152,7 +226,7 @@ export default {
|
||||
background: #2D7DFF;
|
||||
border-radius: 44px;
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
font-size: 34px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user