Commit c010e298 authored by zhengke's avatar zhengke

修改

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