sunlupeng 1 年之前
父节点
当前提交
8a6da9881f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/views/HomeView/AnswerGame/AnswerGame.vue

+ 4 - 1
src/views/HomeView/AnswerGame/AnswerGame.vue

@@ -19,7 +19,7 @@
                                     <span style="text-align: center;">{{ questions[itemNum].ask }}</span>
                                 </div>
                                 <div class="content animated" :class="animate_showChoice" v-if="animate_showChoice">
-                                    <div v-for="(item,index) in questions[itemNum].answers" :key="index"  class="answerItem" :class="index == clickIndex ? answerColor : ''" @click="answer(item,index)">
+                                    <div v-for="(item,index) in questions[itemNum].answers" :key="index"  class="answerItem" :class="[index == clickIndex ? answerColor : '' , item.right ? rightAnswer : '']" @click="answer(item,index)">
                                         <span>{{ item.answer }}</span>
                                         <img v-if="index == clickIndex&&answerColor=='error'" class="invisible" src="@/assets/image/answerGame/item/error.png" alt="错误">
                                         <img v-if="index == clickIndex&&answerColor=='right'" class="invisible" style="width: 25px;" src="@/assets/image/answerGame/item/right.png" alt="正确">
@@ -72,6 +72,7 @@ export default{
   },
   data() {
     return {
+        rightAnswer:'',
         actId:this.$route.query.actId,
         roomId:'',
         rule:'',
@@ -163,12 +164,14 @@ export default{
                 this.answerColor = 'right';
             }else{
                 this.answerColor = 'error';
+                this.rightAnswer = 'right';
             }
             this.localClick = true;
             setTimeout(() => {
                 this.result.push(val.answer);
                 this.clickIndex = -1;
                 this.answerColor = '';
+                this.rightAnswer = '';
                 this.animate_showChoice = 'fadeOut';
                 if(this.itemNum==4){
                     clearInterval(this.timer);