Commit c010e298 authored by zhengke's avatar zhengke

修改

parent 42962f8e
...@@ -14,15 +14,18 @@ ...@@ -14,15 +14,18 @@
</view> </view>
<swiper class="swiper-box" :autoplay="autoplay" :current="current" @change="onchange"> <swiper class="swiper-box" :autoplay="autoplay" :current="current" @change="onchange">
<swiper-item v-if="sortIndex != 1"></swiper-item> <swiper-item v-if="sortIndex != 1"></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="item1.id"> <swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1">
<view class="item1"> <view class="item1">
<view class="flex flex_start_center"> <view class="flex flex_start_center">
<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 class="chooseName"> <view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" style="border-bottom:1px solid #d1d1d1;">
<textarea type="text" v-model="item1.myAnswer" class="input textarea" placeholder="请填写答案" <view v-for="(item3,index3) in item2.OptionList" :key="index3" class="flex item2 flex_start_center" @click="getAnswer(item3)">
placeholder-style="textarea-placeholder" :maxlength="-1" /> <view class="chooseNum" :class="{'IsAnswer':item3.IsAnswer}">{{ item3.Name }}
</view>
<view class="chooseName" v-html="item3.Content"></view>
</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
...@@ -55,12 +58,7 @@ ...@@ -55,12 +58,7 @@
isLast: Boolean isLast: Boolean
}, },
setup(props, context) { setup(props, context) {
let { let {ctx} = getCurrentInstance();
ctx
} = getCurrentInstance();
props.paperData.DetailsList.forEach((item, index) => {
item.myAnswer = "";
});
let data = reactive({ let data = reactive({
data: props.paperData, data: props.paperData,
autoplay: false, autoplay: false,
...@@ -69,7 +67,6 @@ ...@@ -69,7 +67,6 @@
current: 1, //默认从第几个开始-用于从快捷菜单点入 current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题 ExamIndex: 1, //第几题
}); });
let methods = { let methods = {
changeNumToHan, changeNumToHan,
jumpPage() { jumpPage() {
...@@ -89,6 +86,10 @@ ...@@ -89,6 +86,10 @@
if (e.detail.current == 0) { if (e.detail.current == 0) {
this.$emit('getBeforeTopic'); this.$emit('getBeforeTopic');
} }
},
//点击
getAnswer(item){
console.log(item,'item');
} }
}; };
onMounted(() => { onMounted(() => {
...@@ -116,15 +117,21 @@ ...@@ -116,15 +117,21 @@
justify-content: space-between; justify-content: space-between;
} }
.myAnswer {
background-color: #00acf9 !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;
......
<template> <template>
<!-- 连线题 --> <!-- 填空题 -->
<view> <view>
<view class="item"> <view class="item" style="padding: 0 20px">
<view class="name" <view class="name">
>{{ changeNumToHan(data.GSortNum + 1) }}{{ data.GroupName }}</view <view> {{ changeNumToHan(sortIndex) }}{{ data.GroupName }} </view>
> <view>
<!-- <canvas <text class="Single_Before">{{ ExamIndex }}</text>/<text
class="canvas" class="Exam_Total">{{ data.DetailsList.length }}</text>
type="2d" </view>
canvas-id="firstCanvas" </view>
id="firstCanvas" <swiper class="swiper-box" :autoplay="autoplay" :current="current" @change="onchange">
></canvas> --> <swiper-item v-if="sortIndex != 1"></swiper-item>
<view <swiper-item v-for="(item1, index1) in data.DetailsList" :key="item1.id">
v-for="(item1, index1) in data.DetailsList" <view class="item1">
:key="item1.id" <view class="flex flex_start_center">
class="item1" <view>{{ index1 + 1 }}</view>
> <view class="num" v-html="item1.Title"></view>
<view class="flex flex_start_center"> </view>
<view>{{ index1 + 1 }}</view> <!-- <view v-for="(item2, index2) in item1.QuestionContentObj" :key="item2.id"
<view class="num" v-html="item1.Title"></view> class="flex item2 flex_start_center">
</view> <view class="chooseName" @click="change(index1, index2)">
<input type="text" v-model="item1.myAnswer" class="input" />
<view class="flex flex_wrap flex_between_center"> </view>
<view </view> -->
v-for="(item2, index2) in item1.QuestionContentObj" </view>
:key="index2" </swiper-item>
class="flex item2 flex_wrap flex_start_between" <swiper-item v-if="sortIndex != sortTotal"></swiper-item>
> </swiper>
<view </view>
v-for="(item3, index3) in item2" <van-toast id="van-toast" />
:key="index3" </view>
class="flex item3"
>
<view class="chooseNum">{{ item3.Name }} </view>
<view class="chooseName" v-html="item3.Content"></view>
</view>
</view>
</view>
</view>
</view>
<van-toast id="van-toast" />
</view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { changeNumToHan } from "../../utils/index"; import {
export default { changeNumToHan
props: { paperData: Object }, } from "../../utils/index";
setup(props, context) { export default {
// console.log(57, props.paperData); props: {
paperData: Object,
let data = reactive({ isLast: Boolean,
data: props.paperData, sort: Number,
}); sortTotal: Number,
let methods = { },
changeNumToHan, setup(props, context) {
jumpPage() { let {
uni.navigateTo({ ctx
url: "/pages/exam/examPaper", } = getCurrentInstance();
}); props.paperData.DetailsList.forEach((item, index) => {
}, item.myAnswer = "";
back() { });
uni.navigateBack(); let data = reactive({
}, data: props.paperData,
drawcanvas() { sortIndex: props.sort + 1,
let ctx = uni.createCanvasContext("firstCanvas"); sortTotal: props.sortTotal,
ctx.beginPath(); current: 1, //默认从第几个开始-用于从快捷菜单点入
ctx.moveTo(0, 0); ExamIndex: 1, //第几题
ctx.lineWidth = 2; });
ctx.strokeStyle = "red"; console.log(77, data.sortTotal, data.sortIndex);
ctx.lineTo(20, 0); let methods = {
ctx.lineTo(10, 10); changeNumToHan,
ctx.stroke(); jumpPage() {
console.log("tag", ctx); uni.navigateTo({
}, url: "/pages/exam/examPaper",
//选题 });
change(index1, index2) { },
data.data.DetailsList[index1].myAnswer = back() {
data.data.DetailsList[index1].QuestionContentObj[index2].Name; uni.navigateBack();
}, },
}; //选题
methods.drawcanvas(); change(index1, index2) {
return { data.data.DetailsList[index1].choose =
...toRefs(data), data.data.DetailsList[index1].QuestionContentObj[index2].Name;
...methods, },
}; 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> </script>
<style scoped> <style scoped>
.canvas { .name {
width: 100%; height: 90rpx;
height: 100rpx; font-size: 28rpx;
} font-family: PingFang SC;
.name { font-weight: 800;
font-size: 28rpx; color: #111111;
font-family: PingFang SC; display: flex;
font-weight: 800; align-items: center;
color: #111111; justify-content: space-between;
} }
.num {
font-size: 26rpx; .Single_Before {
font-family: PingFang SC; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #111111; color: #da7878;
} }
.item {
margin-bottom: 40rpx; .Exam_Total {
} font-size: 25rpx;
.item1 { color: gray;
margin: 25rpx 0; }
align-items: center;
} .swiper-box {
.item2 { height: calc(100vh - 270rpx);
box-sizing: border-box; box-sizing: border-box;
padding-left: 25rpx; }
margin: 30rpx 0;
width: 40%; .num {
height: 100%; font-size: 26rpx;
border-top: 1rpx solid #000; font-family: PingFang SC;
border-bottom: 1rpx solid #000; font-weight: bold;
} color: #111111;
.item3 { }
width: 100%;
box-sizing: border-box; .item {
margin: 30rpx 0; margin-bottom: 40rpx;
} }
.myAnswer {
background-color: #00acf9 !important; .item1 {
color: #ffffff !important; margin: 25rpx 0;
} align-items: center;
.chooseNum { }
width: 40rpx;
height: 40rpx; .item2 {
text-align: center; /* padding-left: 25rpx; */
line-height: 40rpx; margin: 30rpx 0;
border-radius: 50%; }
/* border: 1px solid #e2e2e2; */
margin-right: 30rpx; .choose {
font-size: 26rpx; background-color: #00acf9 !important;
font-family: PingFang SC; color: #ffffff !important;
font-weight: bold; }
color: #111111;
} .chooseNum {
.chooseName { width: 40rpx;
font-size: 24rpx; height: 40rpx;
font-family: PingFang SC; text-align: center;
font-weight: 500; line-height: 40rpx;
color: #111111; border-radius: 50%;
} border: 1px solid #e2e2e2;
</style> margin-right: 30rpx;
\ No newline at end of file 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>
...@@ -20,9 +20,11 @@ ...@@ -20,9 +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 class="chooseName"> <view v-for="(item2, index2) in item1.QuestionContentObj" :key="item2.id"
<textarea type="text" v-model="item1.myAnswer" class="input textarea" placeholder="请填写答案" class="flex item2 flex_start_center">
placeholder-style="textarea-placeholder" :maxlength="-1" /> <view class="chooseName">
<input type="text" v-model="item2.Content" class="input" />
</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +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 class="chooseName"> <view v-for="(item2, index2) in item1.QuestionContentObj" :key="item2.id"
<textarea type="text" v-model="item1.myAnswer" class="input textarea" placeholder="请填写答案" class="flex item2 flex_start_center">
placeholder-style="textarea-placeholder" :maxlength="-1" /> <view class="chooseName">
<input type="text" v-model="item2.Content" class="input" />
</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
...@@ -121,10 +123,12 @@ ...@@ -121,10 +123,12 @@
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;
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
" "
/> />
<!-- 连线题待完善 --> <!-- 连线题待完善 -->
<!-- <Connect <Connect
:paperData="item" :paperData="item"
:isLast="isLast" :isLast="isLast"
:sort="index" :sort="index"
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
@getAfterTopic="getAfterTopic()" @getAfterTopic="getAfterTopic()"
@getBeforeTopic="getBeforeTopic()" @getBeforeTopic="getBeforeTopic()"
v-if="item.QuestionTypeKey === 'matching' && index === changeIndex" v-if="item.QuestionTypeKey === 'matching' && index === changeIndex"
/> --> />
</view> </view>
</view> </view>
<van-toast id="van-toast" /> <van-toast id="van-toast" />
......
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