Commit 30a32cb2 authored by zhengke's avatar zhengke

修改

parent e86dddd6
......@@ -5,22 +5,14 @@
<view class="name">
<view>
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color: #999999"
>(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text
>
<text style="color: #999999">(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text>
</view>
<view class="ExamIndex_Box">
<text class="Single_Before">{{ ExamIndex }}</text
>/
<text class="Single_Before">{{ ExamIndex }}</text>/
<text class="Exam_Total">{{ data.DetailsList.length }}</text>
</view>
</view>
<swiper
class="swiper-box"
:autoplay="autoplay"
:current="current"
@change="onchange"
>
<swiper class="swiper-box" :autoplay="autoplay" :current="current" @change="onchange">
<swiper-item></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1">
<view class="item1">
......@@ -28,19 +20,11 @@
<view>{{ index1 + 1 }}</view>
<view class="num" v-html="item1.Title"></view>
</view>
<view
v-for="(item2, index2) in item1.QuestionContentObj"
:key="index2"
style="border-bottom: 1px solid #d1d1d1"
>
<view
v-for="(item3, index3) in item2.OptionList"
:key="index3"
class="flex item2 flex_start_center"
@click="getAnswer(item2.OptionList, item3, item1)"
>
<view class="chooseNum" :class="{ myAnswer: item3.IsAnswer }"
>{{ item3.Name }}
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2"
style="border-bottom: 1px solid #d1d1d1">
<view v-for="(item3, index3) in item2.OptionList" :key="index3"
class="flex item2 flex_start_center" @click="getAnswer(item2.OptionList, item3, item1)">
<view class="chooseNum" :class="{ myAnswer: item3.IsAnswer }">{{ item3.Name }}
</view>
<view class="chooseName" v-html="item3.Content"></view>
</view>
......@@ -55,7 +39,7 @@
</template>
<script>
import {
import {
ref,
reactive,
toRefs,
......@@ -64,18 +48,23 @@ import {
watch,
computed,
onMounted,
} from "vue";
import { changeNumToHan } from "../../utils/index";
export default {
} from "vue";
import {
changeNumToHan
} from "../../utils/index";
export default {
props: {
paperData: Object,
sort: Number,
sortTotal: Number,
isLast: Boolean,
startIndex: Number,
isOperate: Boolean
},
setup(props, context) {
let { ctx } = getCurrentInstance();
let {
ctx
} = getCurrentInstance();
let data = reactive({
data: props.paperData,
autoplay: false,
......@@ -83,6 +72,7 @@ export default {
sortTotal: props.sortTotal,
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
isOperate: props.isOperate
});
if (props.startIndex) {
data.current = props.startIndex;
......@@ -109,17 +99,17 @@ export default {
}
},
//点击
getAnswer(allItem, item , item1) {
getAnswer(allItem, item, item1) {
allItem.forEach((x) => {
x.IsAnswer = false;
});
item.IsAnswer = !item.IsAnswer;
context.emit("answerChange", data.data);
this.$forceUpdate();
item1.QuestionContentObj.forEach(x=>{
x.OptionList.forEach(y=>{
if(y.IsAnswer){
item1.IsRes=true;
item1.QuestionContentObj.forEach(x => {
x.OptionList.forEach(y => {
if (y.IsAnswer) {
item1.IsRes = true;
}
})
})
......@@ -136,10 +126,10 @@ export default {
...methods,
};
},
};
};
</script>
<style scoped>
.name {
.name {
height: 90rpx;
font-size: 28rpx;
font-family: PingFang SC;
......@@ -148,55 +138,78 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
}
.ExamIndex_Box{
margin-right:20px;
}
.Exam_Total {
}
.ExamIndex_Box {
margin-right: 20px;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
}
.myAnswer {
}
.isTrueAnswer {
color: green !important;
}
.isNotAnswer {
color: red !important;
}
.AnswerContent {
font-size: 30rpx;
padding: 25rpx;
background-color: #F4F4F4;
border-radius: 5px;
}
.viewAnswerContent {
width: 100%;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 5px;
}
.myAnswer {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.Single_Before {
}
.Single_Before {
font-size: 28rpx;
font-weight: bold;
color: #da7878;
}
}
.swiper-box {
.swiper-box {
height: calc(100vh - 270rpx);
box-sizing: border-box;
}
}
.num {
.num {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
}
.item {
.item {
margin-bottom: 40rpx;
}
}
.item1 {
.item1 {
align-items: center;
}
}
.item2 {
.item2 {
/* padding-left: 25rpx; */
margin: 30rpx 0;
}
}
.choose {
.choose {
background-color: #00acf9 !important;
color: #ffffff !important;
}
}
.chooseNum {
.chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center;
......@@ -208,32 +221,32 @@ export default {
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
}
.chooseName {
.chooseName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
}
.input {
.input {
box-sizing: border-box;
width: 690rpx;
border-bottom: 2rpx solid #000;
color: #000;
font-size: 22rpx;
}
}
.textarea {
.textarea {
box-sizing: border-box;
padding: 20rpx 0;
}
}
/deep/.textarea-placeholder {
/deep/.textarea-placeholder {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 500;
color: #cccccc;
}
}
</style>
......@@ -30,6 +30,7 @@
</view>
</view>
</template>
<template v-if="isOperate">
<template v-if="item1.QuestionContentObj[1]&&item1.QuestionContentObj[1].length>0">
<view v-for="(item3, index3) in item1.QuestionContentObj[1]" :key="index3">
<view class="flex item2 flex_start_center">
......@@ -42,6 +43,7 @@
<van-action-sheet :show="item3.isShow" @click-overlay="hideVan(item3)" :actions="getSelect(item1.QuestionContentObj[0])" @select="onSelect($event,item3,item1)"/>
</view>
</template>
</template>
</view>
</swiper-item>
<swiper-item v-if="sortIndex != sortTotal"></swiper-item>
......@@ -70,7 +72,8 @@
paperData: Object,
sort: Number,
sortTotal: Number,
isLast: Boolean
isLast: Boolean,
isOperate: Boolean
},
setup(props, context) {
let {ctx} = getCurrentInstance();
......@@ -87,6 +90,7 @@
sortTotal: props.sortTotal,
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
isOperate: props.isOperate
});
let methods = {
......@@ -165,6 +169,26 @@
align-items: center;
justify-content: space-between;
}
.isTrueAnswer {
color: green !important;
}
.isNotAnswer {
color: red !important;
}
.AnswerContent {
font-size: 30rpx;
padding: 25rpx;
background-color: #F4F4F4;
border-radius: 5px;
}
.viewAnswerContent {
width: 100%;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 5px;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
......
......@@ -28,6 +28,7 @@
</view>
</view>
</template>
<template v-if="isOperate">
<template v-if="item1.QuestionContentObj[1] && item1.QuestionContentObj[1].length > 0">
<view v-for="(item3, index3) in item1.QuestionContentObj[1]" :key="index3"
style="margin-bottom: 20px">
......@@ -39,6 +40,31 @@
@select="onSelect($event, item3, item1)" />
</view>
</template>
</template>
<template v-else>
<view class="AnswerContent">
<view>
<text style="color:#8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{item1.Answer}}</text>
<text>
您的答案:
<template v-if="item1.StundetAnswer!=''">
<text v-if="item1.Answer==item1.StundetAnswer" class="isTrueAnswer">
{{item1.StundetAnswer}}
</text>
<text v-else class="isNotAnswer">{{item1.StundetAnswer}},回答错误</text>
</template>
<template v-else>
<text>未作答</text>
</template>
</text>
</view>
<view style="margin-top:20rpx;word-wrap:break-word;">
<text style="color:#8c8a94">解析:</text>
<view style="color:#000;display:inline-block;" v-html="item1.AnswerParse"></view>
</view>
</view>
</template>
</view>
</swiper-item>
<swiper-item v-if="sortIndex != sortTotal"></swiper-item>
......@@ -69,6 +95,7 @@
sortTotal: Number,
isLast: Boolean,
startIndex: Number,
isOperate: Boolean
},
setup(props, context) {
let {
......@@ -88,6 +115,7 @@
sortTotal: props.sortTotal,
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
isOperate: props.isOperate
});
if (props.startIndex) {
data.current = props.startIndex;
......@@ -174,7 +202,26 @@
align-items: center;
justify-content: space-between;
}
.isTrueAnswer {
color: green !important;
}
.isNotAnswer {
color: red !important;
}
.AnswerContent {
font-size: 30rpx;
padding: 25rpx;
background-color: #F4F4F4;
border-radius: 5px;
}
.viewAnswerContent {
width: 100%;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 5px;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
......
......@@ -236,6 +236,7 @@
:isLast="isLast"
:sort="index"
:sortTotal="peaperDetail.Paper.GroupList.length"
:isOperate="isOperate"
@getAfterTopic="getAfterTopic()"
@getBeforeTopic="getBeforeTopic()"
@answerChange="getAnswerChange($event, index)"
......@@ -263,6 +264,7 @@
:isLast="isLast"
:sort="index"
:sortTotal="peaperDetail.Paper.GroupList.length"
:isOperate="isOperate"
@getAfterTopic="getAfterTopic()"
@getBeforeTopic="getBeforeTopic()"
@answerChange="getAnswerChange($event, index)"
......
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