<template>
  <div>
    <div class="info">
      <div class="shape">
        <img src="https://zws-imgs-pub.ezijing.com/static/public/f2f02f49c3a107e7bf3201c91e29894e.jpg" alt="">
      </div>
      <div class="right">
        <div class="name">陈泽亚</div>
        <div class="code">CzY1689367</div>
      </div>
    </div>
    <div class="order-num">
      <div class="tit">单选题</div>
      <ul>
        <li
          @click="go(1)"
          :class="questionParams.questionIndex === 0
            ? questionParams.answerRecord['1'] ? 'stu1 stu2' : 'stu2'
            : questionParams.answerRecord['1'] ? 'stu1' : ''">1</li>
        <!-- stu1已答  stu2当前  stu3标记 -->
        <!-- questionParams.answerRecord['1'] ? 'stu1' : ''   questionParams.questionIndex === 0 ? 'stu2' : ''-->
        <!-- <li class="stu1">1</li>
        <li class="stu1">2</li>
        <li class="stu1 stu2 stu3">3</li>
        <li>4</li> -->
        <!-- <li class="stu1">1</li>
        <li class="stu1">2</li>
        <li class="stu1 stu2 stu3">3</li>
        <li>4</li> -->
      </ul>
      <div class="tit">多选题</div>
      <ul>
        <li
          @click="go(2)"
          :class="questionParams.questionIndex === 1
            ? questionParams.answerRecord['2'] ? questionParams.answerRecord['2'].answer.length ? 'stu1 stu2' : 'stu2' : 'stu2'
            : questionParams.answerRecord['2'] ? questionParams.answerRecord['2'].answer.length ?  'stu1' : '' : ''">2</li>
      </ul>
      <div class="tit">判断题</div>
      <ul>
        <li
          @click="go(3)"
          :class="questionParams.questionIndex === 2
            ? questionParams.answerRecord['3'] ? 'stu1 stu2' : 'stu2'
            : questionParams.answerRecord['3'] ? 'stu1' : ''">3</li>
      </ul>
      <div class="tit">复合题</div>
      <ul>
        <li
          @click="go(4)"
          :class="questionParams.questionIndex === 3
            ? questionParams.answerRecord['4'] ? 'stu1 stu2' : 'stu2'
            : questionParams.answerRecord['4'] ? 'stu1' : ''">4</li>
      </ul>
    </div>
    <ul class="flag-tips">
      <li>
        <div class="circle1"></div>
        <div class="txt">已答</div>
      </li>
      <li>
        <div class="circle2"></div>
        <div class="txt">未答</div>
      </li>
      <li>
        <div class="circle3"></div>
        <div class="txt">当前</div>
      </li>
      <!-- <li>
        <div class="circle4"></div>
        <div class="txt">标记</div>
      </li> -->
    </ul>
  </div>
</template>
<script>
import Bus from '../../components/common/bus.js'
export default {
  props: {
    questionParams: { type: Object, default: () => {} },
    changeTime: { type: Number, default: () => {} }
  },
  mounted() {
    Bus.$on('monitoringChanges', target => {
      this.$forceUpdate()
    })
  },
  methods: {
    go(n) {
      this.questionParams.questionIndex = n - 1
    }
  }
}
</script>
<style lang="scss" scoped>
.info{
  display: flex;
  align-items: center;
  height: 100px;
  .shape{
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
  }
  img{
    width: 75px;
    // transform: scale(1);
    display: block;
  }
  .right{
    margin-left: 22px;
    .name{
      font-size: 18px;
      color: #222222;
      line-height: 25px;
    }
    .code{
      font-size: 14px;
      color: #222222;
      line-height: 20px;
      margin-top: 5px;
    }
  }
}
.order-num{
  padding-bottom: 90px;
  .tit{
    font-size: 12px;
    color: #999999;
    line-height: 17px;
    margin-bottom: 10px;
  }
  ul{
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    li{
      cursor: pointer;
      position: relative;
      border-radius: 50px;
      width: 24px;
      height: 24px;
      border: 1px solid #CCCCCC;
      font-size: 14px;
      color: #666666;
      line-height: 24px;
      margin-right: 20px;
      margin-bottom: 10px;
      text-align: center;
      &:nth-child(5n+5){
        margin-right: 0;
      }
      &.stu1{
        background: #EEEEEE;
        border: 1px solid #CCCCCC;
      }
      &.stu2{
        border: 2px solid #0FC118;
      }
      &.stu3{
        &::after{
          content: '';
          position: absolute;
          top: -1px;
          right: -1px;
          width: 4px;
          height: 4px;
          background: #C01540;
          border-radius: 50%;
        }
      }
    }
  }
}
.flag-tips{
  width: 260px;
  position: fixed;
  bottom: 60px;
  right:0;
  display: flex;
  justify-content: space-around;
  padding: 15px 0 10px;
  background: #fff;
  margin: 0;
  list-style: none;
  li{
    .circle1{
      width: 24px;
      height: 24px;
      background: #EEEEEE;
      border: 1px solid #CCCCCC;
      border-radius: 50%;
    }
    .circle1{
      width: 24px;
      height: 24px;
      border: 1px solid #CCCCCC;
      border-radius: 50%;
    }
    .circle2{
      width: 24px;
      height: 24px;
      border: 1px solid #CCCCCC;
      border-radius: 50%;
    }
    .circle3{
      width: 24px;
      height: 24px;
      border: 2px solid #0FC118;
      border-radius: 50%;
    }
    .circle4{
      position: relative;
      width: 24px;
      height: 24px;
      border: 1px solid #CCCCCC;
      border-radius: 50%;
      &::after{
        content: '';
        position: absolute;
        top: -1px;
        right: -1px;
        width: 4px;
        height: 4px;
        background: #C01540;
        border-radius: 50%;
      }
    }
    .txt{
      margin-top: 5px;
      font-size: 12px;
      color: #CCCCCC;
      line-height: 17px;
    }
  }
}
</style>
