Browse Source

修改今日必答标签

aaa 3 years ago
parent
commit
914dc23d3a
1 changed files with 18 additions and 7 deletions
  1. 18 7
      src/views/home/answer/page-answer-recruit.vue

+ 18 - 7
src/views/home/answer/page-answer-recruit.vue

@@ -15,7 +15,7 @@
               plain
               type="primary"
               color="red"
-              v-if="answerRecruitId === 'daily-questions'"
+              v-if="getAnswerTag(examQuestionList[answerIndex].tags) === true"
               >今日必答</van-tag
             >
             <!-- <span class="exam-question-head-left-txt"
@@ -34,7 +34,7 @@
         <div class="exam-question-describe">
           {{
             examQuestionList[answerIndex].questionContent ||
-              examQuestionList[answerIndex].content
+            examQuestionList[answerIndex].content
           }}
         </div>
         <!-- 答题列表 -->
@@ -42,9 +42,8 @@
         <div
           v-if="
             examQuestionList[answerIndex].type === questionType.TrueOrFalse ||
-              examQuestionList[answerIndex].type ===
-                questionType.singleChoice ||
-              examQuestionList[answerIndex].type === questionType.multipleChoice
+            examQuestionList[answerIndex].type === questionType.singleChoice ||
+            examQuestionList[answerIndex].type === questionType.multipleChoice
           "
           class="exam-question-options"
         >
@@ -55,7 +54,7 @@
               'exam-question-options-item': true,
               'exam-question-options-item-checked': answerValue.includes(item),
               'exam-question-options-false':
-                answerValue.includes(item) && answerStatus[answerIndex] === 2
+                answerValue.includes(item) && answerStatus[answerIndex] === 2,
             }"
             @click="handleExamQuestionOptionsItemFun(item)"
           >
@@ -67,7 +66,7 @@
           v-if="examQuestionList[answerIndex].type === questionType.gapFilling"
           class="exam-question-gapFilling"
           :class="{
-            'exam-question-gapFilling-false': answerStatus[answerIndex] === 2
+            'exam-question-gapFilling-false': answerStatus[answerIndex] === 2,
           }"
         >
           <textarea
@@ -181,6 +180,7 @@
 </template>
 
 <script>
+import { getTodayStr } from "@/utils/date";
 import { Dialog } from "vant";
 import { mapState } from "vuex";
 export default {
@@ -556,6 +556,17 @@ export default {
     // 操作:返回
     handleBackFun() {
       this.$router.back();
+    },
+    getAnswerTag(item) {
+      let todayStr = getTodayStr();
+      let flag = false;
+      for (const index in item) {
+        if (item[index] === todayStr) {
+          flag = true;
+          break;
+        }
+      }
+      return flag;
     }
   }
 };