Commit d1efcde1 authored by 李俊赕's avatar 李俊赕

设计稿问题优化

parent 5c220466
......@@ -11,7 +11,7 @@
</view>
</view>
</template>
<template v-if="isStart==true">
<template v-if="isStart==true && currentItem">
<view class="bottom-padding">
<view class="numberView">
<text class="numberText">{{progress}}</text>
......@@ -21,11 +21,13 @@
</view>
<view class="itemBackView" v-for="(item,ikey) in currentItem.answerList" :key="ikey">
<view class="itemView" @click="itemClick(item,ikey)">
<view :class="['itemView',item.isSelect ? 'active':'']" @click="itemClick(item,ikey)">
<view :class="item.isSelect ? 'itemIndexView' : 'itemIndexView grayBorder' ">
<text :class="item.isSelect ? 'itemIndexText whiteColor selectBackColor' : 'itemIndexText defaultColor' ">A</text>
<text :class="item.isSelect ? 'itemIndexText whiteColor selectBackColor' : 'itemIndexText defaultColor' ">
{{alphaArr[ikey]}}
</text>
</view>
<text :class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' ">{{item.content}}</text>
<text :class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' ">{{contentFilter(item.content)}}</text>
<!--view></view-->
</view>
......@@ -74,6 +76,8 @@
isStop: false,
clock_url:'https://qn-static.banshouhui.com/clock_exam.png',
examScore:1,
alphaArr:['A','B','C','D','E'],
timer:null,
}
},
onLoad(e) {
......@@ -84,7 +88,14 @@
},
methods: {
contentFilter(txt){
if(!txt){
return txt
}
let reg = /\w+\.?/;
const result = txt.replace(reg,'')
return result
},
//开始考试 点击
startClick: function() {
this.isStart = true
......@@ -127,7 +138,6 @@
})
return
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
if (res.data.data.examStatus == 2) {
......@@ -139,8 +149,6 @@
that.userExamId = res.data.data.id
that.getNext()
}
// console.log('code=200')
//this.handleList(res)
} else {
uni.showToast({
......@@ -159,8 +167,6 @@
icon: 'none',
title: '获取考试信息失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
......@@ -188,8 +194,6 @@
},
success: (res) => {
uni.hideLoading()
console.log('申请考试 成功')
console.log(res)
if (res.statusCode == 401) {
uni.navigateTo({
......@@ -204,8 +208,6 @@
that.userExamId = res.data.data.userExamId
that.getNext()
}
// console.log('code=200')
//this.handleList(res)
} else {
uni.showToast({
......@@ -224,8 +226,6 @@
icon: 'none',
title: '申请考试 失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
......@@ -264,9 +264,6 @@
},
success: (res) => {
uni.hideLoading()
console.log('获取下一题 成功')
console.log(res)
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/wxlogin'
......@@ -277,7 +274,7 @@
if (res.data.code == 200) {
that.currentItem = res.data.data
that.progress = res.data.data.progress
if (res.data.data.answerList) {
that.handleData()
that.currentTime = 100
......@@ -285,13 +282,10 @@
that.startCounting()
} else {
that.isSelect = true
clearTimeout(this.timer)
that.bottomTitle = '完成考试,现在签约'
}
// console.log('code=200')
//this.handleList(res)
} else {
uni.showToast({
icon: 'none',
......@@ -309,8 +303,7 @@
icon: 'none',
title: '获取下一题 失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
......@@ -319,14 +312,9 @@
handleData: function() {
this.currentItem.answerList.forEach(item => {
item.isSelect = false
})
console.log(this.currentItem)
},
startCounting: function() {
......@@ -338,7 +326,7 @@
this.currentTime = this.currentTime - 1
if (this.currentTime > 0) {
setTimeout(this.startCounting, 1000);
this.timer = setTimeout(this.startCounting, 1000);
} else {
this.currentTime = 100
this.nextClick()
......@@ -349,9 +337,6 @@
itemClick: function(currentItem, ikey) {
this.isSelect = true
//answerType 题目类型,1单选,2多选,3简答,
......@@ -388,10 +373,8 @@
//下一题
nextClick: function() {
console.log(this.bottomTitle)
if (this.bottomTitle == '完成考试,现在签约') {
clearTimeout(this.timer)
this.postResult()
// uni.navigateTo({
// url: '/pages/settle/prompt'
......@@ -421,8 +404,6 @@
},
success: (res) => {
uni.hideLoading()
console.log('上传考试结果 成功')
console.log(res)
if (res.statusCode == 401) {
uni.navigateTo({
......@@ -454,8 +435,7 @@
icon: 'none',
title: '上传考试结果失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
......@@ -494,9 +474,6 @@
})
console.log('所选答案:')
console.log(this.userAnswerIds)
this.getNext()
},
......@@ -511,7 +488,7 @@
}
</script>
<style>
<style lang="scss">
.backView {
background-color: #F3F3F3;
position: absolute;
......@@ -581,6 +558,10 @@
flex-direction: row;
align-items: center;
border-radius: 12rpx;
border:2rpx solid transparent;
&.active{
border:2rpx solid #2272FF;
}
}
.itemIndexView {
......@@ -588,6 +569,7 @@
width: 40rpx;
height: 40rpx;
border-radius: 8rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
......@@ -598,10 +580,11 @@
}
.itemIndexText {
width: 40rpx;
height: 40rpx;
border-radius: 8rpx;
width: 36rpx;
height: 36rpx;
display: block;
line-height: 40rpx;
line-height: 36rpx;
text-align: center;
font-size: 28rpx;
}
......
......@@ -50,11 +50,10 @@
<style>
.backView{
overflow: hidden;
background-color: #FFFFFF;
position: absolute;
top: 0;
left: 0;
width: 100%;
height:100vh;
display: flex;
flex-direction: column;
}
......@@ -107,12 +106,16 @@
}
.image{
padding-left: 44rpx;
width: 706rpx;
margin-left: 44rpx;
margin-right: 0;
height: 766rpx;
}
.bottomView{
position: fixed;
bottom:0;
left:0;
padding-top: 64rpx;
padding-bottom: 68rpx;
width: 100%;
......
......@@ -527,14 +527,15 @@
// bottom: px2rem(36);
height: 104rpx;
line-height: 104rpx;
border-radius: 52rpx;
background: #2272ff;
font-size: 32rpx;
color: #fff;
&:disabled {
border: 2rpx solid #999;
background-color: #f3f3f3;
color: #999;
&[disabled] {
border: none;
background-color: #999999;
color: #fff;
}
}
}
......
......@@ -84,7 +84,7 @@
}
</script>
<style>
<style lang="scss">
.back_view{
background-color: #FFFFFF;
......@@ -117,10 +117,15 @@
margin-top: 30rpx;
width: 600rpx;
height: 104rpx;
line-height:96rpx;
border-radius: 54rpx;
border: 4rpx solid #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
&.apply_color{
border: 4rpx solid #2272FF;
}
}
.bottom_title{
......
......@@ -29,7 +29,7 @@
statusName:'已通过',
txtArr:['您已通过','“充电桩安装入驻审核”'],
btnTxt:'去考试',
url:'/pages/exam/index'
url:'/pages/exam/start'
},{
status:3,
statusName:'备选',
......
......@@ -592,7 +592,7 @@
height: 104rpx;
line-height: 104rpx;
border-radius: 52rpx;
background: #fff;
background: #2272FF;
font-size: 32rpx;
color: #fff;
......
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