背景图
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<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="type">
|
<div class="type">
|
||||||
<div class="type_left">单选题</div>
|
<div class="type_left">单选题</div>
|
||||||
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{questionList.length}}</div>
|
<div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{questionList.length}}</div>
|
||||||
@@ -32,20 +33,21 @@
|
|||||||
<div><span>正确答案:</span></div>
|
<div><span>正确答案:</span></div>
|
||||||
<div>获悉,党的十八大以来,曲靖市深入学习贯彻习近平新时代中国特色社会主义思想,坚持以习近平法治思想为根本遵循和行动指南。</div>
|
<div>获悉,党的十八大以来,曲靖市深入学习贯彻习近平新时代中国特色社会主义思想,坚持以习近平法治思想为根本遵循和行动指南。</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn" @click="nextTopic" v-if="activeIndex < questionList.length - 1">下一题</div>
|
<!-- <div class="btn" @click="nextTopic" v-if="activeIndex < questionList.length - 1">下一题</div> -->
|
||||||
<div class="btn" @click="confirm">确定</div>
|
<div class="btn" @click="confirm">确定</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
|
||||||
export default {
|
export default {
|
||||||
customNavigation: true,
|
customNavigation: true,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
backgroundNavbar: {
|
backgroundNavbar: {
|
||||||
// background: "url('./img/navbar.png') no-repeat",
|
background: "url('https://cdn.cunwuyun.cn/qujing/navbar.png') no-repeat",
|
||||||
// backgroundSize: '100% 100%',
|
backgroundSize: '100% 100%',
|
||||||
},
|
},
|
||||||
|
|
||||||
options: ['A','B','C','D','E','F','G','H','I','J','K','L','M'],
|
options: ['A','B','C','D','E','F','G','H','I','J','K','L','M'],
|
||||||
@@ -85,19 +87,19 @@ export default {
|
|||||||
moveX: 0, // 滑动的x轴距离
|
moveX: 0, // 滑动的x轴距离
|
||||||
activeIndex: 0, // 当前第几题
|
activeIndex: 0, // 当前第几题
|
||||||
newIndex: 0, // 滑动到第几题
|
newIndex: 0, // 滑动到第几题
|
||||||
list: [{
|
// list: [{
|
||||||
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
|
// image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
|
||||||
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
|
// title: '昨夜星辰昨夜风,画楼西畔桂堂东'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
|
// image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
|
||||||
title: '身无彩凤双飞翼,心有灵犀一点通'
|
// title: '身无彩凤双飞翼,心有灵犀一点通'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
|
// image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
|
||||||
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
|
// title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
createdTime: '', // 开始答题时间
|
createdTime: '', // 开始答题时间
|
||||||
endTime: '', // 结束时间
|
endTime: '', // 结束时间
|
||||||
}
|
}
|
||||||
@@ -115,26 +117,26 @@ export default {
|
|||||||
nextTopic() {
|
nextTopic() {
|
||||||
this.activeIndex ++;
|
this.activeIndex ++;
|
||||||
},
|
},
|
||||||
touchStart(e) {
|
// touchStart(e) {
|
||||||
this.startX = e.changedTouches[0].pageX
|
// this.startX = e.changedTouches[0].pageX
|
||||||
console.log('开始触摸:', this.startX);
|
// console.log('开始触摸:', this.startX);
|
||||||
},
|
// },
|
||||||
touchEnd(e, index) { // 手指离开屏幕时触发
|
// touchEnd(e, index) { // 手指离开屏幕时触发
|
||||||
// 获取滑动距离
|
// // 获取滑动距离
|
||||||
const moveX = e.changedTouches[0].pageX - this.startX
|
// const moveX = e.changedTouches[0].pageX - this.startX
|
||||||
// 判断滑动方向
|
// // 判断滑动方向
|
||||||
if (moveX < -100 && index < this.topic.length-1) {
|
// if (moveX < -100 && index < this.topic.length-1) {
|
||||||
// 【下一题】 判断大幅度左滑且不是最后一题
|
// // 【下一题】 判断大幅度左滑且不是最后一题
|
||||||
this.newIndex=this.newIndex+1
|
// this.newIndex=this.newIndex+1
|
||||||
this.activeIndex= this.activeIndex+1
|
// this.activeIndex= this.activeIndex+1
|
||||||
console.log('第'+this.index+'题');
|
// console.log('第'+this.index+'题');
|
||||||
}
|
// }
|
||||||
else if (moveX > 100 && index!= 0) {
|
// else if (moveX > 100 && index!= 0) {
|
||||||
// 【上一题】 判断大幅度右滑且不是第一题
|
// // 【上一题】 判断大幅度右滑且不是第一题
|
||||||
this.newIndex=this.newIndex-1
|
// this.newIndex=this.newIndex-1
|
||||||
this.activeIndex=this.activeIndex-1
|
// this.activeIndex=this.activeIndex-1
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
confirm() {
|
confirm() {
|
||||||
uni.navigateTo({url: './result'})
|
uni.navigateTo({url: './result'})
|
||||||
},
|
},
|
||||||
@@ -143,23 +145,25 @@ export default {
|
|||||||
this.current ++;
|
this.current ++;
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.createdTime = Date.parse(new Date())
|
// this.createdTime = Date.parse(new Date())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.testForm {
|
.testForm {
|
||||||
// background: url("./img/bg.png") no-repeat;
|
.testForm_info {
|
||||||
padding: 0 32px;
|
background: url("https://cdn.cunwuyun.cn/qujing/bg.png") no-repeat;
|
||||||
margin-top: 80px;
|
background-size: 100% 100%;
|
||||||
|
padding: 80px 32px 0 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
.type {
|
.type {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
// margin-top: 80px;
|
||||||
|
|
||||||
.type_left {
|
.type_left {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -217,8 +221,8 @@ export default {
|
|||||||
.btn {
|
.btn {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
width: 320px;
|
width: 320px;
|
||||||
height: 88px;
|
height: 88px;
|
||||||
line-height: 88px;
|
line-height: 88px;
|
||||||
@@ -230,4 +234,5 @@ export default {
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user