Commit 84d9d98c authored by 罗超's avatar 罗超

1

parent 43ab0259
<template> <template>
<!-- 单选题 数字--> <!-- 单选题 -->
<view> <view>
<view class="item"> <view class="item" style="padding: 0 20px">
<view class="name"> <view class="name">
<view> <view>
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }} {{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
:autoplay="autoplay" :autoplay="autoplay"
:current="current" :current="current"
@change="onchange" @change="onchange"
:skip-hidden-item-layout="true"
> >
<swiper-item v-if="sortIndex != 1"></swiper-item> <swiper-item>
<swiper-item <!-- 第一页 -->
v-for="(item1, index1) in data.DetailsList" </swiper-item>
: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 class="num" v-html="item1.Title"></view> <view class="num" v-html="item1.Title"></view>
...@@ -32,24 +32,26 @@ ...@@ -32,24 +32,26 @@
<view <view
v-for="(item2, index2) in item1.QuestionContentObj" v-for="(item2, index2) in item1.QuestionContentObj"
:key="item2.id" :key="index2"
class="flex item2 flex_start_center" class="flex item2 flex_start_center"
> >
<view <view
class="chooseNum" class="chooseNum"
:class="{ myAnswer: item1.myAnswer === item2.Name }" :class="{ myAnswer: item2.IsAnswer }"
@click="change(index1, index2)" @click="change(item1, item2)"
>{{ item2.Name }} >{{ item2.ShowName }}
</view> </view>
<view <view
class="chooseName" class="chooseName"
@click="change(index1, index2)" @click="change(item1, item2)"
v-html="item2.Content" v-html="item2.Content"
></view> ></view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item v-if="sortIndex != sortTotal"></swiper-item> <swiper-item v-if="sortIndex != sortTotal">
<!-- 最后一页 -->
</swiper-item>
</swiper> </swiper>
</view> </view>
<van-toast id="van-toast" /> <van-toast id="van-toast" />
...@@ -77,16 +79,15 @@ export default { ...@@ -77,16 +79,15 @@ export default {
}, },
setup(props, context) { setup(props, context) {
let { ctx } = getCurrentInstance(); let { ctx } = getCurrentInstance();
let data = reactive({ let data = reactive({
autoplay: false, autoplay: false,
data: props.paperData,
sortIndex: props.sort + 1, //大题序号 sortIndex: props.sort + 1, //大题序号
sortTotal: props.sortTotal, //总共多少道大题 sortTotal: props.sortTotal, //总共多少道大题
current: 0, //默认从第几个开始-用于从快捷菜单点入 data: props.paperData,
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题 ExamIndex: 1, //第几题
}); });
console.log(77, data.sortIndex != 1, data.sortIndex != data.sortTotal);
let methods = { let methods = {
changeNumToHan, changeNumToHan,
jumpPage() { jumpPage() {
...@@ -98,20 +99,31 @@ export default { ...@@ -98,20 +99,31 @@ export default {
uni.navigateBack(); uni.navigateBack();
}, },
//选题 //选题
change(index1, index2) { change(item1, item2) {
data.data.DetailsList[index1].myAnswer = item1.QuestionContentObj.map((e) => {
data.data.DetailsList[index1].QuestionContentObj[index2].Name; if (e.Name == item2.Name) {
e.IsAnswer = true;
} else {
e.IsAnswer = false;
}
});
}, },
onchange(e) { onchange(e) {
data.ExamIndex = e.detail.current + 1; if (data.sortIndex == 1) {
data.ExamIndex = e.detail.current;
}
if (data.ExamIndex === data.data.DetailsList.length + 1) { if (data.ExamIndex === data.data.DetailsList.length + 1) {
console.log("单选", e.detail);
this.$emit("getAfterTopic"); this.$emit("getAfterTopic");
} }
if (e.detail.current == 0 && data.sortIndex != 1) {
this.$emit("getBeforeTopic");
}
}, },
}; };
onMounted(() => { onMounted(() => {
if (props.isLast) { if (props.isLast) {
data.current = data.data.DetailsList.length - 1; data.current = props.paperData.DetailsList.length;
} }
}); });
let that = methods; let that = methods;
...@@ -146,11 +158,8 @@ export default { ...@@ -146,11 +158,8 @@ export default {
} }
.swiper-box { .swiper-box {
/* height: calc(100vh - 250rpx - constant(safe-area-inset-top, 40rpx)); */
height: calc(100vh - 270rpx); height: calc(100vh - 270rpx);
box-sizing: border-box; box-sizing: border-box;
/* padding-bottom: env(safe-area-inset-top, 40rpx); */
/* background-color: #f00; */
} }
.num { .num {
......
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2734547 */ font-family: "iconfont"; /* Project id 2734547 */
src: url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.woff2?t=1628578983453') format('woff2'), src: url('//at.alicdn.com/t/font_2734547_dxj3l449tva.woff2?t=1631176297771') format('woff2'),
url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.woff?t=1628578983453') format('woff'), url('//at.alicdn.com/t/font_2734547_dxj3l449tva.woff?t=1631176297771') format('woff'),
url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.ttf?t=1628578983453') format('truetype'); url('//at.alicdn.com/t/font_2734547_dxj3l449tva.ttf?t=1631176297771') format('truetype');
} }
.iconfont { .iconfont {
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-caidanzu:before {
content: "\e647";
}
.icon-Text1:before { .icon-Text1:before {
content: "\e71c"; content: "\e71c";
} }
......
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