Commit 7b240b93 authored by 和慭琛's avatar 和慭琛

考试界面 原型图搭建 交互 100%

parent 4fd4b830
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/exam/index",
"style": {
"navigationBarTitleText": "入驻考试"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -26,15 +34,6 @@ ...@@ -26,15 +34,6 @@
{ {
"path": "pages/take/detail", "path": "pages/take/detail",
"style": { "style": {
...@@ -105,20 +104,6 @@ ...@@ -105,20 +104,6 @@
// {
// "path": "pages/photo/index",
// "style": {
// "navigationBarTitleText": "拍照"
// }
// },
{ {
"path": "pages/index/success", "path": "pages/index/success",
"style": { "style": {
...@@ -128,16 +113,6 @@ ...@@ -128,16 +113,6 @@
// {
// "path": "pages/take/try",
// "style": {
// "navigationBarTitleText": "接单",
// "enablePullDownRefresh": true
// }
// },
{ {
"path": "pages/login/wxlogin", "path": "pages/login/wxlogin",
"style": { "style": {
......
<template>
<view class="backView">
<template v-if="isStart==false">
<view class="noticeView">
<text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。
</text>
</view>
<view class="bottomView">
<view class="bottomBtn" @click="startClick()">
<text class="bottomTitle">开始考试答题</text>
</view>
</view>
</template>
<template v-if="isStart==true">
<view class="numberView">
<text class="numberText">第{{currentNumber}}题,共20题</text>
</view>
<view class="topicView">
<text class="topicText">{{currentItem.topic}}</text>
</view>
<view class="itemView" v-for="(item,ikey) in currentItem.list":key="ikey">
<text :class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' "
@click="itemClick(item,ikey)">{{item.answer}}</text>
</view>
<view class="answerBottomView">
<image class="timeIcon" src="" mode=""></image>
<text class="timeText">{{currentTime}}</text>
<view :class="isSelect ? 'nextBtn selectedColor' : 'nextBtn defaultColor' "
@click="nextClick()">
<text class="bottomTitle">下一题</text>
</view>
</view>
</template>
</view>
</template>
<script>
export default {
data() {
return {
isStart:false,
currentNumber:1,
currentItem:null,
isSelect:false,
currentTime:30
}
},
onLoad(e) {
},
methods: {
//开始考试 点击
startClick: function () {
this.isStart = true
this.getData()
},
getData: function () {
this.currentItem = {
'topic':'这是第一道题的题目这是第一道题的题目',
'list':[
{
'answer':'这是选项一这是选项一这是选项一这是选项一',
'isSelect':false,
},
{
'answer':'这是选项二这是选项二这是选项二这是选项二',
'isSelect':false,
},
{
'answer':'这是选项三这是选项三这是选项三这是选项三',
'isSelect':false,
},
],
'isMulti':true,
}
this.startCounting()
},
startCounting : function () {
this.currentTime = this.currentTime - 1
if(this.currentTime > 0){
setTimeout(this.startCounting, 1000);
}else{
this.currentTime = 30
this.nextClick()
}
},
itemClick: function (currentItem , ikey) {
this.isSelect = true
for (let i = 0; i < this.currentItem.list.length; i++) {
var item = this.currentItem.list[i]
if(this.currentItem.isMulti){
if(ikey == i){
item.isSelect = !item.isSelect
}
}else{
if(ikey == i){
item.isSelect = !item.isSelect
}else{
item.isSelect = false
}
}
}
var isSelect = false
this.currentItem.list.forEach(item => {
if(item.isSelect){
isSelect = true
}
})
this.isSelect = isSelect
},
//下一题
nextClick: function () {
this.currentNumber = this.currentNumber + 1
this.getData()
},
}
}
</script>
<style>
.backView{
background-color: #FFFFFF;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
}
.noticeView{
margin-top: 100rpx;
width: 100%;
display: flex;
}
.noticeText{
font-size: 32rpx;
color: #555555;
padding-left: 40rpx;
padding-right: 40rpx;
}
.numberView{
margin-top: 100rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.numberText{
font-size: 28rpx;
font-weight: bold;
}
.topicView{
margin-top: 100rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.topicText{
font-size: 28rpx;
padding-left: 40rpx;
padding-right: 40rpx;
}
.itemView{
margin-top: 100rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.itemText{
font-size: 28rpx;
padding-top: 40rpx;
padding-bottom: 40rpx;
padding-left: 40rpx;
padding-right: 40rpx;
}
.bottomView{
background-color: #FFFFFF;
width: 100%;
height: 140rpx;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0;
}
.bottomBtn{
background-color: #007AFF;
width: 60%;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.bottomTitle{
font-size: 32rpx;
color: #FFFFFF;
}
.answerBottomView{
background-color: #FFFFFF;
width: 100%;
height: 140rpx;
display: flex;
flex-direction: row;
align-items: center;
position: fixed;
bottom: 0;
}
.timeIcon{
background-color: #999999;
margin-left: 80rpx;
width: 80rpx;
height: 80rpx;
border-radius: 40rpx;
}
.timeText{
margin-left: 20rpx;
font-size: 32rpx;
color: #999999;
}
.nextBtn{
width: 400rpx;
height: 80rpx;
border-radius: 40rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.defaultColor{
background-color: #999999;
}
.selectedColor{
background-color: #007AFF;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment