<template>
  <div class="exam-notice-page">
    <!-- 横幅区域 -->
    <div class="banner-section">
      <div class="banner-container">
        <img src="/banners/考前须知.png" alt="考前须知" class="banner-image" />
      </div>
      <div class="banner-text">
        <h2>考试中心</h2>
        <p>涵盖多种题型，全方位考核，AI智能阅卷</p>
      </div>
    </div>

    <!-- 主要内容区域 -->
    <div class="main-content">
      <!-- 面包屑导航 -->
      <div class="breadcrumb-wrapper">
        <div class="breadcrumb-container">
          <span class="breadcrumb-item">课程名称</span>
          <span class="breadcrumb-separator">></span>
          <span class="breadcrumb-item current">考前须知</span>
        </div>
      </div>

      <div class="content-container">

        <!-- 考前须知标题 -->
        <h1 class="page-title">考前须知</h1>

        <!-- 考试信息 -->
        <div class="exam-info">
          <div class="exam-info-left">
            <span class="exam-time">发布时间：2025年8月1日-8月18日</span>
            <span class="exam-name">考试名称：【2025】数字化教育理论基础与实务课程考试</span>
          </div>
          <div class="exam-info-right">
            <span class="exam-duration">考试时长：120分钟</span>
          </div>
        </div>

        <!-- 考前须知内容 -->
        <div class="notice-content">

          <div class="notice-item">
            <span class="item-number">1.</span>
            <span class="item-text">考试时间：2025年8月1日-8月18日，在此期间考生可自行安排时间考试，考试时长共120分钟。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">2.</span>
            <span class="item-text">考生应诚实守信，自觉遵守考试纪律，禁止一切一切作弊行为。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">3.</span>
            <span class="item-text">考试过程中考生需确保网络环境良好，设备、光线充足等，自备答题纸。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">4.</span>
            <span class="item-text">本次考试采用网络考试方式，考生应在规定本上填写姓名，用户应确保在考试过程中网络通畅、设备、未按规定在考试本上填写答题或未交试卷的考试成绩，将自动。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">5.</span>
            <span class="item-text">考生应提前调试好考试设备，确保考试设备正常运行，不得因设备故障等问题影响考试。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">6.</span>
            <span class="item-text">考试时，请考生自觉关闭手机，并将随身物品放在指定位置，考生需，24小时，确保良好的网络环境和充足的电量，在考试期间考生不得离开考试场地上述规定执行。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">7.</span>
            <span class="item-text">考生应提前熟悉考试流程，机考考试操作流程，确保能够正常参加考试。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">8.</span>
            <span class="item-text">违反人员者，将按相关规定，暂停考试资格或取消，禁止参与考试。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">9.</span>
            <span class="item-text">请认真阅读本人考试须知，严格遵守考试纪律，对不遵守考试纪律，如有疑问请及时联系，监考老师进行咨询。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">10.</span>
            <span class="item-text">考生应在考试完毕后及时提交试卷并确认提交成功，考生、考生应在规定时间内完成考试，逾期、监考老师将强制，并对《考试违规》进行处罚。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">11.</span>
            <span class="item-text">考试过程中若出现工作异常且自行解决困难时请及时联系，考试技术热线：www.baidu.com。</span>
          </div>

          <div class="notice-item">
            <span class="item-number">*</span>
            <span class="item-text">如有疑问，可致电：0871-5533221。</span>
          </div>
        </div>

        <!-- 操作按钮 -->
        <div class="notice-actions">
          <!-- <button class="btn-secondary" @click="goBack">
            我已知晓，开始考试（10）
          </button> -->
          <button class="btn-primary" @click="startExam">
            我已知晓，开始考试
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const route = useRoute()
const router = useRouter()

// 路由参数
const courseId = ref(Number(route.params.courseId))
const sectionId = ref(Number(route.params.sectionId))
const courseName = ref(route.query.courseName as string || '课程名称')
const examName = ref(route.query.examName as string || '考试')

// 页面数据
// const viewCount = ref(1024) // 暂时注释，后续需要时再启用

// 返回上级
// const goBack = () => {
//   router.push(`/course/${courseId.value}`)
// } // 暂时未使用



// 开始考试
const startExam = () => {
  // 跳转到正式考试页面，添加fromNotice参数
  router.push({
    name: 'Exam',
    params: {
      courseId: courseId.value,
      sectionId: sectionId.value
    },
    query: {
      courseName: courseName.value,
      examName: examName.value,
      fromNotice: 'true'
    }
  })
}

onMounted(() => {
  console.log('考前须知页面加载完成')
  console.log('课程ID:', courseId.value)
  console.log('章节ID:', sectionId.value)
  console.log('考试名称:', examName.value)
})
</script>

<style scoped>
.exam-notice-page {
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* 面包屑导航 */
.breadcrumb-wrapper {
  padding: 12px 0;
  margin-bottom: 0;
}

.breadcrumb-container {
  margin: 0 250px;
  font-size: 14x;
  color: #666;
}

.breadcrumb-item {
  color: #666;
}

.breadcrumb-item.current {
  color: #0088D1;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #999;
}

/* 横幅区域 */
.banner-section {
  padding: 0;
  width: 100%;
  position: relative;
}

.banner-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}


.banner-text h2 {
  width: 128px;
  height: 39px;
  font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
  font-weight: bold;
  font-size: 32px;
  color: #000000;
  line-height: 39px;
  text-align: center;
  font-style: normal;
}

.banner-text p {
  width: 252px;
  height: 20px;
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 14px;
  color: #000000;
  line-height: 20px;
  text-align: center;
  font-style: normal;
}

.banner-container {
  width: 100%;
  padding: 0;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* 主要内容区域 */
.main-content {
  background: #f5f5f5;
  padding: 10px 0;
  height: 1740px;
}

.content-container {
  margin: 0 250px;
  background: white;
  border-radius: 0 0 8px 8px;
  padding: 30px;
}



/* 页面标题 */
.page-title {
  text-align: center;
  font-size: 24px;
  color: #333;
  margin: 0;
}

/* 考试信息 */
.exam-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.exam-info-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.exam-time {
  font-size: 13px;
  color: #999;
}

.exam-name {
  font-size: 13px;
  color: #999;
}

.exam-info-right {
  display: flex;
  align-items: center;
}

.exam-duration {
  font-size: 13px;
  color: #999;
}

/* 发布信息 */
.publish-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding: 0 20px;
  font-size: 14px;
  color: #666;
}

.publish-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.publish-right {
  text-align: right;
}

.publish-time,
.exam-name,
.view-count {
  line-height: 1.5;
}

/* 考前须知内容 */
.notice-content {
  margin-bottom: 40px;
  line-height: 1.8;
  color: #333;
  padding: 0 65px;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 14px;
}

.item-number {
  color: #333;
  font-weight: 500;
  margin-right: 8px;
  flex-shrink: 0;
  min-width: 20px;
}

.item-text {
  color: #333;
  font-size: 14px;
  flex: 1;
}

/* 操作按钮 */
.notice-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 40px;
}

.btn-secondary {
  background: #999999;
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 230px;
  text-align: center;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #666666;
}

.btn-primary {
  background: #0088D1;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 230px;
  text-align: center;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #40a9ff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .breadcrumb-container {
    margin: 0 100px;
  }

  .content-container {
    margin: 0 100px;
  }
}

@media (max-width: 768px) {
  .breadcrumb-container {
    margin: 0 20px;
  }

  .content-container {
    margin: 0 20px;
    padding: 20px;
    border-radius: 4px;
  }

  .banner-container {
    padding: 15px;
  }

  .banner-image {
    border-radius: 4px;
  }

  .exam-info {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .exam-info-left {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .exam-info-right {
    text-align: left;
  }

  .btn-secondary,
  .btn-primary {
    min-width: 300px;
  }
}
</style>
