|
@@ -1,22 +1,43 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <uni-icons type="left" size="30"></uni-icons>
|
|
|
- <text>单元测试</text>
|
|
|
- <view><text>{{count}}</text>/<text>{{total}}</text></view>
|
|
|
+ <view>
|
|
|
+ <uni-icons type="left" size="30" @click=""></uni-icons>
|
|
|
+ <text>单元测试</text>
|
|
|
+ <view><text>{{count}}</text>/<text>{{total}}</text></view>
|
|
|
+ </view>
|
|
|
+ <w-swiper :list="list" :swiperHeight="300" :positionIndex="current">
|
|
|
+ <template v-slot:default="{item}">
|
|
|
+ <view class="body" v-if="item.mta_show">
|
|
|
+ <danxuan :question="item" v-if="item.type == '1'"></danxuan>
|
|
|
+ <panduan :question="item" v-if="item.type == '2'"></panduan>
|
|
|
+ <tiankong :question="item" v-if="item.type == '3'"></tiankong>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </w-swiper>
|
|
|
+ <button class="transition-button" v-if="isLast" type="primary"
|
|
|
+ @click="handleSubmit(uniPointsRef)">submit</button>
|
|
|
+
|
|
|
+ <!-- 答卷 -->
|
|
|
+ <chengji ref="chengjiRef" :list="list" :jieId="jieId" :zhangId="zhangId" :nextZhangId="nextZhangId"
|
|
|
+ :nianji="nianji"></chengji>
|
|
|
+
|
|
|
+ <!-- 分数弹窗 -->
|
|
|
+ <uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue"></uniPointsVue>
|
|
|
</view>
|
|
|
- <swiper class="swiper-box" @change="onChange" @animationfinish="onAnimationfinish" :current="current">
|
|
|
- <swiper-item v-for="(item ,index) in list" :key="index">
|
|
|
- <view class="swiper-item">
|
|
|
- {{item}}
|
|
|
- </view>
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
- <button class="transition-button" v-if="!isLast" type="primary" @click="nextQuestion">next</button>
|
|
|
- <button class="transition-button" v-if="!isFirst" type="primary" @click="prevQuestion">prev</button>
|
|
|
- <button class="transition-button" v-if="isLast" type="primary" @click="handleSubmit">submit</button>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+ import questionJiexi from '@/components/questionJiexi/questionJiexi.vue';
|
|
|
+ import wSwiper from '@/components/wSwiper/wSwiper.vue';
|
|
|
+ import danxuan from "@/components/question/danxuan.vue";
|
|
|
+ import panduan from "@/components/question/panduan.vue";
|
|
|
+ import tiankong from "@/components/question/tiankong.vue";
|
|
|
+ import chengji from "@/components/chengji/chengji.vue";
|
|
|
+ import uniPointsVue from '@/components/points/uni-points.vue';
|
|
|
+ import {
|
|
|
+ useStudyRouteParams
|
|
|
+ } from "@/utils/emitEvents.js"
|
|
|
import {
|
|
|
useExam
|
|
|
} from './useUnit';
|
|
@@ -25,6 +46,8 @@
|
|
|
onMounted
|
|
|
} from "vue";
|
|
|
|
|
|
+ const {setStudyStorage} = useStudyRouteParams();
|
|
|
+
|
|
|
const {
|
|
|
isFirst,
|
|
|
isLast,
|
|
@@ -35,21 +58,41 @@
|
|
|
rightAnswer,
|
|
|
wrongAnswer,
|
|
|
jifen,
|
|
|
+ zhangId,
|
|
|
+ jieId,
|
|
|
+ nextZhangId,
|
|
|
+ nianji,
|
|
|
|
|
|
nextQuestion,
|
|
|
prevQuestion,
|
|
|
handleSubmit,
|
|
|
initPage
|
|
|
} = useExam();
|
|
|
-
|
|
|
- // swiper change 回调
|
|
|
- function onChange(e) {
|
|
|
- current.value = e.detail.current;
|
|
|
+
|
|
|
+ const uniPointsRef = ref(null);
|
|
|
+ const chengjiRef = ref(null);
|
|
|
+
|
|
|
+ function sendDataToStudyPage() {
|
|
|
+ // 设置 从单元测试 到 岛 的路由参数
|
|
|
+ setStudyStorage({
|
|
|
+ zhangId: zhangId.value,
|
|
|
+ nianji: nianji.value,
|
|
|
+ jieId: jieId.value,
|
|
|
+ nextZhangId: nextZhangId.value
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
// 查看答案
|
|
|
- function checkAnswer() {}
|
|
|
+ function checkAnswer() {
|
|
|
+ chengjiRef.value.showPopup();
|
|
|
+ }
|
|
|
// 继续学习
|
|
|
- function goStudyContinue() {}
|
|
|
+ function goStudyContinue() {
|
|
|
+ sendDataToStudyPage();
|
|
|
+ uni.switchTab({
|
|
|
+ url: `/pages/study/index?zhangId`
|
|
|
+ })
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|