OverDialog.vue 3.8 KB
<template>
  <div>
    <el-dialog
      :visible="overVisible"
      @update:visible="$emit('update:overVisible',false)"
      width="636px"
      :before-close="next"
      :close-on-click-modal="false"
      append-to-body
      center
    >
      <div class="over_tip">
        多元性向潜能测验
        <i class="overed">已结束</i>
      </div>
      <div class="over_explain">
        亲爱的同学,第{{number}}部分多元性向潜能暨{{textName}}试题
        <i class="overed">已结束</i>,可以休息一会再继续完成其他的试题~
      </div>
      <div class="over_method layout justify_center">
        <div class="bind_now" @click="next">我知道了</div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: ["overVisible", "typeId"],
  data(){
    return{
      textName:"",
      number:""
    }
  },
  methods: {
    // 下一测评
    next() {
      this.$emit("update:overVisible", false);
      if (this.typeId == 1) {
        // 辞意完成
        localStorage.removeItem("cnAnswer");
        this.check();
      } else if (this.typeId == 2) {
        // 数学完成
        localStorage.removeItem("mathAnswer");
        this.check();
      } else if (this.typeId == 3) {
        // 逻辑完成
        localStorage.removeItem("logicAnswer");
        this.check();
      } else if (this.typeId == 4) {
        // 速度完成
        localStorage.removeItem("speedAnswer");
        this.check();
      } else if (this.typeId == 5) {
        // 力矩完成
        localStorage.removeItem("momentAnswer");
        this.check();
      } else if (this.typeId == 6) {
        // 空间完成
        localStorage.removeItem("spaceAnswer");
        this.check();
      } else if (this.typeId == 7) {
        // 字词完成
        localStorage.removeItem("wordAnswer");
        this.check();
      } else if (this.typeId == 8) {
        // 语法完成
        localStorage.removeItem("grammerAnswer");
        this.check();
      } else if (this.typeId == 9) {
        // 英语完成
        localStorage.removeItem("engAnswer");
        this.check();
      }
    },
    check(){
      this.$router.replace({path:'/BlankPage'});
      if(localStorage.getItem('is_complete')==1){
        this.$router.replace({path:'/SetEvalute'})
      }
    }
  },
  mounted(){
    switch(this.typeId){
      case 1:this.textName = "语文辞意推理";this.number = "一";break;
      case 2:this.textName = "数字概念推理";this.number = "二";break;
      case 3:this.textName = "抽象逻辑推理";this.number = "三";break;
      case 4:this.textName = "知觉速度统合";this.number = "四";break;
      case 5:this.textName = "机械力矩推理";this.number = "五";break;
      case 6:this.textName = "立体空间推理";this.number = "六";break;
      case 7:this.textName = "中文字词推论";this.number = "七";break;
      case 8:this.textName = "中文语法结构";this.number = "八";break;
      case 9:this.textName = "英文基本能力";this.number = "九";break;
    }
  }
};
</script>
<style scoped>
/* 提示 */
.over_tip {
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  line-height: 1;
  color: #34485e;
  opacity: 1;
  margin-top: -9px;
  padding-bottom: 36px;
  border-bottom: 1px solid #f1f1f1;
}
.overed {
  color: #f44a5e;
}
/* 解释说明 */
.over_explain {
  font-size: 16px;
  line-height: 32px;
  color: #5b5e63;
  opacity: 1;
  text-align: left;
  margin-top: 27px;
  font-family: Microsoft YaHei;
}
/* 按钮 */
.over_method {
  margin-top: 21px;
  text-align: center;
}
.bind_now {
  width: 180px;
  height: 40px;
  border: 1px solid #409eff;
  line-height: 40px;
  border-radius: 3px;
  font-size: 14px;
  text-align: center;
  background-color: #409eff;
  color: #fff;
  margin-bottom: -7px;
}
</style>