Forráskód Böngészése

按钮颜色问题待研究

JXDS18FUJT 2 éve
szülő
commit
a3a58fa401

+ 1 - 1
postcss.config.js

@@ -10,7 +10,7 @@ module.exports = {
       return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
     },
     safelist: [/-(leave|enter|appear)(|-(to|from|active))$/, /^(?!(|.*?:)cursor-move).+-move$/,
-      /^router-link(|-exact)-active$/, /data-v-.*/, /^el-/, /^class/, /^is-/
+      /^router-link(|-exact)-active$/, /data-v-.*/, /^el-/,/^ant-/, /^class/, /^is-/
     ],
   }),require('autoprefixer')(),require('tailwindcss')()]
 }

+ 3 - 1
src/App.vue

@@ -38,7 +38,9 @@
   text-align: center;
   color: #2c3e50;
 }
-
+button, [type='button'], [type='reset'], [type='submit']{
+  background-color: #1677ff;
+}
 nav {
   padding: 30px;
 

+ 1 - 0
src/api/open/type.d.ts

@@ -6,6 +6,7 @@ interface Res {
 export declare namespace openApi {
     interface selectFreeQuestionInfoRes extends Res {
         rows: {
+            isSkipWrong?:boolean
             isError?: boolean
             isComplete?:boolean
             userAnswer: string | string[]

+ 1 - 0
src/api/question/type.d.ts

@@ -16,6 +16,7 @@ export declare namespace questionApi {
     interface selectTestK14QuestionInfoList extends Res {
         total:number
         rows: {
+      
             isError?: boolean
             isComplete?: boolean
             userAnswer: string | string[]

+ 1 - 0
src/api/three/type.d.ts

@@ -6,6 +6,7 @@ interface Res {
 export declare namespace threeApi {
     interface threeForceList extends Res {
         rows: {
+            isSkipWrong?:boolean
             "id": number,
             "type": number,
             "intnumber": string,

+ 83 - 0
src/components/mProblemVoiceAlert/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <div
+    class="fixed mask-bg-black items-center justify-center top0 h100vh left0 w100vw flex"
+    v-show="visible"
+  >
+    <div class="w450 bg-white pr30 pl30 pt30 pb30">
+      <div class="flex items-center">
+        <img class="w30 h24" src="@/assets/img/driverExam/analy_icon.png" />
+        <span class="font16 font-bold text-black ml10">{{ title }}</span>
+      </div>
+      <div class="font14 text-black text-left mt20">{{ content }}</div>
+      <div class="w-full flex justify-between">
+        <div
+          @click="hideDialog"
+          class="font14 w110 lh40 bg-primary-yellow mt30 round4 cursor-pointer"
+        >
+          确定
+        </div>
+        <div
+          @click="playJqVoice"
+          class="font14 w110 lh40 bg-primary-yellow mt30 round4 cursor-pointer"
+        >
+          语音播放
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+import audio from "@/utils/audio";
+export default defineComponent({
+  setup(props, context) {
+    return {
+      hideDialog: () => {
+        context.emit("update:visible", false);
+      },
+      playJqVoice() {
+        if(props.voice==''){
+            console.log('语音为空,无法播放')
+            return
+        }
+        audio.stopAudio()
+        audio.playAudio(props.voice);
+      },
+    };
+  },
+  props: {
+    title: {
+      type: String,
+      default: "提示",
+    },
+    content: {
+      type: String,
+      default: "提示",
+    },
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    voice: {
+      type: String,
+      default: "",
+    },
+  },
+});
+</script>
+
+<style scoped>
+.mask-bg-black {
+  background: rgba(0, 0, 0, 0.45);
+}
+.bg-primary-yellow {
+  background: #f9de5b;
+}
+.w100vw {
+  width: 100vw;
+}
+.h100vh {
+  height: 100vh;
+}
+</style>

+ 39 - 14
src/hooks/exam/driverExam.ts

@@ -664,6 +664,9 @@ export const useDriverExam = (requestFn: Promise<openApi.selectFreeQuestionInfoR
 
 
   };
+  const setIsSkipWrong = (isSkipWrong: boolean) => {
+    list.value[listIndex.value].isSkipWrong = !list.value[listIndex.value].isSkipWrong
+  }
   const cancelUserAnswer = (answer: string) => {
     if (list.value[listIndex.value].questionType == 3) {
       let userAnswer = list.value[listIndex.value].userAnswer as string[]
@@ -750,7 +753,7 @@ export const useDriverExam = (requestFn: Promise<openApi.selectFreeQuestionInfoR
           wrongTempList.push(list.value[index])
           wrongListRes.push('0')
         }
-   
+
       }
       else {
         let userAnswerIndex = '0'
@@ -769,10 +772,12 @@ export const useDriverExam = (requestFn: Promise<openApi.selectFreeQuestionInfoR
           const userAnswer = list.value[index].userAnswer as string
           userAnswerIndex = (String(optsArr.indexOf(userAnswer) + 1))
         }
-
-        wrongTempList.push(list.value[index])
-        wrongList.push(list.value[index])
-        wrongListRes.push(String(userAnswerIndex))
+        //isSkipWrong是假值的时候才收集错题
+        if (!list.value[index].isSkipWrong) {
+          wrongTempList.push(list.value[index])
+          wrongList.push(list.value[index])
+          wrongListRes.push(String(userAnswerIndex))
+        }
       }
     })
     //保存临时错题
@@ -788,26 +793,45 @@ export const useDriverExam = (requestFn: Promise<openApi.selectFreeQuestionInfoR
       })
 
     }).then(res => {
-      if (Number(route.query.subject == '1')) {
+      console.log(route)
+      if (Number(route.query.subject) == 1) {
+        console.log(route.query.subject)
         store.dispatch('AsyncDriver1WrongList')
       }
-      if (Number(route.query.subject == '4')) {
+      if (Number(route.query.subject) == 4) {
+        console.log(route.query.subject)
         store.dispatch('AsyncDriver4WrongList')
       }
-
-    })
-    router.push({
-      path: '/driverExamAnaly',
-      query: {
-        wrongListRes: JSON.stringify(wrongListRes),
-        score: score
+      //科目四每题是2分
+      if (Number(route.query.subject) == 4) {
+        score=score*2
       }
+      router.push({
+        path: '/driverExamAnaly',
+        query: {
+          wrongListRes: JSON.stringify(wrongListRes),
+          score: score,
+          ...route.query
+        }
+      })
+
+    }).catch(err => {
+      router.push({
+        path: '/driverExamAnaly',
+        query: {
+          wrongListRes: JSON.stringify(wrongListRes),
+          score: score,
+          ...route.query
+        }
+      })
+
     })
 
 
 
 
 
+
   }
   //删除驾驶考试的全部的错题
   const deleteAllWrong = () => {
@@ -957,6 +981,7 @@ export const useDriverExam = (requestFn: Promise<openApi.selectFreeQuestionInfoR
     issueAutoRead,
     submitDriveExam,
     deleteAllWrong,
+    setIsSkipWrong,
     setPageToListIndex
 
   }

+ 29 - 10
src/hooks/exam/threeExam.ts

@@ -436,6 +436,9 @@ export const useThreeExam = (requestFn: Promise<threeApi.threeForceList>, config
             listIndex.value = listIndex.value - 1;
         }
     };
+    const setIsSkipWrong = (isSkipWrong: boolean) => {
+        list.value[listIndex.value].isSkipWrong = !list.value[listIndex.value].isSkipWrong
+    }
     const setUserAnswer = (answer: string) => {
         //没有多选题
         list.value[listIndex.value].userAnswer = answer;
@@ -631,7 +634,7 @@ export const useThreeExam = (requestFn: Promise<threeApi.threeForceList>, config
             else {
                 //错误的题目
                 let userAnswerIndex = 0
-                wrongTempList.push(list.value[index])
+
                 for (let i = 1; i <= 6; i++) {
                     if (list.value[index].userAnswer == '') {
                         break;
@@ -641,8 +644,13 @@ export const useThreeExam = (requestFn: Promise<threeApi.threeForceList>, config
                         userAnswerIndex = i
                     }
                 }
-                wrongListRes.push(String(userAnswerIndex))
-                wrongList.push(list.value[index])
+                //isSkipWrong是假值的时候才收集错题
+                if (!list.value[listIndex.value].isSkipWrong) {
+                    wrongTempList.push(list.value[index])
+                    wrongListRes.push(String(userAnswerIndex))
+                    wrongList.push(list.value[index])
+                }
+
             }
         })
         //保存临时错题
@@ -659,14 +667,24 @@ export const useThreeExam = (requestFn: Promise<threeApi.threeForceList>, config
 
         }).then(res => {
             store.dispatch('AsyncThreeWrongList')
+            router.push({
+                path: '/threeExamAnaly',
+                query: {
+                    wrongListRes: JSON.stringify(wrongListRes),
+                    score: score
+                }
+            })
+        }).catch(err => {
+            router.push({
+                path: '/threeExamAnaly',
+                query: {
+                    wrongListRes: JSON.stringify(wrongListRes),
+                    score: score
+                }
+            })
+
         })
-        router.push({
-            path: '/threeExamAnaly',
-            query: {
-                wrongListRes: JSON.stringify(wrongListRes),
-                score: score
-            }
-        })
+
     }
 
     onMounted(() => {
@@ -719,6 +737,7 @@ export const useThreeExam = (requestFn: Promise<threeApi.threeForceList>, config
         setPageNumToListIndex,
         switchPageNumBySelect,
         submitThreeExam,
+        setIsSkipWrong,
         setPageToListIndex
 
 

+ 4 - 2
src/views/driverExamAnaly/index.vue

@@ -20,12 +20,12 @@
           <span class="font16">关闭</span>
         </div>
 
-        <div class="font0 overflow-hidden">
+        <div v-if="showScore=='1'" class="font0 overflow-hidden">
           <span class="font50 text-red-500">{{ score }}</span>
           <span class="font16 text-red-500">分</span>
         </div>
 
-        <div class="font16 w-full">你的成绩</div>
+        <div v-if="showScore=='1'" class="font16 w-full">你的成绩</div>
       </div>
       <div
         class="bg-red-100 h46 lh46 w-full pr20 pl20 text-left"
@@ -127,6 +127,7 @@ export default defineComponent({
       alertTitle: "解析",
       alertVisible: ref(false),
       alertContent: ref(""),
+      showScore:ref('')
     };
   },
   components: {
@@ -161,6 +162,7 @@ export default defineComponent({
     },
   },
   mounted() {
+    this.showScore =this.$route.query.showScore as string
     this.score = Number(this.$route.query.score);
     this.list = JSON.parse(
       window.sessionStorage.getItem("driverExam_temp_wrong_list") || "[]"

+ 2 - 1
src/views/examInstructions/index.vue

@@ -59,7 +59,8 @@ export default defineComponent({
       router.push({
         path:'/driverExam',
         query:{
-          ...route.query
+          ...route.query,
+          showScore:'1'
         }
       })
     };

+ 1 - 1
src/views/home/practiseSelect/index.vue

@@ -6,7 +6,7 @@
       <div class="flex items-center">
         <div class="vertical-line mr10"></div>
         <span class="font20 font-bold mr15">技巧练习</span>
-        <div class="lh34 select-border1 round4 pr15 pl15">试听</div>
+        <!-- <div class="lh34 select-border1 round4 pr15 pl15">试听</div> -->
       </div>
       <div class="">
         <div class="flex justify-between flex-wrap w-11/12">

+ 2 - 2
src/views/reviewThreeError/index.vue

@@ -208,10 +208,10 @@
           <div class="flex items-center">
             <div class="pr2 pl2">转到</div>
             <input
-             @keydown.enter="setPageToListIndex(listPageNum)"
+              @keydown.enter="setPageToListIndex(listPageNum)"
               class="outline-none input-border w35 h30 text-center"
               type="text"
-            v-model.number="listPageNum"
+              v-model.number="listPageNum"
             />
             <div class="pr2 pl2">题(请按回车)</div>
           </div>

+ 29 - 6
src/views/studySkill/index.vue

@@ -150,17 +150,29 @@
           <div
             @click="
               () => {
-                alertVisible = true;
+                alert1Visible = true;
               }
             "
             class="w120 lh46 bottom-button lh46"
           >
             本题解析
           </div>
+          <div
+            @click="
+              () => {
+                alert2Visible = true;
+              }
+            "
+            class="w120 lh46 bottom-button lh46"
+          >
+            技巧讲解
+          </div>
           <div @click="playIssueAudio()" class="w120 lh46 bottom-button lh46">
             语音播报
           </div>
-          <div class="w120 lh46 bottom-button lh46">不设为错题</div>
+          <div :class="{
+            'bg-primary-yellow':list[listIndex].isSkipWrong
+          }" @click="setIsSkipWrong(!list[listIndex].isSkipWrong)" class="w120 lh46 bottom-button lh46">不设为错题</div>
           <div
             @click="
               () => {
@@ -241,11 +253,19 @@
         </div>
       </div>
     </div>
+    <mProblemVoiceAlert :voice="list[listIndex].explainMp3" title="技巧讲解" v-model:visible="alert2Visible" :content="list[listIndex].explainJq">
+
+    </mProblemVoiceAlert>
     <mProblemAlert
-      v-model:visible="alertVisible"
+      v-model:visible="alert1Visible"
       :content="list[listIndex].explainJs"
-      title="题目解析"
+      title="官方解释"
     ></mProblemAlert>
+      <!-- <mProblemAlert
+      v-model:visible="alert1Visible"
+      :content="list[listIndex].explainJs"
+      title="题目解析"
+    ></mProblemAlert> -->
     <mProblemDialog
       v-model:visible="dialogVisible"
       title="提示"
@@ -262,6 +282,7 @@ import { useRoute } from "vue-router";
 import { useDriverExam } from "@/hooks/exam/driverExam";
 import mProblemAlert from "@/components/mProblemAlert/index.vue";
 import mProblemDialog from "@/components/mProblemDialog/index.vue";
+import mProblemVoiceAlert from "@/components/mProblemVoiceAlert/index.vue"
 import { useStore } from "vuex";
 import { message } from "ant-design-vue";
 export default defineComponent({
@@ -284,7 +305,8 @@ export default defineComponent({
 
     return {
       sysConfig,
-      alertVisible: ref(false),
+      alert1Visible: ref(false),
+      alert2Visible: ref(false),
       dialogVisible: ref(false),
       ...useDriverExam(
         api.question.questionInfoQlist({
@@ -296,7 +318,7 @@ export default defineComponent({
         {
           autoAnswer: false,
           countDown: false,
-          recordUncomplete:false
+          recordUncomplete: false,
         }
       ),
       changeSysConfig,
@@ -306,6 +328,7 @@ export default defineComponent({
   components: {
     mProblemAlert,
     mProblemDialog,
+    mProblemVoiceAlert
   },
 });
 </script>

+ 9 - 1
src/views/threeStudyExam/index.vue

@@ -188,7 +188,15 @@
           <div @click="playIssueAudio()" class="w120 lh46 bottom-button lh46">
             语音播报
           </div>
-          <div class="w120 lh46 bottom-button lh46">不设为错题</div>
+          <div
+            :class="{
+              'bg-primary-yellow': list[listIndex].isSkipWrong,
+            }"
+            @click="setIsSkipWrong(!list[listIndex].isSkipWrong)"
+            class="w120 lh46 bottom-button lh46"
+          >
+            不设为错题
+          </div>
           <div
             @click="
               () => {