|
@@ -0,0 +1,1066 @@
|
|
|
+<template>
|
|
|
+ <view class="threeExam">
|
|
|
+ <!-- <view class="topad">
|
|
|
+ <ad class="wxad" :ad-intervals="100" unit-id="adunit-f9ac1a546be5b3f0"></ad>
|
|
|
+ </view> -->
|
|
|
+ <view class="problem">
|
|
|
+ <!-- <text class="problem-type"> 判断题 </text> -->
|
|
|
+ <!-- <text class="problem-issue"
|
|
|
+ >{{ problemListIndex + 1 }}、{{
|
|
|
+ problemList[problemListIndex].question
|
|
|
+ }}</text
|
|
|
+ > -->
|
|
|
+ <rich-text style="font-size: 42rpx; vertical-align: top" :nodes="createProblemTypeHtml(problemList[problemListIndex].questionType) +
|
|
|
+ (problemListIndex + 1) +
|
|
|
+ '、' +
|
|
|
+ problemList[problemListIndex].issue
|
|
|
+ "></rich-text>
|
|
|
+ <!-- <span class="problem-type">{{
|
|
|
+ problemList[problemListIndex].questionType | questionType
|
|
|
+ }}</span>
|
|
|
+ <span style="font-size: 30rpx;">
|
|
|
+ {{ problemListIndex+1 }} {{ problemList[problemListIndex].issue }}
|
|
|
+ </span> -->
|
|
|
+ <view class="problem-media">
|
|
|
+ <image mode="widthFix" v-if="getFileType(problemList[problemListIndex].image) == 'image'"
|
|
|
+ :src="problemList[problemListIndex].image"></image>
|
|
|
+ <video :controls="false" autoplay loop v-if="getFileType(problemList[problemListIndex].image) == 'video'"
|
|
|
+ :src="problemList[problemListIndex].image"></video>
|
|
|
+ </view>
|
|
|
+ <view class="problem-radio">
|
|
|
+ <van-radio-group v-if="!problemList[problemListIndex].isComplete" @change="changeUserAnswer"
|
|
|
+ :value="problemList[problemListIndex].userAnswer">
|
|
|
+ <view :key="index" v-for="(item, index) in problemList[problemListIndex].optsArr">
|
|
|
+ <van-radio label-class="pl0" custom-class="mt40" use-icon-slot :name="item">
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(index)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text style="
|
|
|
+ font-size: 42rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-left: 20rpx;
|
|
|
+ ">{{ item }}</text>
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an2"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an2"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(1)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an2 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an3"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an3"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(2)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an3 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an4"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an4"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(3)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an4 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an5"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an5"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(4)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an5 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an6"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an6"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(5)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an6 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ <van-radio
|
|
|
+ v-if="problemList[problemListIndex].an7"
|
|
|
+ label-class="pl0"
|
|
|
+ custom-class="mt40"
|
|
|
+ use-icon-slot
|
|
|
+ :name="problemList[problemListIndex].an7"
|
|
|
+ >
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <view class="problem-radio-letter">{{
|
|
|
+ numberToLetter(6)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text
|
|
|
+ style="font-size: 42rpx; font-weight: bold; margin-left: 20rpx"
|
|
|
+ >{{ problemList[problemListIndex].an7 }}</text
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </van-radio> -->
|
|
|
+ </van-radio-group>
|
|
|
+ <van-radio-group v-if="problemList[problemListIndex].isComplete"
|
|
|
+ :value="problemList[problemListIndex].userAnswer">
|
|
|
+ <view :key="index" v-for="(item, index) in problemList[problemListIndex].optsArr">
|
|
|
+ <van-radio label-class="pl0" custom-class="mt40" use-icon-slot :name="item">
|
|
|
+ <view class="problem-radio-flex">
|
|
|
+ <view class="problem-radio-icon">
|
|
|
+ <icon type="clear" v-if="item ==
|
|
|
+ problemList[problemListIndex].userAnswer &&
|
|
|
+ problemList[problemListIndex].userAnswer !=
|
|
|
+ problemList[problemListIndex].answer
|
|
|
+ " class="problem-radio-letter" color="red" size="60rpx"></icon>
|
|
|
+ <icon type="success" v-else-if="item ==
|
|
|
+ problemList[problemListIndex].userAnswer &&
|
|
|
+ problemList[problemListIndex].userAnswer ==
|
|
|
+ problemList[problemListIndex].answer
|
|
|
+ " class="problem-radio-letter" color="#33CDA4" size="60rpx"></icon>
|
|
|
+ <view v-else class="problem-radio-letter">{{
|
|
|
+ numberToLetter(index)
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ <text style="
|
|
|
+ font-size: 42rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-left: 20rpx;
|
|
|
+ ">{{ item }}</text>
|
|
|
+ </view>
|
|
|
+ </van-radio>
|
|
|
+ </view>
|
|
|
+ </van-radio-group>
|
|
|
+ </view>
|
|
|
+ <!-- <view v-if="query.showSubmit == '0'" @click="collectTopics" class="problem-collect">
|
|
|
+ <van-icon
|
|
|
+ v-if="!problemList[problemListIndex].isCollect"
|
|
|
+ name="star-o"
|
|
|
+ size="25px"
|
|
|
+ />
|
|
|
+ <van-icon
|
|
|
+ color="#ffde00ff"
|
|
|
+ v-if="problemList[problemListIndex].isCollect"
|
|
|
+ name="star"
|
|
|
+ size="25px"
|
|
|
+ />
|
|
|
+ <view>收藏</view>
|
|
|
+ </view> -->
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <view class="switch">
|
|
|
+ <view @click="prePage" class="pre"> 上一题</view>
|
|
|
+ <view @click="nextPage" class="next"> 下一题</view>
|
|
|
+ </view>
|
|
|
+ <view class="submit">
|
|
|
+ <view>
|
|
|
+ <view v-if="query.showSubmit == '1'" @click="() => {
|
|
|
+ submitExamVisible = true;
|
|
|
+ }
|
|
|
+ " class="submit-button"><text>交卷</text>
|
|
|
+ <countDown @change="getThreeExamTime" @end="submitExam" background="" :time="examTime"></countDown>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="count">
|
|
|
+ <view class="col">
|
|
|
+ <icon type="success" size="26rpx" color="#33CDA4"></icon>
|
|
|
+ <text style="font-size: 24rpx; color: #8a9099; margin-left: 8rpx">{{
|
|
|
+ trueNum
|
|
|
+ }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="col">
|
|
|
+ <icon type="clear" size="26rpx" color="#FF4D53"></icon>
|
|
|
+ <text style="font-size: 24rpx; color: #8a9099; margin-left: 8rpx">{{
|
|
|
+ falseNum
|
|
|
+ }}</text>
|
|
|
+ </view>
|
|
|
+ <view @click="() => {
|
|
|
+ selectQuestionVisible = true
|
|
|
+ }" class="col">
|
|
|
+ <van-icon name="description" />
|
|
|
+ <text style="font-size: 24rpx; color: #8a9099; margin-left: 8rpx">{{ problemListIndex + 1 }}/{{
|
|
|
+ problemList.length }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <van-popup :zIndex="1005" round :show="submitExamVisible">
|
|
|
+ <view class="tip1">
|
|
|
+ <view class="title"> 确认交卷 </view>
|
|
|
+ <view class="score">
|
|
|
+ <view class="score-list">
|
|
|
+ <view class="score-dont">
|
|
|
+ {{ problemList.length - trueNum - falseNum }}</view>
|
|
|
+ <view style="font-size: 28rpx; color: #8a9099">未答题数</view>
|
|
|
+ </view>
|
|
|
+ <view class="score-list">
|
|
|
+ <view class="score-rest" style="margin: 0 auto">
|
|
|
+ {{ restTime }}</view>
|
|
|
+ <view style="font-size: 28rpx; color: #8a9099">剩余时间</view>
|
|
|
+ </view>
|
|
|
+ <view class="score-list">
|
|
|
+ <view class="score-exam"> {{ trueNum }}</view>
|
|
|
+ <view style="font-size: 28rpx; color: #8a9099">正确数</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <view @click="() => {
|
|
|
+ submitExamVisible = false;
|
|
|
+ }
|
|
|
+ " class="left">继续答题</view>
|
|
|
+ <view @click="() => {
|
|
|
+
|
|
|
+ submitExamVisible = false;
|
|
|
+ goPath('/otherPages/colorExamScore/index?trueNum=' + trueNum+'&falseNum='+falseNum)
|
|
|
+ }
|
|
|
+ " class="right">现在交卷</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </van-popup>
|
|
|
+ <van-popup :zIndex="1006" round :show="resultExamVisible">
|
|
|
+ <view class="tip2">
|
|
|
+ <view style="position: relative">
|
|
|
+ <image mode="widthFix" style="width: 628rpx" src="https://ndata.zzxcx.net/ctjk/mp-wx/threeExam/bg_dialog.png">
|
|
|
+ </image>
|
|
|
+ <image mode="widthFix" v-if="score < 90" class="tip2-cry" style="width: 187rpx"
|
|
|
+ src="https://ndata.zzxcx.net/ctjk/mp-wx/threeExam/cry.png"></image>
|
|
|
+ <image mode="widthFix" v-if="score >= 90" class="tip2-cry" style="width: 187rpx"
|
|
|
+ src="https://ndata.zzxcx.net/ctjk/mp-wx/threeExam/laugh.png"></image>
|
|
|
+ <view class="tip2-text">
|
|
|
+ <view>恭喜您</view>
|
|
|
+ <view>您的成绩<text style="color: #01c18d" v-if="score >= 90">合格</text><text style="color: #ff4d53"
|
|
|
+ v-if="score < 90">不合格</text></view>
|
|
|
+ <view class="tip2-text-line3">当前已答错<text style="color: #ff4d53; padding: 0 8rpx">{{
|
|
|
+ falseNum
|
|
|
+ }}</text>
|
|
|
+ 题</view>
|
|
|
+ <view class="tip2-bottom">
|
|
|
+ <!-- <view class="tip2-bottom-1">试试答题技巧,提分更快</view> -->
|
|
|
+ <view @click="
|
|
|
+ goPath('/otherPages/threeExamScore/index?score=' + score)
|
|
|
+ " class="tip2-bottom-2">现在交卷</view>
|
|
|
+ <view @click="() => {
|
|
|
+ resultExamVisible = false;
|
|
|
+ submitExamVisible = false;
|
|
|
+ }
|
|
|
+ " class="tip2-bottom-3">继续答题</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </van-popup>
|
|
|
+ <van-popup :zIndex="1007" round :close-on-click-overlay="true" :show="selectQuestionVisible" position="bottom">
|
|
|
+ <view class="select-problem">
|
|
|
+ <view class="problem-index">
|
|
|
+ <view class="problem-header">
|
|
|
+ <view class="problem-header-left">
|
|
|
+ <view class="problem-dui">
|
|
|
+ <icon class="icon-box-img" color="#06c05f" type="success" size="18"></icon>
|
|
|
+ <text style="color: #06c05f; font-size: 14px; margin-left: 8rpx">{{ trueNum }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="problem-cuo" style="margin-left: 16rpx">
|
|
|
+ <icon class="icon-box-img" type="cancel" size="18"></icon>
|
|
|
+ <text style="color: red; font-size: 14px; margin-left: 8rpx">{{ falseNum }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="problem-header-right">
|
|
|
+ <van-icon size="18px" name="description" />
|
|
|
+ <view style="font-size: 14px; display: flex; align-items: center">{{ problemListIndex + 1 }}/{{
|
|
|
+ problemList.length }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="problem-body">
|
|
|
+ <scroll-view scroll-y class="problem-listBody">
|
|
|
+ <view class="problem-listItem" :key="index" @click="() => {
|
|
|
+ problemListIndex = index
|
|
|
+ }
|
|
|
+ " v-for="(item, index) in problemList" :class="{
|
|
|
+ 'problem-listItem_current': problemListIndex == index,
|
|
|
+ 'problem-listItem_dui':
|
|
|
+ item.userAnswer.length && item.userAnswer == item.answer,
|
|
|
+ 'problem-listItem_cuo':
|
|
|
+ item.userAnswer.length && item.userAnswer !== item.answer,
|
|
|
+ }">
|
|
|
+ {{ index + 1 }}
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <view class="problem-bottom">
|
|
|
+ <!-- <view @click="
|
|
|
+ () => {
|
|
|
+ selectProblemListVisible = false;
|
|
|
+ }
|
|
|
+ " class="problem-bottom-sure">确定
|
|
|
+ </view> -->
|
|
|
+ <view @click="() => {
|
|
|
+ selectQuestionVisible = false;
|
|
|
+ }
|
|
|
+ " class="problem-bottom-close">
|
|
|
+ 关闭</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </van-popup>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import api from "@/api";
|
|
|
+import utils from "@/utils";
|
|
|
+import countDown from "@/components/countDown/index";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ query: {
|
|
|
+ showSubmit: true,
|
|
|
+ },
|
|
|
+ anLength: 7,
|
|
|
+ problemList: [
|
|
|
+ {
|
|
|
+ answer: "×",
|
|
|
+ answerkeyword: "",
|
|
|
+ answermp3: "https://sucai.kuaitongjiakao.com/mp3/answer120004.mp3",
|
|
|
+ chapterId: null,
|
|
|
+ columnAll: "0,4000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
|
|
+ createTime: "2024-03-14 11:47:35",
|
|
|
+ diffDegree: null,
|
|
|
+ errorRate: null,
|
|
|
+ explainGif: "",
|
|
|
+ explainJq: "注意.题中问的是“文字”的颜色,图中的文字是“紫”,文字的颜色是黄色",
|
|
|
+ explainJs: "注意.题中问的是“文字”的颜色,图中的文字是“紫”,文字的颜色是黄色",
|
|
|
+ explainMp3: "https://sucai.kuaitongjiakao.com/mp3/explain120004.mp3",
|
|
|
+ explainjsmp3: "https://sucai.kuaitongjiakao.com/mp3/explainJS120004.mp3",
|
|
|
+ id: 120004,
|
|
|
+ idYdt: null,
|
|
|
+ image: "https://sucai.app.kuaitongjiakao.com/kuaitong/issue_xin/image/image120004.jpg",
|
|
|
+ imageYdt: "",
|
|
|
+ isNew: 0,
|
|
|
+ issue: "下图文字的颜色是红色。",
|
|
|
+ issuemp3: "https://sucai.kuaitongjiakao.com/mp3/issue120004.mp3",
|
|
|
+ model: "cart",
|
|
|
+ number: 120000,
|
|
|
+ opts: "√-×",
|
|
|
+ optsArr: ["√", "×"],
|
|
|
+ questionType: 1,
|
|
|
+ skillkeyword: "",
|
|
|
+ subject: "9",
|
|
|
+ titlekeyword: "",
|
|
|
+ updateTime: "2024-03-15 14:08:45"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ trueNum: 0,
|
|
|
+ falseNum: 0,
|
|
|
+ problemListIndex: 0,
|
|
|
+ submitExamVisible: false,
|
|
|
+ resultExamVisible: false,
|
|
|
+ selectQuestionVisible: false,
|
|
|
+ examTime: 1000 * 60 * 20,
|
|
|
+ restTime: "",
|
|
|
+ useTime: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ score() {
|
|
|
+ return this.trueNum * 5;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onLoad(query) {
|
|
|
+ this.query = query;
|
|
|
+ if (this.query.showSubmit == "1") {
|
|
|
+ api.exam.studentQuestionSeTestList().then((res) => {
|
|
|
+ if (Array.isArray(res.data) && res.data.length > 0) {
|
|
|
+ res.data.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.optsArr = element.opts.split('-');
|
|
|
+ element.userAnswer = ''
|
|
|
+ element.userAnswerIndex = -1;
|
|
|
+ element.isComplete = false;
|
|
|
+
|
|
|
+ });
|
|
|
+ this.problemList = res.data;
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "error",
|
|
|
+ title: "加载失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (this.query.showSubmit == "0") {
|
|
|
+ api.exam.studentQuestionSeList().then((res) => {
|
|
|
+ if (Array.isArray(res.rows) && res.rows.length > 0) {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.optsArr = element.opts.split('-');
|
|
|
+ element.userAnswer = ''
|
|
|
+ element.userAnswerIndex = -1;
|
|
|
+ element.isComplete = false;
|
|
|
+ });
|
|
|
+ this.problemList = res.rows;
|
|
|
+ let key = `${uni.getStorageSync("userInfo").xcxOpenid}_threeExam_${this.query.subject}`
|
|
|
+ if (uni.getStorageSync(key)) {
|
|
|
+ uni.showModal({
|
|
|
+ title: "回到上次的题目",
|
|
|
+ content: `你上次做到第${uni.getStorageSync(key) + 1
|
|
|
+ }题,是否前往`,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.problemListIndex = Number(uni.getStorageSync(key))
|
|
|
+ // this.$emit(
|
|
|
+ // "update:problemListIndex",
|
|
|
+ // uni.getStorageSync(key)
|
|
|
+ // );
|
|
|
+ } else {
|
|
|
+ uni.setStorageSync(key, 0);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "error",
|
|
|
+ title: "加载失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ collectTopics() {
|
|
|
+ let storageName =
|
|
|
+ uni.getStorageSync("userInfo").xcxOpenid +
|
|
|
+ "_userThreeIds_" +
|
|
|
+ 9;
|
|
|
+ let userThreeIds = uni.getStorageSync(storageName) || [];
|
|
|
+
|
|
|
+ if (!this.problemList[this.problemListIndex].isCollect) {
|
|
|
+ if (
|
|
|
+ !userThreeIds.some((item) => {
|
|
|
+ return item.id === this.problemList[this.problemListIndex].id;
|
|
|
+ })
|
|
|
+ ) {
|
|
|
+ userThreeIds.push({
|
|
|
+ id: this.problemList[this.problemListIndex].id,
|
|
|
+ timestamp: +new Date(),
|
|
|
+ });
|
|
|
+ uni.setStorageSync(storageName, userThreeIds);
|
|
|
+ }
|
|
|
+ this.$set(this.problemList[this.problemListIndex], "isCollect", true);
|
|
|
+ uni.showToast({
|
|
|
+ title: "收藏成功",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ userThreeIds.indexOf(
|
|
|
+ this.problemList[this.problemListIndex].id
|
|
|
+ ) > 0
|
|
|
+ ) {
|
|
|
+ userThreeIds.splice(
|
|
|
+ userThreeIds.indexOf(
|
|
|
+ this.problemList[this.problemListIndex].id
|
|
|
+ ),
|
|
|
+ 1
|
|
|
+ );
|
|
|
+ uni.setStorageSync(storageName, userThreeIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$set(this.problemList[this.problemListIndex], "isCollect", false);
|
|
|
+ uni.showToast({
|
|
|
+ title: "取消收藏",
|
|
|
+ icon: "fail",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goPath(url) {
|
|
|
+ console.log(url);
|
|
|
+
|
|
|
+ uni.navigateTo({
|
|
|
+ url,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getThreeExamTime(a, b) {
|
|
|
+ this.restTime = a;
|
|
|
+ this.useTime = b;
|
|
|
+ },
|
|
|
+ submitExam(e) {
|
|
|
+ let that = this;
|
|
|
+ console.log(e);
|
|
|
+ uni.showModal({
|
|
|
+ title: "是否交卷",
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ api.exam
|
|
|
+ .studentScoreInfo({
|
|
|
+ type: "三力测试",
|
|
|
+ score: Number(that.score),
|
|
|
+ })
|
|
|
+ .then((result) => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/otherPages/threeExamScore/index?score=" + that.score,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/otherPages/threeExamScore/index?score=" + that.score,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getFileType(src) {
|
|
|
+ let suffix = src.substring(src.lastIndexOf(".") + 1);
|
|
|
+ let type = "";
|
|
|
+ switch (suffix) {
|
|
|
+ case "mp4":
|
|
|
+ case "WebM":
|
|
|
+ case "Ogg":
|
|
|
+ type = "video";
|
|
|
+ break;
|
|
|
+ case "png":
|
|
|
+ case "jpg":
|
|
|
+ case "webp":
|
|
|
+ type = "image";
|
|
|
+ break;
|
|
|
+ case "pdf":
|
|
|
+ type = "pdf";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ type = "other";
|
|
|
+ }
|
|
|
+ return type;
|
|
|
+ },
|
|
|
+ changeUserAnswer(e) {
|
|
|
+ console.log(e);
|
|
|
+ let key = `${uni.getStorageSync("userInfo").xcxOpenid}_threeExam_${this.query.subject}`
|
|
|
+ // this.problemList[this.problemListIndex].userAnswerIndex = e.detail;
|
|
|
+ // this.problemList[this.problemListIndex].userAnswer =
|
|
|
+ // this.problemList[this.problemListIndex]["an" + e.detail];
|
|
|
+ this.problemList[this.problemListIndex].userAnswer = e.detail
|
|
|
+ this.problemList[this.problemListIndex].isComplete = true;
|
|
|
+ this.problemList[this.problemListIndex].userAnswer == this.problemList[this.problemListIndex].answer ? this.trueNum++ : this.falseNum++;
|
|
|
+ uni.setStorageSync(key, this.problemListIndex)
|
|
|
+ // this.problemList[this.problemListIndex].userAnswerIndex ==
|
|
|
+ // this.problemList[this.problemListIndex].answertrue
|
|
|
+ // ? this.trueNum++
|
|
|
+ // : this.falseNum++;
|
|
|
+ },
|
|
|
+ prePage(e) {
|
|
|
+ if (this.problemListIndex <= 0) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "到底了",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.problemListIndex = this.problemListIndex - 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ nextPage(e) {
|
|
|
+ if (this.problemListIndex >= this.problemList.length - 1) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "到底了",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.problemListIndex = this.problemListIndex + 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ numberToLetter(index) {
|
|
|
+ index = Number(index);
|
|
|
+ return String.fromCharCode(index + 65);
|
|
|
+ },
|
|
|
+ createProblemTypeHtml(index) {
|
|
|
+ if (index == 1) {
|
|
|
+ return '<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">判断题</span>';
|
|
|
+ } else {
|
|
|
+ return '<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">选择题</span>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ components: {
|
|
|
+ countDown,
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.topad {
|
|
|
+ padding: 0 30rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.threeExam {
|
|
|
+ background: #fff;
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.wxad {
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+
|
|
|
+.select-problem {
|
|
|
+ display: flex;
|
|
|
+ width: 100vw;
|
|
|
+ align-content: flex-end;
|
|
|
+ align-items: flex-end;
|
|
|
+
|
|
|
+ .problem-index {
|
|
|
+ width: 100vw;
|
|
|
+ height: 650rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-top-right-radius: 16rpx;
|
|
|
+ border-top-left-radius: 16rpx;
|
|
|
+ padding-top: 50rpx;
|
|
|
+ -webkit-overflow-scrolling: touch;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-bottom {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ height: 80rpx;
|
|
|
+
|
|
|
+ .problem-bottom-sure {
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ border-right: 2rpx solid #d8d8d8;
|
|
|
+ border-top: 2rpx solid #d8d8d8;
|
|
|
+ text-align: center;
|
|
|
+ color: #498ef5;
|
|
|
+ line-height: 80rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-bottom-close {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ color: red;
|
|
|
+ text-align: center;
|
|
|
+ border-top: 2rpx solid #d8d8d8;
|
|
|
+ line-height: 80rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0rpx 30rpx;
|
|
|
+
|
|
|
+ .problem-header-left {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .problem-dui {
|
|
|
+ display: flex;
|
|
|
+ align-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-cuo {
|
|
|
+ display: flex;
|
|
|
+ align-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-header-right {
|
|
|
+ display: flex;
|
|
|
+ align-content: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-body {
|
|
|
+ height: 480rpx;
|
|
|
+ padding-top: 30rpx;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
+
|
|
|
+ .problem-listBody {
|
|
|
+ display: inline-block;
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 440rpx;
|
|
|
+
|
|
|
+ .problem-listItem {
|
|
|
+ display: inline-block;
|
|
|
+ width: 99rpx;
|
|
|
+ height: 99rpx;
|
|
|
+ line-height: 100rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 2rpx #d8d8d8 solid;
|
|
|
+ margin-bottom: 15rpx;
|
|
|
+ margin-left: 13rpx;
|
|
|
+ margin-right: 13rpx;
|
|
|
+ font-size: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-listItem_current {
|
|
|
+ background: rgba(138, 144, 153, 0.15);
|
|
|
+ border-color: #bfbfbf;
|
|
|
+ color: #5c6066;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-listItem_dui {
|
|
|
+ background: #c1e6db;
|
|
|
+ color: #4eb79a;
|
|
|
+ border-color: #4eb79a;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-listItem_cuo {
|
|
|
+ background: #ffbcbe;
|
|
|
+ color: #e65055;
|
|
|
+ border-color: #e65055;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.problem {
|
|
|
+ padding: 0 30rpx;
|
|
|
+ height: 500rpx;
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow-y: scroll;
|
|
|
+ padding-bottom: 30rpx;
|
|
|
+
|
|
|
+ .problem-type {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #fff;
|
|
|
+ background: #2878ff;
|
|
|
+ width: 94rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ padding: 6rpx 20rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-issue {
|
|
|
+ font-size: 42rpx;
|
|
|
+ vertical-align: middle;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #0a1a33;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-radio {
|
|
|
+ .problem-radio-flex {
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-radio-icon {
|
|
|
+ width: 70rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .problem-radio-letter {
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ font-size: 42rpx;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ box-shadow: 0px 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.26);
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-media {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ padding-top: 15rpx;
|
|
|
+
|
|
|
+ >image {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .problem-collect {
|
|
|
+ width: 100rpx;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 15rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.bottom {
|
|
|
+ // position: absolute;
|
|
|
+ // bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ padding-bottom: constant(safe-area-inset-bottom);
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
+
|
|
|
+ .switch {
|
|
|
+ bottom: 48rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .pre {
|
|
|
+ width: 156rpx;
|
|
|
+ height: 76rpx;
|
|
|
+ line-height: 76rpx;
|
|
|
+ background: #ffffff;
|
|
|
+ color: #8a9099;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ border: 2rpx solid #707070;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .next {
|
|
|
+ width: 156rpx;
|
|
|
+ height: 76rpx;
|
|
|
+ line-height: 76rpx;
|
|
|
+ color: #8a9099;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ border: 2rpx solid #707070;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .submit {
|
|
|
+ margin-top: 50rpx;
|
|
|
+ width: 100%;
|
|
|
+ height: 98rpx;
|
|
|
+ box-shadow: 2rpx -2rpx 6rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30rpx;
|
|
|
+
|
|
|
+ .submit-button {
|
|
|
+ width: 180rpx;
|
|
|
+ line-height: 68rpx;
|
|
|
+ background: #498ef5;
|
|
|
+ border-radius: 34rpx 34rpx 34rpx 34rpx;
|
|
|
+ opacity: 1;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ display: flex;
|
|
|
+ font-size: 24rpx;
|
|
|
+ padding: 0 16rpx;
|
|
|
+ justify-content: space-evenly;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .count {
|
|
|
+ width: 390rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .col {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.tip1 {
|
|
|
+ width: 580rpx;
|
|
|
+ height: 402rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ color: #0a1a33;
|
|
|
+ width: 100%;
|
|
|
+ font-size: 42rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-top: 48rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .score {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 0;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .score-list {
|
|
|
+ text-align: center;
|
|
|
+ color: #ff4d53;
|
|
|
+ font-size: 28rpx;
|
|
|
+ display: inline-block;
|
|
|
+ margin-top: 64rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .score-dont {
|
|
|
+ font-size: 42rpx;
|
|
|
+
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .score-rest {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 42rpx;
|
|
|
+ color: #0a1a33;
|
|
|
+ }
|
|
|
+
|
|
|
+ .score-exam {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 42rpx;
|
|
|
+ color: #0a1a33;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 48rpx;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ width: 250rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ border: 2rpx solid #707070;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ width: 250rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ background: #498ef5;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.tip2 {
|
|
|
+ .tip2-cry {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 1002;
|
|
|
+ left: 50%;
|
|
|
+ top: 48rpx;
|
|
|
+ transform: translate(-50%, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ .tip2-text {
|
|
|
+ position: absolute;
|
|
|
+ top: 284rpx;
|
|
|
+ width: 100%;
|
|
|
+ color: #0a1a33;
|
|
|
+ font-size: 42rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 1.5;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tip2-text-line3 {
|
|
|
+ color: #0a1a33;
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin-top: 25rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tip2-bottom {
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .tip2-bottom-1 {
|
|
|
+ width: 480rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ background: #498ef5;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ margin: 0 auto;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ margin-top: 60rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tip2-bottom-2 {
|
|
|
+ width: 480rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ border-radius: 40rpx 40rpx 40rpx 40rpx;
|
|
|
+ opacity: 1;
|
|
|
+ border: 2rpx solid #707070;
|
|
|
+ margin: 0 auto;
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tip2-bottom-3 {
|
|
|
+ margin-top: 30rpx;
|
|
|
+ color: #5c6066;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|