lex 2 lat temu
rodzic
commit
cdf62c3391

+ 6 - 1
src/components/o-dialog/index.module.less

@@ -19,6 +19,9 @@
 
 .oDialog {
   :global {
+    .van-dialog__header {
+      padding-top: 20px;
+    }
     .van-dialog__message {
       font-size: 16px;
       color: #333;
@@ -26,8 +29,10 @@
     }
     .van-dialog__cancel,
     .van-dialog__confirm {
-      font-weight: 500;
+      // font-weight: 500;
       font-size: 18px;
+      height: 50px;
+      line-height: 50px;
     }
     .van-dialog__cancel {
       color: #777777;

+ 36 - 13
src/views/unit-test/examination-mode/index.tsx

@@ -50,7 +50,8 @@ export default defineComponent({
       resultStatusType: 'SUCCESS', // 'SUCCESS' | 'FAIL'
       visiableExam: false, // 考试已结束
       nextStatus: false,
-      swipeHeight: 'auto' as any
+      swipeHeight: 'auto' as any,
+      quitStatus: false
     })
 
     const getExamDetails = async () => {
@@ -218,15 +219,16 @@ export default defineComponent({
 
     // 拦截
     const onBack = () => {
-      showDialog({
-        title: '提示',
-        message: '您考试还未提交,是否退出?',
-        theme: 'round-button',
-        confirmButtonColor: '#ff8057'
-      }).then(() => {
-        onAfter()
-        router.back()
-      })
+      // showDialog({
+      //   title: '提示',
+      //   message: '您考试还未提交,是否退出?',
+      //   theme: 'round-button',
+      //   confirmButtonColor: '#ff8057'
+      // }).then(() => {
+      //   onAfter()
+      //   router.back()
+      // })
+      state.quitStatus = true
     }
 
     const onAfter = () => {
@@ -239,8 +241,8 @@ export default defineComponent({
       // 初始化高度
       resizeSwipeItemHeight()
 
-      window.history.pushState(null, '', document.URL)
-      window.addEventListener('popstate', onBack, false)
+      // window.history.pushState(null, '', document.URL)
+      // window.addEventListener('popstate', onBack, false)
     })
 
     return () => (
@@ -266,6 +268,9 @@ export default defineComponent({
                     v-model:time={state.time}
                     format={'mm:ss'}
                     autoStart={false}
+                    onFinish={() => {
+                      state.visiableExam = true
+                    }}
                   />
                 </div>
               </div>
@@ -312,7 +317,14 @@ export default defineComponent({
                   />
                 )}
                 {item.questionTypeCode === QuestionType.SORT && (
-                  <DragQuestion v-model:value={item.userAnswer} data={item} index={index + 1} />
+                  <DragQuestion
+                    v-model:value={item.userAnswer}
+                    onUpdate:value={() => {
+                      resizeSwipeItemHeight(false)
+                    }}
+                    data={item}
+                    index={index + 1}
+                  />
                 )}
                 {item.questionTypeCode === QuestionType.LINK && (
                   <KeepLookQuestion v-model:value={item.userAnswer} data={item} index={index + 1} />
@@ -421,6 +433,17 @@ export default defineComponent({
             state.visiableResult = true
           }}
         />
+
+        <ODialog
+          v-model:show={state.quitStatus}
+          title="提示"
+          message="您是否退出本次练习?"
+          confirmButtonText="确认完成"
+          onConfirm={() => {
+            onAfter()
+            router.back()
+          }}
+        />
       </div>
     )
   }

+ 3 - 0
src/views/unit-test/model/choice-question/index.module.less

@@ -31,6 +31,9 @@
         .van-image {
           height: 38px;
         }
+        .van-image__img {
+          width: auto;
+        }
       }
     }
     .valueAudio {

+ 1 - 1
src/views/unit-test/model/choice-question/index.tsx

@@ -113,7 +113,7 @@ export default defineComponent({
                   <span class={styles.option}>{labelOptions[index + 1]}.</span>
                   {item.questionAnswerTypeCode === AnswerType.IMAGE && (
                     <div class={styles.value}>
-                      <Image src={item.questionAnswer} />
+                      <Image src={item.questionAnswer} fit="contain" />
                     </div>
                   )}
                   {item.questionAnswerTypeCode === AnswerType.TXT && (

+ 3 - 0
src/views/unit-test/model/drag-question/index.module.less

@@ -32,6 +32,9 @@
         .van-image {
           height: 38px;
         }
+        .van-image__img {
+          width: auto;
+        }
       }
     }
     .valueAudio {

+ 2 - 2
src/views/unit-test/model/play-question/index.tsx

@@ -107,10 +107,10 @@ export default defineComponent({
                   state.score = result.score || 0
                 }
               }
-              const answer = props.data.answer || []
+
               emit('update:value', [
                 {
-                  answerId: answer[0].examinationQuestionId,
+                  answerId: '',
                   answer: state.score,
                   answerExtra: ''
                 }

+ 2 - 2
src/views/unit-test/practice-mode/index.module.less

@@ -65,7 +65,7 @@
   .practiceRate {
     padding-top: 15px;
     font-size: 60px;
-    font-family: DINA;
+    // font-family: DINA;
     font-weight: bold;
     color: #f67146;
     line-height: 70px;
@@ -85,7 +85,7 @@
 
   .title {
     font-size: 24px;
-    font-family: DINA;
+    // font-family: DINA;
     font-weight: bold;
     color: #333333;
     line-height: 28px;

+ 19 - 9
src/views/unit-test/practice-mode/index.tsx

@@ -62,7 +62,8 @@ export default defineComponent({
         errorLength: 0, // 错题数
         rate: 0 // 正确率
       },
-      knowledgelist: [] as any // 知识点列表
+      knowledgelist: [] as any, // 知识点列表
+      quitStatus: false
     })
 
     // 计时
@@ -271,14 +272,15 @@ export default defineComponent({
 
     // 拦截
     const onBack = () => {
-      showDialog({
-        title: '提示',
-        message: '您是否退出?',
-        theme: 'round-button',
-        confirmButtonColor: '#ff8057'
-      }).then(() => {
-        onAfter()
-      })
+      // showDialog({
+      //   title: '提示',
+      //   message: '您是否退出?',
+      //   theme: 'round-button',
+      //   confirmButtonColor: '#ff8057'
+      // }).then(() => {
+      //   onAfter()
+      // })
+      state.quitStatus = true
     }
 
     const onAfter = () => {
@@ -529,6 +531,14 @@ export default defineComponent({
           confirmButtonText="确认完成"
           onConfirm={onConfirmExam}
         />
+
+        <ODialog
+          v-model:show={state.quitStatus}
+          title="提示"
+          message="您是否退出本次练习?"
+          confirmButtonText="确认完成"
+          onConfirm={onAfter}
+        />
       </div>
     )
   }