examTest
This commit is contained in:
parent
821fb53ae9
commit
b8c9fce0cc
|
@ -53,6 +53,7 @@ const install = (Vue, vm) => {
|
|||
let examRecord = (id,params={})=>vm.$u.get(`/exam/examrecord/self/`,params);//我的考试记录
|
||||
let examRecordDetail = (id,params={})=>vm.$u.get(`/exam/examrecord/${id}/`,params);//我的考试记录
|
||||
let paperDetail = (id,params={})=>vm.$u.get(`/exam/paper/${id}/`,params);//测试
|
||||
let questionList = (params={})=>vm.$u.get(`/exam/question/`,params);//题目
|
||||
|
||||
vm.$u.api = {getUserInfo,
|
||||
getCode,
|
||||
|
@ -81,6 +82,7 @@ const install = (Vue, vm) => {
|
|||
submitExam,
|
||||
examRecord,
|
||||
paperDetail,
|
||||
questionList,
|
||||
examRecordDetail
|
||||
};
|
||||
}
|
||||
|
|
|
@ -145,6 +145,15 @@
|
|||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "pages/exam/question",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "专题练习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "pages/exam/testDetail",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
cellList: [
|
||||
{img:'../../static/exam/exam.png',title:'正式考试',id:'exam'},
|
||||
{img:'../../static/exam/test.png',title:'模拟测试',id:'test'},
|
||||
{img:'../../static/exam/question.png',title:'专题练习',id:'qusetion'},
|
||||
{img:'../../static/exam/question.png',title:'专题练习',id:'question'},
|
||||
{img:'../../static/exam/errorIcon.png',title:'错题记录',id:'record'},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,8 +1,75 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="cellWrap">
|
||||
<view class="cellItem" v-for="item in typeList" :key="item" @click="intoPage(item)">
|
||||
<view class="cellText">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
page: 1,
|
||||
page_size:999,
|
||||
type:'单选题'
|
||||
},
|
||||
typeList: ['单选','多选','判断']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
intoPage(item){
|
||||
this.query.type=item;
|
||||
this.$u.api.questionList(this.query).then(res=>{
|
||||
let currentExam={};
|
||||
currentExam.questions_ = res.data.results;
|
||||
uni.setStorageSync('currentExam', currentExam);
|
||||
uni.navigateTo({
|
||||
url:"/pages/exam/testDetail"
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cellWrap{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: auto;
|
||||
margin-top: 30upx;
|
||||
margin-bottom: 30upx;
|
||||
justify-content: space-evenly;
|
||||
|
||||
}
|
||||
.cellItem{
|
||||
text-align: center;
|
||||
margin-top: 50upx;
|
||||
width: 60%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
.cellText{
|
||||
height: 60upx;
|
||||
line-height: 60upx;
|
||||
text-align: center;
|
||||
color: #339900;
|
||||
border: 1px solid #339900;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
.cellItem:nth-of-type(2) .cellText{
|
||||
color: #efb336;
|
||||
border: 1px solid #efb336;
|
||||
}
|
||||
.cellItem:nth-of-type(3) .cellText{
|
||||
color: #1296db;
|
||||
border: 1px solid #1296db;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue