Commit d6300413 authored by 罗超's avatar 罗超

1

parent 0794ce24
<template> <template>
<!-- 单选题 --> <!-- 阅读理解 -->
<view> <view>
<view class="item"> <view class="item">
<view class="name"> <view class="name">
...@@ -27,24 +27,45 @@ ...@@ -27,24 +27,45 @@
> >
<view class="item1"> <view class="item1">
<view class="flex flex_start_center"> <view class="flex flex_start_center">
<view class="num readTitle" v-html="item1.Title"></view> <view
class="num readTitle"
:style="{ paddingBottom: `${questionH}rpx` }"
v-html="item1.Title"
></view>
</view> </view>
<view <view
v-for="(item2, index2) in item1.QuestionContentObj" class="questionBox"
:key="item2.id" :style="{ height: `${questionH}rpx` }"
class="flex item2 flex_start_center" @touchstart="touchstart"
@touchmove="touchmove"
@touchend="touchend"
> >
<view class="questionTotal">本阅读理解共5小题</view>
<view <view
class="chooseNum" v-for="(item2, index2) in item1.QuestionContentObj"
:class="{ myAnswer: item1.myAnswer === item2.Name }" :key="index2"
@click="change(index1, index2)" class="item2"
>{{ item2.Name }} >
<view class="flex questionTitle">
<view>{{ index2 + 1 }}</view>
<view v-html="item2.SubTitle"></view>
</view>
<view v-for="(item3, index3) in item2.SubAnwser" :key="index3">
<view class="flex flex_start_center item3">
<view
class="chooseNum"
:class="{ myAnswer: item2.myAnswer === item3.Name }"
@click="change(index1, index2, index3)"
>{{ item3.Name }}
</view>
<view
class="chooseName"
@click="change(index1, index2, index3)"
v-html="item3.Content"
></view>
</view>
</view>
</view> </view>
<view
class="chooseName"
@click="change(index1, index2)"
v-html="item2.Content"
></view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
...@@ -81,11 +102,13 @@ export default { ...@@ -81,11 +102,13 @@ export default {
Score: 0, //总分 Score: 0, //总分
current: 1, //默认从第几个开始-用于从快捷菜单点入 current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题 ExamIndex: 1, //第几题
questionH: 800, //问题区域高度
timer: null,
timeOutEvent: false,
}); });
data.data.DetailsList.forEach((item) => { data.data.DetailsList.forEach((item) => {
item.Title = item.Title.replace(/\<img/gi, '<img style="max-width:100%"'); item.Title = item.Title.replace(/\<img/gi, '<img style="max-width:100%"');
}); });
let methods = { let methods = {
changeNumToHan, changeNumToHan,
jumpPage() { jumpPage() {
...@@ -97,9 +120,11 @@ export default { ...@@ -97,9 +120,11 @@ export default {
uni.navigateBack(); uni.navigateBack();
}, },
//选题 //选题
change(index1, index2) { change(index1, index2, index3) {
data.data.DetailsList[index1].myAnswer = data.data.DetailsList[index1].QuestionContentObj[index2].myAnswer =
data.data.DetailsList[index1].QuestionContentObj[index2].Name; data.data.DetailsList[index1].QuestionContentObj[index2].SubAnwser[
index3
].Name;
}, },
onchange(e) { onchange(e) {
data.ExamIndex = e.detail.current; data.ExamIndex = e.detail.current;
...@@ -111,6 +136,27 @@ export default { ...@@ -111,6 +136,27 @@ export default {
this.$emit("getBeforeTopic"); this.$emit("getBeforeTopic");
} }
}, },
//触摸事件
touchstart(e) {
console.log(133, e);
clearTimeout(data.timer);
data.timer = setTimeout(() => {
data.timeOutEvent = true;
}, 500);
},
touchmove(e) {
if (data.timeOutEvent) {
console.log("151", "长按了");
let touches = e.touches[0];
// let startTx = touches.clientX;
let startTy = touches.clientY;
console.log(134, startTy);
}
},
touchend() {
data.timeOutEvent = false;
clearTimeout(data.timer);
},
}; };
onMounted(() => { onMounted(() => {
console.log(props.paperData, "props.paperData"); console.log(props.paperData, "props.paperData");
...@@ -124,6 +170,10 @@ export default { ...@@ -124,6 +170,10 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.item {
/* margin-bottom: 40rpx; */
position: relative;
}
.name { .name {
height: 90rpx; height: 90rpx;
font-size: 28rpx; font-size: 28rpx;
...@@ -133,6 +183,8 @@ export default { ...@@ -133,6 +183,8 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx;
} }
.Single_Before { .Single_Before {
...@@ -157,23 +209,50 @@ export default { ...@@ -157,23 +209,50 @@ export default {
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
box-sizing: border-box;
} }
.readTitle img { .readTitle img {
max-width: 100%; max-width: 100%;
} }
.item {
/* margin-bottom: 40rpx; */
position: relative;
}
.item1 { .item1 {
height: 100%;
/* margin: 25rpx 0; */ /* margin: 25rpx 0; */
align-items: center; align-items: center;
overflow-y: auto;
box-sizing: border-box;
padding: 0 30rpx;
}
.questionBox {
width: 100%;
min-height: 500rpx !important;
max-height: 800rpx !important;
background-color: #eee;
position: absolute;
left: 0rpx;
bottom: env(safe-area-inset-bottom);
z-index: 9;
color: #000000;
overflow-y: auto;
}
.questionTotal {
text-align: center;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: bold;
color: #888888;
margin: 20rpx 0;
}
.questionTitle {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
} }
.item2 { .item2 {
padding-left: 25rpx; box-sizing: border-box;
margin: 30rpx 0; margin: 30rpx 0;
padding: 0 30rpx;
} }
.myAnswer { .myAnswer {
...@@ -181,6 +260,10 @@ export default { ...@@ -181,6 +260,10 @@ export default {
color: #ffffff !important; color: #ffffff !important;
} }
.item3 {
padding-left: 25rpx;
margin: 20rpx 0;
}
.chooseNum { .chooseNum {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
......
...@@ -25,57 +25,64 @@ ...@@ -25,57 +25,64 @@
</van-nav-bar> </van-nav-bar>
<view class="exam-con"> <view class="exam-con">
<view v-for="(item, index) in peaperDetail.Paper.GroupList" :key="index"> <view v-for="(item, index) in peaperDetail.Paper.GroupList" :key="index">
<!-- 数字单选题 --> <!-- 数字单选题 -->
<SingleChoiceNumber <SingleChoiceNumber
:paperData="item" :paperData="item"
@getAfterTopic="getAfterTopic()" @getAfterTopic="getAfterTopic()"
:sort="index" :sort="index"
:isLast="isLast" :isLast="isLast"
v-if="item.QuestionTypeKey === 'single-number'&&index===changeIndex" /> v-if="
<!-- 多选题 --> item.QuestionTypeKey === 'single-number' && index === changeIndex
"
/>
<!-- 多选题 -->
<MultipleChoice <MultipleChoice
:paperData="item" :paperData="item"
:isLast="isLast" :isLast="isLast"
:sort="index" :sort="index"
@getBeforeTopic="getBeforeTopic()" @getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()" @getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'multiple'&&index===changeIndex" 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"
/> />
<!-- 单选题 --> <!-- 填空题 -->
<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 <FillInTheBlanks
:paperData="item" :paperData="item"
:isLast="isLast" :isLast="isLast"
:sort="index" :sort="index"
@getBeforeTopic="getBeforeTopic()" @getBeforeTopic="getBeforeTopic()"
@getAfterTopic="getAfterTopic()" @getAfterTopic="getAfterTopic()"
v-if="item.QuestionTypeKey === 'fill-in'&&index===changeIndex" v-if="item.QuestionTypeKey === 'fill-in' && index === changeIndex"
/> />
<!-- 阅读理解 --> <!-- 阅读理解 -->
<readingCompre <readingCompre
:paperData="item" :paperData="item"
:isLast="isLast" :isLast="isLast"
:sort="index" :sort="index"
@getBeforeTopic="getBeforeTopic()" @getBeforeTopic="getBeforeTopic()"
v-if="item.QuestionTypeKey === 'reading-comprehensio'&&index===changeIndex" v-if="
/> item.QuestionTypeKey === 'reading-comprehensio' &&
<!-- <Judge :paperData="item" v-if="item.QuestionTypeKey === 'judge'" /> index === changeIndex
"
/>
<!-- <Judge :paperData="item" v-if="item.QuestionTypeKey === 'judge'" />
<Write <Write
:paperData="item" :paperData="item"
v-if=" v-if="
...@@ -114,9 +121,9 @@ import { ...@@ -114,9 +121,9 @@ import {
import { getSystemInfo } from "../../utils/index"; import { getSystemInfo } from "../../utils/index";
import { getPaperDetail } from "../../api/exam"; import { getPaperDetail } from "../../api/exam";
import SingleChoiceNumber from "../../components/subject/SingleChoiceNumber.vue"; import SingleChoiceNumber from "../../components/subject/SingleChoiceNumber.vue";
import SingleChoice from "../../components/subject/SingleChoice.vue" import SingleChoice from "../../components/subject/SingleChoice.vue";
import MultipleChoice from "../../components/subject/MultipleChoice.vue"; import MultipleChoice from "../../components/subject/MultipleChoice.vue";
import ListenTopic from "../../components/subject/ListenTopic.vue" import ListenTopic from "../../components/subject/ListenTopic.vue";
import FillInTheBlanks from "../../components/subject/FillInTheBlanks"; import FillInTheBlanks from "../../components/subject/FillInTheBlanks";
import readingCompre from "../../components/subject/readingCompre"; import readingCompre from "../../components/subject/readingCompre";
...@@ -127,11 +134,11 @@ import Sort from "../../components/subject/Sort"; //"排序题" ...@@ -127,11 +134,11 @@ import Sort from "../../components/subject/Sort"; //"排序题"
export default { export default {
components: { components: {
SingleChoiceNumber, SingleChoiceNumber,
SingleChoice, SingleChoice,
MultipleChoice, MultipleChoice,
ListenTopic, ListenTopic,
FillInTheBlanks, FillInTheBlanks,
readingCompre, readingCompre,
Judge, Judge,
Write, Write,
Connect, Connect,
...@@ -144,10 +151,11 @@ export default { ...@@ -144,10 +151,11 @@ export default {
time: 2 * 60 * 60 * 1000, time: 2 * 60 * 60 * 1000,
statusBarHeight: 0, statusBarHeight: 0,
// msg: { GuestId: Gid, PaperId: 6, Id: 3 }, // msg: { GuestId: Gid, PaperId: 6, Id: 3 },
msg: { GuestId: Gid, PaperId: 23, Id: 22 }, msg: { GuestId: Gid, PaperId: 25, Id: 6 },
// msg: { GuestId: Gid, PaperId: 5, Id: 0 },
peaperDetail: {}, peaperDetail: {},
changeIndex:0, changeIndex: 0,
isLast:false, //用于判断是否从后往前翻 isLast: false, //用于判断是否从后往前翻
}); });
let methods = { let methods = {
jumpPage() { jumpPage() {
...@@ -168,15 +176,15 @@ export default { ...@@ -168,15 +176,15 @@ export default {
console.log(90, res.Data.Paper.GroupList); console.log(90, res.Data.Paper.GroupList);
} }
}, },
//往后翻 //往后翻
getAfterTopic(){ getAfterTopic() {
this.changeIndex++ this.changeIndex++;
}, },
//往前翻 //往前翻
getBeforeTopic(){ getBeforeTopic() {
this.changeIndex--; this.changeIndex--;
this.isLast=true; this.isLast = true;
} },
}; };
onMounted(() => { onMounted(() => {
getSystemInfo((res) => { getSystemInfo((res) => {
...@@ -197,6 +205,6 @@ export default { ...@@ -197,6 +205,6 @@ export default {
<style scoped> <style scoped>
.exam-con { .exam-con {
box-sizing: border-box; box-sizing: border-box;
padding: 0 30rpx 30rpx; /* padding: 0 30rpx 30rpx; */
} }
</style> </style>
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