Commit 33416f68 authored by zhengke's avatar zhengke

修改

parent 53049eb2
<template>
<!-- 填空题 -->
<view>
<view class="item">
<view class="name"
>{{ changeNumToHan(data.GSortNum + 1) }}{{ data.GroupName }}</view
>
<view
v-for="(item1, index1) in data.DetailsList"
:key="item1.id"
class="item1"
>
<view class="flex flex_start_center">
<view>{{ index1 + 1 }}</view>
<view class="num" v-html="item1.Title"></view>
</view>
<view
v-for="(item2, index2) in item1.QuestionContentObj"
:key="item2.id"
class="flex item2 flex_start_center"
>
<view class="chooseName" @click="change(index1, index2)">
<input type="text" v-model="item1.myAnswer" class="input" />
</view>
</view>
</view>
</view>
<van-toast id="van-toast" />
</view>
<!-- 填空题 -->
<view>
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
</view>
<view>
<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-item></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="item1.id">
<view class="item1">
<view class="flex flex_start_center">
<view>{{ index1 + 1 }}</view>
<view class="num" v-html="item1.Title"></view>
</view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="item2.id"
class="flex item2 flex_start_center">
<view class="chooseName" @click="change(index1, index2)">
<input type="text" v-model="item1.myAnswer" class="input" />
</view>
</view>
</view>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
<van-toast id="van-toast" />
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import { changeNumToHan } from "../../utils/index";
export default {
props: { paperData: Object },
setup(props, context) {
let { ctx } = getCurrentInstance();
props.paperData.DetailsList.forEach((item, index) => {
item.myAnswer = "";
});
let data = reactive({
data: props.paperData,
});
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import {
changeNumToHan
} from "../../utils/index";
export default {
props: {
paperData: Object,
isLast: Boolean,
sort: Number
},
setup(props, context) {
let {ctx} = getCurrentInstance();
props.paperData.DetailsList.forEach((item, index) => {
item.myAnswer = "";
});
let data = reactive({
data: props.paperData,
sortIndex: props.sort+1,
Score: 0, //总分
current: 1 ,//默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
});
let methods = {
changeNumToHan,
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
back() {
uni.navigateBack();
},
//选题
change(index1, index2) {
data.data.DetailsList[index1].choose =
data.data.DetailsList[index1].QuestionContentObj[index2].Name;
},
};
return {
...toRefs(data),
...methods,
};
},
};
let methods = {
changeNumToHan,
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
back() {
uni.navigateBack();
},
//选题
change(index1, index2) {
data.data.DetailsList[index1].choose =
data.data.DetailsList[index1].QuestionContentObj[index2].Name;
},
onchange(e){
data.ExamIndex = e.detail.current;
if(data.ExamIndex===data.data.DetailsList.length+1){
console.log('进入')
this.$emit('getAfterTopic');
}
if(e.detail.current==0){
this.$emit('getBeforeTopic');
}
}
};
return {
...toRefs(data),
...methods,
};
},
};
</script>
<style scoped>
.name {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
.num {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.item {
margin-bottom: 40rpx;
}
.item1 {
margin: 25rpx 0;
align-items: center;
}
.item2 {
/* padding-left: 25rpx; */
margin: 30rpx 0;
}
.choose {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.input {
box-sizing: border-box;
width: 690rpx;
border-bottom: 2rpx solid #000;
}
</style>
\ No newline at end of file
.name {
height: 90rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
display: flex;
align-items: center;
justify-content: space-between;
}
.Single_Before {
font-size: 28rpx;
font-weight: bold;
color: #DA7878;
}
.swiper-box {
height: calc(100vh - 270rpx);
box-sizing: border-box;
}
.num {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.item {
margin-bottom: 40rpx;
}
.item1 {
margin: 25rpx 0;
align-items: center;
}
.item2 {
/* padding-left: 25rpx; */
margin: 30rpx 0;
}
.choose {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.input {
box-sizing: border-box;
width: 690rpx;
border-bottom: 2rpx solid #000;
}
</style>
......@@ -4,7 +4,7 @@
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(data.GSortNum + 1) }}{{ data.GroupName }}
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color:#999999;">(共{{data.DetailsList.length}}道,{{Score}}分)</text>
</view>
<view>
......@@ -56,7 +56,8 @@
} from "../../utils/index";
export default {
props: {
paperData: Object
paperData: Object,
sort: Number
},
setup(props, context) {
let {
......@@ -67,6 +68,7 @@
});
let data = reactive({
data: props.paperData,
sortIndex: props.sort+1,
autoplay: false,
Score: 0, //总分
current: 1, //默认从第几个开始-用于从快捷菜单点入
......
......@@ -4,7 +4,7 @@
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(data.GSortNum + 1) }}{{ data.GroupName }}
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color:#999999;">(共{{data.DetailsList.length}}道,{{Score}}分)</text>
</view>
<view>
......@@ -53,7 +53,8 @@
export default {
props: {
paperData: Object,
isLast: Boolean
isLast: Boolean,
sort:Number
},
setup(props, context) {
props.paperData.DetailsList.forEach((item, index) => {
......@@ -61,6 +62,7 @@
});
let data = reactive({
data: props.paperData,
sortIndex: props.sort+1,
autoplay: false,
Score: 0, //总分
current: 1, //默认从第几个开始-用于从快捷菜单点入
......@@ -97,7 +99,6 @@
onchange(e) {
data.ExamIndex = e.detail.current;
if (data.ExamIndex === data.data.DetailsList.length + 1) {
console.log('进入')
this.$emit('getAfterTopic');
}
if(e.detail.current==0){
......@@ -107,9 +108,9 @@
};
onMounted(() => {
that.getScore();
if(props.isLast){
data.current = props.paperData.DetailsList.length;
}
// if(props.isLast){
// data.current = props.paperData.DetailsList.length;
// }
});
let that = methods;
return {
......
......@@ -4,7 +4,7 @@
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(sort + 1) }}{{ data.GroupName }}
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color:#999999;">(共{{data.DetailsList.length}}道,{{Score}}分)</text>
</view>
<view>
......@@ -68,10 +68,10 @@ export default {
let data = reactive({
autoplay: false,
sortIndex: props.sort+1,
data: props.paperData,
Score: 0, //总分
current: 1 ,//默认从第几个开始-用于从快捷菜单点入
current: 35 ,//默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
});
......
......@@ -4,7 +4,7 @@
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(sort + 1) }}{{ data.GroupName }}
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color:#999999;">(共{{data.DetailsList.length}}道,{{Score}}分)</text>
</view>
<view>
......@@ -69,6 +69,7 @@ export default {
autoplay: false,
data: props.paperData,
sortIndex: props.sort+1,
Score: 0, //总分
current: 0 ,//默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
......@@ -105,10 +106,9 @@ export default {
};
onMounted(()=>{
that.getScore();
console.log(props.isLast,'props.isLast');
if(props.isLast){
data.current = props.paperData.DetailsList.length;
}
// if(props.isLast){
// data.current = props.paperData.DetailsList.length;
// }
})
let that = methods;
return {
......
<template>
<!-- 单选题 -->
<view>
<view class="item">
<view class="name">
<view>
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color:#999999;">(共{{data.DetailsList.length}}道,{{Score}}分)</text>
</view>
<view>
<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-item></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="item1.id">
<view class="item1">
<view class="flex flex_start_center">
<view>{{ index1 + 1 }}</view>
<view class="num readTitle" v-html="item1.Title"></view>
</view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="item2.id"
class="flex item2 flex_start_center">
<view class="chooseNum" :class="{ myAnswer: item1.myAnswer === item2.Name }"
@click="change(index1, index2)">{{ item2.Name }}
</view>
<view class="chooseName" @click="change(index1, index2)" v-html="item2.Content"></view>
</view>
</view>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
<van-toast id="van-toast" />
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import {
changeNumToHan
} from "../../utils/index";
export default {
props: {
paperData: Object,
sort: Number
},
setup(props, context) {
let {
ctx
} = getCurrentInstance();
let data = reactive({
autoplay: false,
sortIndex: props.sort + 1,
data: props.paperData,
Score: 0, //总分
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
});
let methods = {
changeNumToHan,
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
back() {
uni.navigateBack();
},
//选题
change(index1, index2) {
data.data.DetailsList[index1].myAnswer =
data.data.DetailsList[index1].QuestionContentObj[index2].Name;
},
//获取总分
getScore() {
data.Score = 0;
data.data.DetailsList.forEach(x => {
data.Score += parseFloat(x.Score);
})
},
onchange(e) {
data.ExamIndex = e.detail.current;
if (data.ExamIndex === data.data.DetailsList.length + 1) {
console.log('进入')
this.$emit('getAfterTopic');
}
if (e.detail.current == 0) {
this.$emit('getBeforeTopic');
}
}
};
onMounted(() => {
console.log(props.paperData, 'props.paperData');
that.getScore();
})
let that = methods;
return {
...toRefs(data),
...methods,
};
},
};
</script>
<style scoped>
.name {
height: 90rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
display: flex;
align-items: center;
justify-content: space-between;
}
.Single_Before {
font-size: 28rpx;
font-weight: bold;
color: #DA7878;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
}
.swiper-box {
height: calc(100vh - 270rpx);
box-sizing: border-box;
}
.num {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.readTitle img{
max-width:100%;
}
.item {
/* margin-bottom: 40rpx; */
position: relative;
}
.item1 {
/* margin: 25rpx 0; */
align-items: center;
}
.item2 {
padding-left: 25rpx;
margin: 30rpx 0;
}
.myAnswer {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
</style>
......@@ -25,36 +25,56 @@
</van-nav-bar>
<view class="exam-con">
<view v-for="(item, index) in peaperDetail.Paper.GroupList" :key="index">
<!-- 数字单选题 -->
<SingleChoiceNumber
:paperData="item"
@getAfterTopic="getAfterTopic()"
:sort="index"
:isLast="isLast"
v-if="item.QuestionTypeKey === 'single-number'&&index===changeIndex" />
<!-- 多选题 -->
<MultipleChoice
:paperData="item"
:isLast="isLast"
:sort="index"
@getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'multiple'&&index===changeIndex"
/>
<!-- 单选题 -->
<SingleChoice
:paperData="item"
:isLast="isLast"
:sort="index"
@getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'single'&&index===changeIndex"
/>
<!-- 听力题 -->
<ListenTopic :paperData="item"
:isLast="isLast"
:sort="index"
@getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'listening'&&index===changeIndex"
/>
<!-- 填空题 -->
<FillInTheBlanks
:paperData="item"
v-if="item.QuestionTypeKey === 'fill-in'"
:isLast="isLast"
:sort="index"
@getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'fill-in'&&index===changeIndex"
/>
<!-- 阅读理解 -->
<readingCompre
:paperData="item"
:isLast="isLast"
:sort="index"
@getBeforeTopic="getBeforeTopic()"
v-if="item.QuestionTypeKey === 'reading-comprehensio'&&index===changeIndex"
/>
<!-- <Judge :paperData="item" v-if="item.QuestionTypeKey === 'judge'" />
<Write
:paperData="item"
......@@ -97,8 +117,9 @@ import SingleChoiceNumber from "../../components/subject/SingleChoiceNumber.vue"
import SingleChoice from "../../components/subject/SingleChoice.vue"
import MultipleChoice from "../../components/subject/MultipleChoice.vue";
import ListenTopic from "../../components/subject/ListenTopic.vue"
import FillInTheBlanks from "../../components/subject/FillInTheBlanks";
import readingCompre from "../../components/subject/readingCompre";
import Judge from "../../components/subject/judge.vue";
import Write from "../../components/subject/write.vue";
import Connect from "../../components/subject/Connect.vue"; //"连线题"
......@@ -110,6 +131,7 @@ export default {
MultipleChoice,
ListenTopic,
FillInTheBlanks,
readingCompre,
Judge,
Write,
Connect,
......@@ -121,8 +143,8 @@ export default {
let data = reactive({
time: 2 * 60 * 60 * 1000,
statusBarHeight: 0,
msg: { GuestId: Gid, PaperId: 6, Id: 3 },
// msg: { GuestId: Gid, PaperId: 24, Id: 0 },
// msg: { GuestId: Gid, PaperId: 6, Id: 3 },
msg: { GuestId: Gid, PaperId: 23, Id: 22 },
peaperDetail: {},
changeIndex:0,
isLast:false, //用于判断是否从后往前翻
......
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