You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1019 lines
29 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>青核 Youthome - 实名认证·上传学籍报告</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../colors_and_type.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
background: var(--youth-bg-page);
color: var(--youth-text-primary);
overflow: hidden;
overflow-x: hidden;}
.phone-container {
width: 375px;
height: 812px;
margin: 0 auto;
background: var(--youth-bg-page);
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* ===== 状态栏 ===== */
.status-bar {
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
position: relative;
z-index: 10;
flex-shrink: 0;
}
.status-bar .right-icons {
display: flex;
align-items: center;
gap: 5px;
}
/* ===== 顶部导航 ===== */
.nav-bar {
height: 44px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
position: relative;
flex-shrink: 0;
}
.nav-btn {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--youth-bg-card);
border: 1px solid var(--youth-border-light);
box-shadow: var(--youth-shadow-card);
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-primary);
}
.nav-btn:active {
transform: scale(0.95);
}
.nav-title {
font-size: 16px;
font-weight: 600;
color: var(--youth-text-primary);
position: absolute;
left: 50%;
transform: translateX(-50%);
}
/* ===== 三步进度条 ===== */
.step-progress {
padding: 6px 20px 4px;
flex-shrink: 0;
}
.step-track {
display: flex;
align-items: center;
justify-content: center;
gap: 0;
position: relative;
}
.step-node {
width: 28px;
height: 28px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 2;
transition: all 0.3s ease;
}
.step-node svg {
width: 14px;
height: 14px;
}
.step-node.completed {
background: var(--youth-gradient-primary);
box-shadow: 0 2px 6px rgba(38, 194, 187, 0.3);
}
.step-node.current {
background: var(--youth-gradient-primary);
box-shadow: 0 0 0 3px rgba(38, 194, 187, 0.15), 0 3px 10px rgba(38, 194, 187, 0.35);
animation: pulse-glow 2s ease-in-out infinite;
}
.step-node.pending {
background: var(--youth-gray-200);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
border: 2px solid var(--youth-gray-300);
}
@keyframes pulse-glow {
0%, 100% {
box-shadow: 0 0 0 3px rgba(38, 194, 187, 0.15), 0 3px 10px rgba(38, 194, 187, 0.35);
}
50% {
box-shadow: 0 0 0 5px rgba(38, 194, 187, 0.08), 0 3px 14px rgba(38, 194, 187, 0.45);
}
}
.step-line {
width: 44px;
height: 2.5px;
border-radius: 2px;
position: relative;
z-index: 1;
}
.step-line.done {
background: var(--youth-gradient-primary);
box-shadow: 0 1px 2px rgba(38, 194, 187, 0.2);
}
.step-line.todo {
background: var(--youth-gray-200);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.step-labels {
display: flex;
justify-content: space-between;
margin-top: 4px;
padding: 0 2px;
}
.step-label {
font-size: 10px;
font-weight: 500;
color: var(--youth-text-tertiary);
text-align: center;
width: 28px;
}
.step-label.active {
color: var(--youth-primary);
font-weight: 600;
}
.step-label.completed {
color: var(--youth-primary-dark);
}
.step-subtitle {
text-align: center;
font-size: 11px;
color: var(--youth-text-tertiary);
margin-top: 4px;
}
.step-subtitle strong {
color: var(--youth-primary);
font-weight: 600;
}
/* ===== 页面标题区 ===== */
.page-header {
padding: 6px 20px 8px;
flex-shrink: 0;
}
.page-title {
font-size: 20px;
font-weight: 700;
color: var(--youth-text-primary);
line-height: 1.3;
letter-spacing: -0.02em;
}
.page-subtitle {
font-size: 13px;
color: var(--youth-text-tertiary);
margin-top: 2px;
line-height: 1.4;
}
/* ===== 内容区域 ===== */
.content-scroll {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
padding: 0 20px;
}
.content-scroll::-webkit-scrollbar {
display: none;
}
/* ===== 上传区域 ===== */
.upload-section {
padding-bottom: 10px;
flex-shrink: 0;
}
.upload-area {
position: relative;
border-radius: var(--youth-radius-md);
padding: 16px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: var(--youth-bg-card);
border: 2px dashed transparent;
background-clip: padding-box;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
.upload-area::before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
border-radius: var(--youth-radius-md);
background: linear-gradient(135deg, #7ED6D2 0%, #26C2BB 50%, #1FA8A2 100%);
z-index: -1;
opacity: 0.5;
}
.upload-area::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 10px;
background: var(--youth-bg-card);
z-index: -1;
}
.upload-area:active {
transform: scale(0.98);
}
.upload-icon-wrapper {
width: 44px;
height: 44px;
margin: 0 auto 6px;
position: relative;
}
.upload-icon-bg {
position: absolute;
inset: 0;
border-radius: 12px;
background: linear-gradient(135deg, #E6F7F6 0%, #C8EEEC 100%);
box-shadow:
inset 0 2px 4px rgba(255, 255, 255, 0.8),
inset 0 -2px 4px rgba(38, 194, 187, 0.1),
0 2px 8px rgba(38, 194, 187, 0.15);
}
.upload-icon {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
.upload-icon svg {
width: 22px;
height: 22px;
}
.upload-title {
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
margin-bottom: 2px;
}
.upload-desc {
font-size: 11px;
color: var(--youth-text-tertiary);
line-height: 1.4;
}
.upload-hint {
font-size: 10px;
color: var(--youth-text-placeholder);
margin-top: 4px;
}
/* ===== 已上传状态 ===== */
.uploaded-state {
display: none;
background: var(--youth-bg-card);
border-radius: var(--youth-radius-md);
padding: 10px;
border: 1px solid var(--youth-border-light);
box-shadow: var(--youth-shadow-card);
}
.uploaded-state.show {
display: block;
}
.uploaded-header {
display: flex;
align-items: center;
gap: 8px;
}
.file-icon-box {
width: 32px;
height: 32px;
border-radius: 8px;
background: linear-gradient(135deg, #FFE5E5 0%, #FFD4D4 100%);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: var(--youth-shadow-card);
}
.file-icon-box svg {
width: 16px;
height: 16px;
}
.file-info {
flex: 1;
min-width: 0;
}
.file-name {
font-size: 12px;
font-weight: 600;
color: var(--youth-text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.file-size {
font-size: 10px;
color: var(--youth-text-tertiary);
margin-top: 1px;
}
.reupload-btn {
width: 28px;
height: 28px;
border-radius: var(--youth-radius-sm);
background: var(--youth-bg-input);
border: 1px solid var(--youth-border-light);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
}
.reupload-btn svg {
width: 12px;
height: 12px;
}
.reupload-btn:active {
transform: scale(0.95);
}
.upload-progress-wrap {
margin-top: 8px;
}
.progress-track {
height: 5px;
background: var(--youth-gray-200);
border-radius: 3px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
overflow: hidden;
position: relative;
}
.progress-fill {
height: 100%;
width: 0%;
background: var(--youth-gradient-primary);
border-radius: 3px;
transition: width 0.3s ease;
position: relative;
box-shadow: 0 1px 2px rgba(38, 194, 187, 0.3);
}
.upload-status {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 4px;
}
.status-text {
font-size: 10px;
color: var(--youth-text-tertiary);
}
.status-text.success {
color: #8ED8B8;
font-weight: 500;
}
.status-text.uploading {
color: var(--youth-primary);
font-weight: 500;
}
.status-percent {
font-size: 10px;
font-weight: 600;
color: var(--youth-primary);
}
/* ===== 指引卡片 ===== */
.guide-card {
background: var(--youth-bg-card);
border-radius: var(--youth-radius-md);
padding: 10px 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
border: 1px solid var(--youth-border-lighter);
flex-shrink: 0;
margin-bottom: 10px;
}
.guide-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.guide-title {
font-size: 13px;
font-weight: 600;
color: var(--youth-text-primary);
display: flex;
align-items: center;
gap: 5px;
}
.guide-title svg {
width: 14px;
height: 14px;
}
.tutorial-link {
font-size: 11px;
color: var(--youth-primary);
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
gap: 2px;
}
.guide-steps {
display: flex;
flex-direction: column;
gap: 6px;
}
.guide-step {
display: flex;
align-items: flex-start;
gap: 8px;
}
.step-number {
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--youth-gradient-primary);
color: white;
font-size: 11px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 2px 4px rgba(38, 194, 187, 0.3);
}
.step-content {
flex: 1;
padding-top: 1px;
}
.step-main-text {
font-size: 12px;
font-weight: 500;
color: var(--youth-text-primary);
line-height: 1.3;
}
.step-sub-text {
font-size: 10px;
color: var(--youth-text-tertiary);
margin-top: 1px;
}
/* ===== 支持类型 ===== */
.support-section {
flex-shrink: 0;
margin-bottom: 10px;
}
.support-title {
font-size: 12px;
font-weight: 600;
color: var(--youth-text-primary);
margin-bottom: 6px;
}
.support-tags {
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.support-tag {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 4px 8px;
border-radius: var(--youth-radius-lg);
font-size: 10px;
font-weight: 500;
}
.support-tag svg {
width: 10px;
height: 10px;
}
.support-tag.supported {
background: rgba(142, 216, 184, 0.15);
color: #8ED8B8;
border: 1px solid rgba(142, 216, 184, 0.25);
}
.support-tag.unsupported {
background: rgba(255, 185, 128, 0.15);
color: #E8956B;
border: 1px solid rgba(255, 185, 128, 0.25);
}
/* ===== 底部操作区 ===== */
.bottom-actions {
position: relative;
padding: 8px 20px 12px;
flex-shrink: 0;
background: linear-gradient(180deg, transparent 0%, var(--youth-bg-page) 30%);
}
.btn-primary {
width: 100%;
height: 44px;
border-radius: var(--youth-radius-sm);
background: var(--youth-gradient-primary);
color: white;
font-size: 15px;
font-weight: 600;
border: none;
cursor: pointer;
position: relative;
overflow: hidden;
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.25);
transition: all 0.2s ease;
font-family: inherit;
}
.btn-primary::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
pointer-events: none;
}
.btn-primary:active:not(:disabled) {
transform: scale(0.98);
box-shadow: 0 1px 4px rgba(38, 194, 187, 0.2);
}
.btn-primary:disabled {
background: var(--youth-gray-300);
box-shadow: none;
cursor: not-allowed;
opacity: 0.7;
}
.btn-primary:disabled::before {
display: none;
}
.btn-prev {
width: 100%;
height: 32px;
margin-top: 4px;
background: transparent;
border: none;
font-size: 12px;
font-weight: 500;
color: var(--youth-text-tertiary);
cursor: pointer;
transition: all 0.2s ease;
font-family: inherit;
}
.btn-prev:active {
color: var(--youth-primary);
}
/* ===== 隐藏的文件输入 ===== */
.file-input {
display: none;
}
/* ===== 响应式居中 ===== */
@media (min-width: 376px) {
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: var(--youth-gray-100);
}
.phone-container {
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
border-radius: 40px;
overflow: hidden;
}
}
/* SVG 图标统一尺寸 */
.icon-svg {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1em;
height: 1em;
vertical-align: middle;
line-height: 1;
}
.icon-svg svg {
width: 100%;
height: 100%;
stroke: currentColor;
}
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
</style>
</head>
<body>
<div class="phone-container" id="phoneContainer">
<!-- 状态栏 -->
<div class="status-bar">
<span>9:41</span>
<div class="right-icons">
<!-- 信号 -->
<svg width="18" height="12" viewBox="0 0 18 12" fill="currentColor">
<rect x="0" y="8" width="3" height="4" rx="1"></rect>
<rect x="5" y="5" width="3" height="7" rx="1"></rect>
<rect x="10" y="2" width="3" height="10" rx="1"></rect>
<rect x="15" y="0" width="3" height="12" rx="1"></rect>
</svg>
<!-- WiFi -->
<svg width="16" height="12" viewBox="0 0 16 12" fill="currentColor">
<path d="M8 10.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3ZM8 6.5c1.5 0 2.9.6 4 1.6l-1 1.2a4.2 4.2 0 0 0-6 0l-1-1.2c1.1-1 2.5-1.6 4-1.6ZM8 2.5c2.8 0 5.4 1.1 7.3 3l-1 1.2A8.4 8.4 0 0 0 8 4.5a8.4 8.4 0 0 0-6.3 2.2l-1-1.2C2.6 3.6 5.2 2.5 8 2.5Z"></path>
</svg>
<!-- 电池 -->
<svg width="26" height="12" viewBox="0 0 26 12" fill="none">
<rect x="0.5" y="0.5" width="22" height="11" rx="3" stroke="currentColor" opacity="0.4"></rect>
<rect x="2" y="2" width="19" height="8" rx="2" fill="currentColor"></rect>
<rect x="23.5" y="4" width="2" height="4" rx="1" fill="currentColor" opacity="0.4"></rect>
</svg>
</div>
</div>
<!-- 顶部导航 -->
<div class="nav-bar">
<div class="nav-btn" data-dom-id="btn-back" id="btnBack">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</div>
<div class="nav-title">学生认证</div>
<div style="width: 32px;"></div>
</div>
<!-- 内容区域 -->
<div class="content-scroll">
<!-- 三步立体进度条 -->
<!-- 页面标题区 -->
<div class="page-header">
<h1 class="page-title">上传学信网学籍报告</h1>
<p class="page-subtitle">下载教育部学籍在线验证报告,上传后自动识别认证</p>
</div>
<!-- 报告上传区域 -->
<div class="upload-section">
<div class="upload-area" data-dom-id="upload-area" id="uploadArea">
<div class="upload-icon-wrapper">
<div class="upload-icon-bg"></div>
<div class="upload-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#26C2BB" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="12" y1="18" x2="12" y2="12"></line>
<polyline points="9 15 12 12 15 15"></polyline>
</svg>
</div>
</div>
<div class="upload-title" data-dom-id="btn-upload">点击上传学籍验证报告</div>
<div class="upload-desc">支持 PDF / JPG / PNG 格式,最大10MB</div>
<div class="upload-hint">或拖拽文件到此处上传</div>
</div>
<!-- 已上传状态 -->
<div class="uploaded-state" id="uploadedState" style="margin-top: 8px;">
<div class="uploaded-header">
<div class="file-icon-box">
<svg viewBox="0 0 24 24" fill="none" stroke="#FF6B6B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
</svg>
</div>
<div class="file-info">
<div class="file-name" data-dom-id="file-name">学籍在线验证报告.pdf</div>
<div class="file-size">2.4MB</div>
</div>
<div class="reupload-btn" data-dom-id="btn-reupload" id="btnReupload" title="重新上传">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--youth-gray-600)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="23 4 23 10 17 10"></polyline>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
</div>
</div>
<div class="upload-progress-wrap">
<div class="progress-track">
<div class="progress-fill" data-dom-id="progress-bar" id="progressBar"></div>
</div>
<div class="upload-status">
<span class="status-text uploading" id="statusText">上传中...</span>
<span class="status-percent" id="statusPercent">0%</span>
</div>
</div>
</div>
</div>
<!-- 如何获取报告指引卡片 -->
<div class="guide-card">
<div class="guide-header">
<div class="guide-title">
<svg viewBox="0 0 24 24" fill="none" stroke="#26C2BB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
如何获取学籍验证报告?
</div>
<div class="tutorial-link" data-dom-id="btn-tutorial" id="btnTutorial">
查看教程
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
<div class="guide-steps">
<div class="guide-step">
<div class="step-number">1</div>
<div class="step-content">
<div class="step-main-text">打开学信网,登录账号</div>
<div class="step-sub-text">访问 www.chsi.com.cn</div>
</div>
</div>
<div class="guide-step">
<div class="step-number">2</div>
<div class="step-content">
<div class="step-main-text">在线验证报告 → 申请学籍验证</div>
<div class="step-sub-text">进入学籍查询页面申请</div>
</div>
</div>
<div class="guide-step">
<div class="step-number">3</div>
<div class="step-content">
<div class="step-main-text">下载PDF报告,上传至青核</div>
<div class="step-sub-text">支持有效期内的验证报告</div>
</div>
</div>
</div>
</div>
<!-- 支持的报告类型 -->
<div class="support-section">
<div class="support-title">支持的报告类型</div>
<div class="support-tags">
<div class="support-tag supported">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
教育部学籍在线验证报告
</div>
<div class="support-tag supported">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
学历证书电子注册备案表
</div>
<div class="support-tag unsupported">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
在校证明(不支持)
</div>
</div>
</div>
<!-- 底部占位,确保 flex 布局合理 -->
<div style="flex: 1;"></div>
</div>
<!-- 底部操作区 -->
<div class="bottom-actions">
<button class="btn-primary" data-dom-id="btn-recognize" id="btnRecognize" disabled>开始识别</button>
<button class="btn-prev" data-dom-id="btn-prev" id="btnPrev">上一步</button>
</div>
<!-- 隐藏的文件输入 -->
<input type="file" class="file-input" id="fileInput" accept=".pdf,.jpg,.jpeg,.png">
</div>
<script>
// ===== 返回按钮 =====
document.getElementById('btnBack').addEventListener('click', () => {
window.location.href = 'auth-step1.html';
});
// ===== 上一步按钮 =====
document.getElementById('btnPrev').addEventListener('click', () => {
window.location.href = 'auth-step1.html';
});
// ===== 上传功能 =====
const uploadArea = document.getElementById('uploadArea');
const fileInput = document.getElementById('fileInput');
const uploadedState = document.getElementById('uploadedState');
const progressBar = document.getElementById('progressBar');
const statusText = document.getElementById('statusText');
const statusPercent = document.getElementById('statusPercent');
const btnRecognize = document.getElementById('btnRecognize');
const btnReupload = document.getElementById('btnReupload');
const fileNameEl = document.querySelector('[data-dom-id="file-name"]');
let uploadInProgress = false;
let uploadComplete = false;
function triggerUpload() {
if (uploadInProgress) return;
fileInput.click();
}
uploadArea.addEventListener('click', triggerUpload);
btnReupload.addEventListener('click', (e) => {
e.stopPropagation();
if (uploadInProgress) return;
fileInput.click();
});
fileInput.addEventListener('change', (e) => {
const file = e.target.files[0];
if (!file) return;
// 更新文件名
fileNameEl.textContent = file.name;
// 显示上传状态
uploadedState.classList.add('show');
uploadArea.style.display = 'none';
// 开始上传动画
startUpload();
});
function startUpload() {
uploadInProgress = true;
uploadComplete = false;
btnRecognize.disabled = true;
statusText.textContent = '上传中...';
statusText.className = 'status-text uploading';
progressBar.style.width = '0%';
statusPercent.textContent = '0%';
let progress = 0;
const interval = setInterval(() => {
progress += Math.random() * 15 + 5;
if (progress >= 100) {
progress = 100;
clearInterval(interval);
completeUpload();
}
progressBar.style.width = progress + '%';
statusPercent.textContent = Math.floor(progress) + '%';
}, 200);
}
function completeUpload() {
uploadInProgress = false;
uploadComplete = true;
statusText.textContent = '上传成功';
statusText.className = 'status-text success';
statusPercent.textContent = '';
btnRecognize.disabled = false;
}
// ===== 开始识别按钮 =====
btnRecognize.addEventListener('click', () => {
if (uploadComplete) {
window.location.href = 'auth-step3.html';
}
});
// ===== 查看教程 =====
document.getElementById('btnTutorial').addEventListener('click', () => {
alert('教程功能:将跳转到学信网报告获取指南页面');
});
// ===== 拖拽上传支持 =====
uploadArea.addEventListener('dragover', (e) => {
e.preventDefault();
uploadArea.style.transform = 'scale(0.98)';
});
uploadArea.addEventListener('dragleave', (e) => {
e.preventDefault();
uploadArea.style.transform = 'scale(1)';
});
uploadArea.addEventListener('drop', (e) => {
e.preventDefault();
uploadArea.style.transform = 'scale(1)';
const files = e.dataTransfer.files;
if (files.length > 0) {
fileNameEl.textContent = files[0].name;
uploadedState.classList.add('show');
uploadArea.style.display = 'none';
startUpload();
}
});
</script>
</body>
</html>