Commit 30a32cb2 authored by zhengke's avatar zhengke

修改

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