Commit 569074e8 authored by zhengke's avatar zhengke

1

parents dad45ce4 93166c73
......@@ -3,7 +3,7 @@
<view>
<view class="item" style="padding: 0 20px">
<view class="name">
<view>
<view class="grow">
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color: #999999"
>(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text
......@@ -13,6 +13,10 @@
<text class="Single_Before">{{ ExamIndex }}</text
>/<text class="Exam_Total">{{ data.DetailsList.length }}</text>
</view>
<i
class="iconfont icon-caidanzu answerSheet"
@click="jumpAnswerSheet"
></i>
</view>
<swiper
class="swiper-box"
......@@ -120,6 +124,11 @@ export default {
this.$emit("getBeforeTopic");
}
},
jumpAnswerSheet() {
uni.navigateTo({
url: "/pages/exam/answerSheet",
});
},
};
onMounted(() => {
if (props.isLast) {
......@@ -157,6 +166,12 @@ export default {
color: gray;
}
.answerSheet {
font-size: 30rpx;
margin-left: 20rpx;
color: #000;
}
.swiper-box {
height: calc(100vh - 270rpx);
box-sizing: border-box;
......
<template>
<view class="answer-sheets">
<view v-for="(item, index) in questionList" :key="index" class="item">
<view class="name">{{ item.name }}</view>
<view
v-for="(item1, index1) in item.children"
:key="item1.id"
class="flex item1"
<view class="name">
{{ changeNumToHan(index + 1) }}{{ item.GroupName }}</view
>
<view class="num">{{ item1.num }}</view>
<view class="flex flex_wrap">
<view
v-for="(item2, index2) in item1.children"
:key="item2.id"
class="item2"
:class="{ choose: item1.choose === item2 }"
@click="change(item.type, index, index1, index2)"
v-if="item.type === 1"
v-for="(item1, index1) in item.DetailsList"
:key="index1"
class="flex item1"
>
{{ item2 }}
</view>
<view
v-for="(item2, index2) in item1.children"
:key="item2.id"
class="item2"
:class="{ choose: item1.choose.find((e) => e == item2) }"
@click="change(item.type, index, index1, index2)"
v-if="item.type === 2"
>
{{ item2 }}
{{ index1 + 1 }}
</view>
</view>
</view>
......@@ -45,74 +29,29 @@ import {
computed,
onMounted,
} from "vue";
import { getPaperDetail } from "../../api/exam";
import { changeNumToHan } from "../../utils/index";
export default {
setup() {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({
questionList: [
{
name: "一、单选题",
type: 1,
children: [
{
num: 1,
choose: 1,
children: [1, 2, 3, 4, 5],
},
{
num: 2,
choose: 0,
children: [1, 2, 3, 4, 5],
},
{
num: 3,
choose: 0,
children: [1, 2, 3, 4, 5],
},
],
},
{
name: "二、多选题",
type: 2,
children: [
{
num: 1,
choose: [1, 2],
children: [1, 2, 3, 4, 5],
},
{
num: 2,
choose: [],
children: [1, 2, 3, 4, 5],
},
{
num: 3,
choose: [],
children: [1, 2, 3, 4, 5],
},
],
},
],
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: [],
});
let methods = {
changeNumToHan,
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
//选题
change(type, index, index1, index2) {
if (type === 1) {
data.questionList[index].children[index1].choose =
data.questionList[index].children[index1].children[index2];
} else if (type === 2) {
let choose = data.questionList[index].children[index1].choose;
let res = data.questionList[index].children[index1].children[index2];
let find = choose.indexOf(res);
if (find == -1) {
choose.push(res);
} else {
choose.splice(find, 1);
}
change(type, index, index1, index2) {},
async getPaperDetail() {
let res = await getPaperDetail(data.msg);
if (res) {
data.questionList = res.Data.Paper.GroupList;
console.log(90, res.Data.Paper.GroupList);
}
},
};
......@@ -125,6 +64,7 @@ export default {
uni.setNavigationBarTitle({
title: "答题卡",
});
this.getPaperDetail();
},
};
</script>
......@@ -149,8 +89,17 @@ export default {
margin-bottom: 40rpx;
}
.item1 {
margin: 25rpx 0;
align-items: center;
width: 44rpx;
height: 44rpx;
background-color: #00acf9;
border-radius: 50%;
margin: 22rpx;
text-align: center;
line-height: 44rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.item2 {
width: 44rpx;
......
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