lex 1 年間 前
コミット
a3c22af375

+ 16 - 1
src/views/knowledge-library/error-question-mode/index.tsx

@@ -1,4 +1,12 @@
-import { ActionSheet, Button, Image, Popup, Swipe, SwipeItem } from 'vant';
+import {
+  ActionSheet,
+  Button,
+  Image,
+  Popup,
+  Swipe,
+  SwipeItem,
+  showToast
+} from 'vant';
 import {
   computed,
   defineComponent,
@@ -199,6 +207,13 @@ export default defineComponent({
       try {
         const questionList = state.questionList || [];
 
+        const question: any = questionList[state.currentIndex];
+        if (question?.userAnswer?.length <= 0) {
+          showToast('题目尚未做答');
+          state.nextStatus = false;
+          return;
+        }
+
         let result: any = {};
         questionList.forEach((question: any, index: number) => {
           // 格式化所有题目的答案

+ 3 - 1
src/views/knowledge-library/model/answer-analysis/index.tsx

@@ -61,7 +61,9 @@ export default defineComponent({
               <Icon name={iconAnalysis} class={styles.aImg} />
               答案解析
             </div>
-            <div class={styles.analysisMessage}>{props.answerAnalysis}</div>
+            <div class={styles.analysisMessage}>
+              {props.answerAnalysis || '无'}
+            </div>
           </>
         )}
       </div>