<template>
  <div class="mask">
    <div>
      <div class="dialog">
        <div class="title">
          <span>考试确认窗口</span>
        </div>
        <div class="" style="background: #306ace">
          <div class="mid">
            <div class="mid-line1">操作提示：</div>
            <div class="mid-line2">
              你当前考试答对{{ correctScore }}题，答错{{ errorScore }}题，未答{{
                total - correctScore - errorScore
              }}题
            </div>
            <div class="mid-line3">
              <span>1.点击【确认交卷】,将提交考试成绩,结束考试！</span>
            </div>
            <div class="mid-line4">
              <span>2.点击【继续考试】,将关闭本窗口,继续考试！</span>
            </div>
          </div>
        </div>

        <div class="bottom">
          <view @click="sendPaper">确认交卷</view>
          <view @click="cancelSubmit">继续考试</view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    sendPaper() {
      this.$emit("confirm");
    },
    cancelSubmit() {
      this.$emit("cancel");
    },
  },
  // setup(props, { emit }) {
  //   const state = reactive({
  //     count: 0,
  //   });
  //   const sendPaper = () => {
  //     emit('confirm');
  //   };
  //   const cancelSubmit = () => {
  //     emit('cancel');
  //   };

  //   return {
  //     ...toRefs(state),
  //     props,
  //     sendPaper,
  //     cancelSubmit,
  //   };
  // },
  props: {
    correctScore: {
      type: Number,
      required: true,
      default: 0,
    },
    errorScore: {
      type: Number,
      required: true,
      default: 0,
    },
    total: {
      type: Number,
      required: true,
      default: 0,
    },
  },
};
</script>

<style lang="scss" scoped>
button {
  border-radius: 0;
  border: none;
}
.mask {
  position: fixed;
  top: 0;
  width: 750rpx;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 10;
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  .dialog {
    width: 381rpx;
    height: 210rpx;
    background: #fff;
    .title {
      width: 100%;
      text-align: center;
      line-height: 40rpx;
      height: 40rpx;
      background: #306ace;
      color: #fff;
      font-size: 14rpx;
      font-weight: 700;
    }
    .mid {
      width: 350rpx;
      margin: 0 auto;
      background: #fff;
      height: 115rpx;
      font-size: 14rpx;
      padding-left: 18rpx;
      padding-top: 14rpx;
      font-size: 13rpx;
      // padding-right: 10px;
      .mid-line1 {
        line-height: 25rpx;
        height: 25rpx;
        text-align: left;
        line-height: 25rpx;
      }
      .mid-line2 {
        text-align: left;
        line-height: 25rpx;
      }
      .mid-line3 {
        text-align: left;
        line-height: 25rpx;
      }
      .mid-line4 {
        text-align: left;
        line-height: 25rpx;
      }
    }
    .bottom {
      background: #306ace;
      width: 100%;
      height: 59rpx;
      display: flex;
      justify-content: center;
      align-content: center;
      align-items: center;
      font-size: 15rpx;
      view:nth-child(1) {
        height: 38rpx;
        margin-right: 27rpx;
        line-height: 38rpx;
        background: #fff;
        padding-left: 26rpx;
        padding-right: 26rpx;
      }
      view:nth-child(2) {
        height: 38rpx;
        line-height: 38rpx;
        background: #fff;
        padding-left: 26rpx;
        padding-right: 26rpx;
      }
    }
  }
}
</style>