Files
jwxt/app/templates/buy.html
T

2292 lines
107 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>{{ brand_name }}</title>
<link rel="icon" href="{{ brand_favicon }}">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
dark: {
bg: '#0a0a0a',
card: '#171717',
border: '#262626'
}
}
}
}
}
</script>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;800;900&family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap"
rel="stylesheet">
<style>
* {
-webkit-tap-highlight-color: transparent;
}
body {
font-family: 'Inter', 'Noto Sans SC', sans-serif;
transition: background-color 0.3s ease, color 0.3s ease;
}
.layer-1 {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.layer-2 {
box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}
.layer-3 {
box-shadow: 0 12px 40px -5px rgba(0, 0, 0, 0.12);
}
.layer-4 {
box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.15);
}
.dark .layer-1 {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.dark .layer-2 {
box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}
.dark .layer-3 {
box-shadow: 0 12px 40px -5px rgba(0, 0, 0, 0.6);
}
.dark .layer-4 {
box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.7);
}
.glass {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.9);
}
.dark .glass {
background: rgba(23, 23, 23, 0.85);
border: 1px solid rgba(38, 38, 38, 0.9);
}
.glass-dark {
background: rgba(17, 17, 17, 0.85);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.dark .glass-dark {
background: rgba(10, 10, 10, 0.9);
border: 1px solid rgba(38, 38, 38, 0.5);
}
.faq-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.active .faq-content {
grid-template-rows: 1fr;
}
.faq-inner {
overflow: hidden;
}
.faq-icon {
transition: transform 0.3s ease;
}
.faq-item.active .faq-icon {
transform: rotate(45deg);
}
.step-number {
font-size: clamp(4rem, 10vw, 8rem);
line-height: 0.85;
font-weight: 900;
color: transparent;
-webkit-text-stroke: 1.5px #111;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
display: inline-block;
}
.dark .step-number {
-webkit-text-stroke: 1.5px #fff;
}
.step-card:hover .step-number {
color: #111;
-webkit-text-stroke: 0px;
}
.dark .step-card:hover .step-number {
color: #fff;
-webkit-text-stroke: 0px;
}
.glass-card-hover {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card-hover:hover {
background: rgba(255, 255, 255, 0.95);
}
.dark .glass-card-hover:hover {
background: rgba(23, 23, 23, 0.95);
}
.btn-primary {
background: #111;
color: #fff;
position: relative;
overflow: hidden;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .btn-primary {
background: #fff;
color: #000;
}
.btn-primary:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}
.btn-primary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
input[type=range] {
-webkit-appearance: none;
width: 100%;
background: transparent;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 20px;
width: 20px;
border-radius: 50%;
background: #111;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
margin-top: -8px;
transition: transform 0.2s;
}
.dark input[type=range]::-webkit-slider-thumb {
background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 4px;
background: linear-gradient(to right, #111 0%, #111 var(--progress), #e5e5e5 var(--progress), #e5e5e5 100%);
border-radius: 2px;
}
.dark input[type=range]::-webkit-slider-runnable-track {
background: linear-gradient(to right, #fff 0%, #fff var(--progress), #404040 var(--progress), #404040 100%);
}
@keyframes price-pop {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
.price-pop {
animation: price-pop 0.3s ease;
}
.reveal {
opacity: 0;
transform: translateY(30px);
transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
opacity: 1;
transform: translateY(0);
}
.bg-grid {
background-size: 40px 40px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}
.dark .bg-grid {
background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}
.tag {
display: inline-flex;
align-items: center;
padding: 0.25rem 0.75rem;
background: rgba(0, 0, 0, 0.05);
border: 1px solid rgba(0, 0, 0, 0.08);
border-radius: 9999px;
font-size: 0.75rem;
font-weight: 500;
transition: all 0.2s;
}
.dark .tag {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.1);
color: #e5e5e5;
}
.dark .tag:hover {
background: #fff;
color: #000;
border-color: #fff;
}
.tag:hover {
background: #111;
color: #fff;
border-color: #111;
}
/* Modal 动画 */
@keyframes modal-enter {
from {
opacity: 0;
transform: translate(-50%, -50%) scale(0.95);
}
to {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
/* 移动端底部弹窗动画 */
@keyframes slide-up {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.modal-animate-desktop {
animation: modal-enter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.modal-animate-mobile {
animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.theme-toggle {
transition: transform 0.3s ease;
}
.theme-toggle:hover {
transform: rotate(15deg);
}
.typewriter-cursor::after {
content: '|';
animation: blink 1s infinite;
color: currentColor;
margin-left: 2px;
}
@keyframes blink {
0%,
50% {
opacity: 1;
}
51%,
100% {
opacity: 0;
}
}
.typing-done::after {
animation: none;
opacity: 0;
}
@keyframes fadeBlurOut {
0% {
opacity: 1;
filter: blur(0px);
transform: scale(1);
}
100% {
opacity: 0;
filter: blur(8px);
transform: scale(0.9);
}
}
@keyframes fadeBlurIn {
0% {
opacity: 0;
filter: blur(8px);
transform: scale(1.1);
}
100% {
opacity: 1;
filter: blur(0px);
transform: scale(1);
}
}
.digit-container {
position: relative;
display: inline-block;
overflow: hidden;
height: 1.2em;
width: 100%;
vertical-align: bottom;
}
.digit-content {
display: inline-block;
will-change: opacity, filter, transform;
}
.digit-fade-out {
animation: fadeBlurOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.digit-fade-in {
animation: fadeBlurIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.tabular-nums {
font-variant-numeric: tabular-nums;
}
.typewriter-blur-in {
opacity: 0;
filter: blur(12px);
transform: translateY(20px);
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
filter 0.8s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.typewriter-blur-in.active {
opacity: 1;
filter: blur(0);
transform: translateY(0);
}
@keyframes charBlurIn {
0% {
opacity: 0;
filter: blur(8px);
transform: translateY(8px);
}
100% {
opacity: 1;
filter: blur(0);
transform: translateY(0);
}
}
.char-blur-in {
display: inline-block;
animation: charBlurIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
/* ========== Toast 通知系统 ========== */
/* 桌面端 - 右上角 */
@media (min-width: 769px) {
.toast-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 9999;
pointer-events: none;
}
.toast {
background: #2c3e50;
color: white;
padding: 14px 22px;
border-radius: 8px;
margin-bottom: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transform: translateX(100%);
opacity: 0;
transition: all 0.3s ease;
pointer-events: all;
min-width: 250px;
max-width: 350px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
.toast.show {
transform: translateX(0);
opacity: 1;
}
}
/* 移动端 - 底部中央(安卓风格) */
@media (max-width: 768px) {
.toast-container {
position: fixed;
bottom: max(20px, env(safe-area-inset-bottom));
left: 50%;
transform: translateX(-50%);
z-index: 9999;
pointer-events: none;
width: 90%;
max-width: 400px;
}
.toast {
background: #2c3e50;
color: white;
padding: 12px 20px;
border-radius: 24px;
margin-bottom: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
transform: translateY(100px);
opacity: 0;
transition: all 0.3s ease;
pointer-events: all;
width: 100%;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
justify-content: center;
gap: 8px;
}
.toast.show {
transform: translateY(0);
opacity: 1;
}
.toast-close {
margin-left: 8px;
cursor: pointer;
font-size: 16px;
opacity: 0.7;
line-height: 1;
}
}
.toast.success {
background: #27ae60;
}
.toast.error {
background: #e74c3c;
}
.toast.info {
background: #3498db;
}
.dark .toast.success {
background: #4caf50;
}
.dark .toast.error {
background: #ff6b6b;
}
.dark .toast.info {
background: #4a9eff;
}
.toast-close:hover {
opacity: 1;
}
.input-field {
width: 100%;
padding: 12px 16px;
border: 2px solid #e5e5e5;
border-radius: 12px;
font-size: 16px;
transition: all 0.3s ease;
background: white;
color: #111;
}
.dark .input-field {
background: #262626;
border-color: #404040;
color: #fff;
}
.input-field:focus {
outline: none;
border-color: #111;
}
.dark .input-field:focus {
border-color: #fff;
}
.input-field::placeholder {
color: #999;
}
.input-label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #333;
font-size: 14px;
}
.dark .input-label {
color: #ccc;
}
.input-error {
border-color: #ef4444 !important;
}
.error-message {
color: #ef4444;
font-size: 12px;
margin-top: 6px;
display: none;
}
.error-message.show {
display: block;
}
/* 推广码输入框样式 */
.invite-code-box {
background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
border: 2px solid #86efac;
border-radius: 12px;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 10px;
}
.dark .invite-code-box {
background: linear-gradient(135deg, #14532d 0%, #166534 100%);
border-color: #22c55e;
}
.invite-code-box.locked {
background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
border-color: #9ca3af;
opacity: 0.8;
}
.dark .invite-code-box.locked {
background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
border-color: #6b7280;
}
.invite-code-input {
background: transparent;
border: none;
font-weight: 600;
color: #166534;
font-size: 16px;
flex: 1;
letter-spacing: 1px;
}
.dark .invite-code-input {
color: #86efac;
}
.invite-code-input:focus {
outline: none;
}
.invite-code-input:disabled {
cursor: not-allowed;
}
.invite-badge {
background: #22c55e;
color: white;
padding: 4px 10px;
border-radius: 20px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.invite-savings {
color: #16a34a;
font-size: 13px;
font-weight: 500;
}
.dark .invite-savings {
color: #86efac;
}
/* ========== 移动端导航菜单 ========== */
.mobile-menu {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
z-index: 100;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.mobile-menu.active {
opacity: 1;
visibility: visible;
}
.mobile-menu-panel {
position: absolute;
top: 0;
right: -100%;
width: 80%;
max-width: 320px;
height: 100%;
background: white;
transition: right 0.3s ease;
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}
.dark .mobile-menu-panel {
background: #171717;
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}
.mobile-menu.active .mobile-menu-panel {
right: 0;
}
.hamburger-btn {
display: none;
flex-direction: column;
justify-content: center;
width: 32px;
height: 32px;
gap: 5px;
cursor: pointer;
padding: 4px;
}
.hamburger-btn span {
display: block;
height: 2px;
background: currentColor;
border-radius: 2px;
transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
transform: rotate(-45deg) translate(5px, -5px);
}
@media (max-width: 768px) {
.hamburger-btn {
display: flex;
}
.desktop-nav-links {
display: none;
}
}
/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
/* 导航栏紧凑布局 */
#navbar .max-w-6xl {
padding-left: 1rem;
padding-right: 1rem;
}
#navbar .font-bold.tracking-tight {
font-size: 14px;
}
/* Hero区域优化 */
.hero-title {
font-size: 2.5rem !important;
line-height: 1.1 !important;
}
/* 倒计时卡片优化 */
.countdown-grid {
gap: 0.5rem !important;
}
.countdown-item {
padding: 0.75rem 0.5rem !important;
height: auto !important;
}
.countdown-digit {
font-size: 1.5rem !important;
}
/* Step卡片优化 */
.step-card {
padding: 1.25rem !important;
}
.step-number {
font-size: 3rem !important;
}
/* FAQ优化 */
.faq-item button {
padding: 1.25rem !important;
font-size: 16px !important;
}
}
/* 安全区域适配 */
.safe-area-inset-bottom {
padding-bottom: env(safe-area-inset-bottom);
}
/* Hero 粒子背景层级:fixed 全屏,后续 section 覆盖 */
#process, #pricing, #faq, footer {
position: relative;
z-index: 1;
}
</style>
</head>
<body class="bg-neutral-50 text-neutral-900 dark:bg-dark-bg dark:text-neutral-100">
<!-- Toast 通知容器 -->
<div class="toast-container" id="toastContainer"></div>
<!-- 移动端菜单 -->
<div class="mobile-menu" id="mobileMenu" onclick="closeMobileMenu(event)">
<div class="mobile-menu-panel" onclick="event.stopPropagation()">
<div class="p-6 h-full flex flex-col">
<div class="flex justify-between items-center mb-8">
<div class="flex items-center gap-3">
<div
class="w-8 h-8 bg-black dark:bg-white rounded-lg flex items-center justify-center text-white dark:text-black font-bold text-sm">
S
</div>
<span class="font-bold">菜单</span>
</div>
<button onclick="closeMobileMenu()"
class="p-2 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-full transition">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<nav class="flex flex-col gap-4">
<a href="#process" onclick="closeMobileMenu()"
class="text-lg font-medium py-3 px-4 rounded-xl hover:bg-neutral-100 dark:hover:bg-neutral-800 transition">流程</a>
<a href="#pricing" onclick="closeMobileMenu()"
class="text-lg font-medium py-3 px-4 rounded-xl hover:bg-neutral-100 dark:hover:bg-neutral-800 transition">定价</a>
<a href="#faq" onclick="closeMobileMenu()"
class="text-lg font-medium py-3 px-4 rounded-xl hover:bg-neutral-100 dark:hover:bg-neutral-800 transition">FAQ</a>
</nav>
<div class="mt-auto pt-6 border-t border-neutral-200 dark:border-neutral-800 flex flex-col gap-3">
<button
onclick="closeMobileMenu(); document.getElementById('pricing').scrollIntoView({behavior: 'smooth'})"
class="w-full py-4 bg-black text-white dark:bg-white dark:text-black text-base font-bold rounded-full">
立即预约
</button>
<button onclick="closeMobileMenu(); goDashboard()"
class="w-full py-4 bg-blue-600 hover:bg-blue-700 text-white text-base font-bold rounded-full shadow-md">
进入仪表盘
</button>
</div>
</div>
</div>
</div>
<!-- 导航 -->
<nav class="fixed w-full z-50 glass border-b border-black/5 dark:border-white/10 layer-1 transition-colors duration-300"
id="navbar">
<div class="max-w-6xl mx-auto px-4 md:px-6 h-16 flex justify-between items-center">
<div class="flex items-center gap-2 md:gap-3 group cursor-pointer shrink-0"
onclick="window.scrollTo({top:0,behavior:'smooth'})">
<div
class="w-8 h-8 bg-black dark:bg-white rounded-lg flex items-center justify-center text-white dark:text-black font-bold text-sm group-hover:rotate-12 transition-transform shrink-0">
{{ brand_name[0] }}</div>
<div class="flex items-center gap-1.5 md:gap-2 min-w-0">
<span class="font-bold tracking-tight text-sm md:text-base truncate">{{ brand_name }}</span>
<span
class="px-2 py-0.5 bg-black text-white dark:bg-white dark:text-black text-[10px] font-bold rounded-full tracking-wide shrink-0"
id="nav-semester">计算中...</span>
</div>
</div>
<div class="flex items-center gap-2 md:gap-6">
<div
class="desktop-nav-links hidden md:flex items-center gap-8 text-sm font-medium text-neutral-600 dark:text-neutral-400">
<a href="#process" class="hover:text-black dark:hover:text-white transition-colors">流程</a>
<a href="#pricing" class="hover:text-black dark:hover:text-white transition-colors">定价</a>
<a href="#faq" class="hover:text-black dark:hover:text-white transition-colors">FAQ</a>
</div>
<button onclick="toggleTheme()"
class="theme-toggle p-2 rounded-full hover:bg-neutral-200 dark:hover:bg-neutral-800 transition-colors shrink-0"
aria-label="切换主题">
<svg id="sun-icon" class="w-5 h-5 hidden dark:block text-neutral-300" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z">
</path>
</svg>
<svg id="moon-icon" class="w-5 h-5 block dark:hidden text-neutral-600" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z">
</path>
</svg>
</button>
<!-- 桌面端仪表盘按钮 -->
<button onclick="goDashboard()"
class="hidden md:block px-5 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-full shadow-md hover:shadow-lg transition-all shrink-0">
仪表盘
</button>
<!-- 桌面端立即预约按钮 -->
<button onclick="document.getElementById('pricing').scrollIntoView({behavior: 'smooth'})"
class="hidden md:block px-5 py-2 bg-black text-white dark:bg-white dark:text-black text-sm font-medium rounded-full hover:shadow-lg transition-all shrink-0">
立即预约
</button>
<!-- 移动端仪表盘按钮 -->
<button onclick="goDashboard()"
class="md:hidden px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white text-xs font-medium rounded-full shrink-0">
仪表盘
</button>
<!-- 移动端汉堡菜单按钮 -->
<button onclick="toggleMobileMenu()" class="hamburger-btn md:hidden shrink-0 ml-2" aria-label="打开菜单">
<span></span>
<span></span>
<span></span>
</button>
</div>
</div>
</nav>
<!-- Hero Section -->
<section
class="relative pt-28 md:pt-32 pb-16 md:pb-20 lg:pt-48 lg:pb-32 px-4 md:px-6 overflow-hidden bg-grid transition-colors duration-300"
id="hero">
<canvas id="hero-particles" class="fixed inset-0 w-full h-full pointer-events-none z-0" aria-hidden="true"></canvas>
<div class="max-w-6xl mx-auto relative z-10">
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8 md:gap-12 items-end">
<div class="lg:col-span-7 space-y-6 md:space-y-8 reveal">
<div
class="inline-flex items-center gap-2 px-3 py-1.5 glass rounded-full text-xs font-medium border border-black/5 dark:border-white/10">
<span class="w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"></span>
后台自动抢课 · 无需守候
</div>
<!-- 打字机标题区域 -->
<h1
class="text-4xl md:text-5xl lg:text-7xl xl:text-8xl font-black leading-[0.9] tracking-tight min-h-[1.2em] hero-title">
<span id="typewriter-line1" class="block typewriter-blur-in typewriter-cursor"></span>
<span id="typewriter-line2"
class="block text-neutral-400 dark:text-neutral-600 typewriter-blur-in typewriter-cursor"></span>
</h1>
<p class="text-base md:text-lg lg:text-xl text-neutral-600 dark:text-neutral-400 max-w-lg leading-relaxed font-light opacity-0 translate-y-4 transition-all duration-700 delay-1000"
id="hero-subtitle">
专为山东管理学院开发的自动化选课系统,支持多任务并行、自动登录、验证码识别、智能线路切换,让抢课变得简单高效。
</p>
<div class="flex flex-wrap gap-3 opacity-0 translate-y-4 transition-all duration-700 delay-1200"
id="hero-buttons">
<button onclick="document.getElementById('pricing').scrollIntoView({behavior: 'smooth'})"
class="btn-primary px-6 md:px-8 py-3 md:py-4 rounded-full text-sm font-bold tracking-wide">
获取授权
</button>
</div>
<div class="flex flex-wrap gap-2 pt-2 md:pt-4 opacity-0 translate-y-4 transition-all duration-700 delay-1400"
id="hero-tags">
<span class="tag">多任务并行</span>
<span class="tag">验证码识别</span>
<span class="tag">自动登录</span>
<span class="tag">智能线路</span>
<span class="tag hidden sm:inline-flex">学期授权</span>
<span class="tag hidden sm:inline-flex">Windows系统</span>
</div>
</div>
<!-- 倒计时卡片 -->
<div class="lg:col-span-5 reveal" style="transition-delay: 0.2s;">
<div
class="glass-dark text-white rounded-2xl md:rounded-3xl p-6 md:p-8 layer-4 relative overflow-hidden">
<div class="relative z-10">
<div class="flex justify-between items-start mb-4 md:mb-5">
<div>
<div class="text-xs uppercase tracking-widest text-neutral-400 mb-1" id="schedule-title">当前阶段</div>
<div class="text-lg md:text-xl font-bold" id="current-phase-badge">
<span class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-green-500/20 text-green-300 text-sm">
<span class="w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"></span>
计算中...
</span>
</div>
</div>
</div>
<!-- 选课时间表 -->
<div class="space-y-2.5 mb-5 text-sm">
<div class="flex justify-between items-center bg-white/5 rounded-xl px-3.5 py-2.5">
<span class="text-neutral-400"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline-block -mt-0.5 mr-1"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>预选阶段</span>
<span class="font-medium" id="pre-date">--</span>
</div>
<div class="flex justify-between items-center bg-white/5 rounded-xl px-3.5 py-2.5">
<span class="text-neutral-400"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline-block -mt-0.5 mr-1"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>正选阶段</span>
<span class="font-medium" id="formal-date">--</span>
</div>
</div>
<!-- 倒计时 -->
<div class="text-xs text-neutral-500 mb-2" id="countdown-label">距离下个阶段</div>
<div class="grid grid-cols-4 gap-2 md:gap-2 text-center mb-4 countdown-grid">
<div class="bg-white/10 rounded-xl md:rounded-2xl p-2 md:p-3 backdrop-blur-sm h-16 md:h-20 flex flex-col justify-center items-center">
<div class="text-lg md:text-xl font-bold tabular-nums" id="cd-days">00</div>
<div class="text-[10px] uppercase text-neutral-400">Days</div>
</div>
<div class="bg-white/10 rounded-xl md:rounded-2xl p-2 md:p-3 backdrop-blur-sm h-16 md:h-20 flex flex-col justify-center items-center">
<div class="text-lg md:text-xl font-bold tabular-nums" id="cd-hours">00</div>
<div class="text-[10px] uppercase text-neutral-400">Hours</div>
</div>
<div class="bg-white/10 rounded-xl md:rounded-2xl p-2 md:p-3 backdrop-blur-sm h-16 md:h-20 flex flex-col justify-center items-center">
<div class="text-lg md:text-xl font-bold tabular-nums" id="cd-mins">00</div>
<div class="text-[10px] uppercase text-neutral-400">Mins</div>
</div>
<div class="bg-white/10 rounded-xl md:rounded-2xl p-2 md:p-3 backdrop-blur-sm h-16 md:h-20 flex flex-col justify-center items-center">
<div class="text-lg md:text-xl font-bold tabular-nums text-neutral-400" id="cd-secs">00</div>
<div class="text-[10px] uppercase text-neutral-400">Secs</div>
</div>
</div>
<div class="text-xs text-neutral-500 dark:text-neutral-400 text-center pt-3 border-t border-white/10">
每年时间大致相同,仅供参考
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Process Steps -->
<section id="process" class="py-16 md:py-24 px-4 md:px-6 bg-grid transition-colors duration-300">
<div class="max-w-6xl mx-auto">
<div class="mb-12 md:mb-20 reveal">
<h2 class="text-2xl md:text-3xl lg:text-5xl font-bold mb-3 md:mb-4 text-neutral-900 dark:text-white">
核心功能与流程</h2>
<p class="text-neutral-500 dark:text-neutral-400 text-base md:text-lg">专为山管学子设计的全自动选课解决方案</p>
</div>
<div class="space-y-6 md:space-y-8">
<div
class="step-card grid grid-cols-1 md:grid-cols-12 gap-4 md:gap-6 p-5 md:p-6 rounded-2xl md:rounded-3xl glass transition-all reveal layer-1 hover:layer-3 glass-card-hover">
<div class="md:col-span-3"><span class="step-number">01</span></div>
<div class="md:col-span-6">
<h3 class="text-xl md:text-2xl font-bold mb-2 md:mb-3 text-neutral-900 dark:text-white">智能自动登录
</h3>
<p class="text-sm md:text-base text-neutral-600 dark:text-neutral-400 mb-3 md:mb-4">
集成OCR验证码识别技术,自动填写用户名、密码和验证码,支持多入口线路智能切换,避开拥堵入口,提高登录成功率。
</p>
<div class="flex flex-wrap gap-2">
<span class="tag">验证码自动识别</span>
<span class="tag">多线路智能选择</span>
<span class="tag hidden sm:inline-flex">自动重试机制</span>
</div>
</div>
<div class="md:col-span-3 flex items-center justify-start md:justify-end">
<div
class="glass p-3 md:p-4 rounded-xl md:rounded-2xl layer-2 font-mono text-xs text-neutral-500 dark:text-neutral-400">
10.224.2.164<br>10.224.2.186<br>jwxt.sdmu.edu.cn</div>
</div>
</div>
<div
class="step-card grid grid-cols-1 md:grid-cols-12 gap-4 md:gap-6 p-5 md:p-6 rounded-2xl md:rounded-3xl glass transition-all reveal layer-1 hover:layer-3 glass-card-hover">
<div class="md:col-span-3"><span class="step-number">02</span></div>
<div class="md:col-span-6">
<h3 class="text-xl md:text-2xl font-bold mb-2 md:mb-3 text-neutral-900 dark:text-white">多任务并行抢课
</h3>
<p class="text-sm md:text-base text-neutral-600 dark:text-neutral-400 mb-3 md:mb-4">
支持同时监控多个课程类别,按优先级自动轮询。可设置通识选修网络课、通识选修课、英语分项等课程,智能选择最佳教学时间段。
</p>
</div>
<div class="md:col-span-3 flex items-center justify-start md:justify-end">
<div
class="w-14 h-14 md:w-16 md:h-16 rounded-xl md:rounded-2xl bg-neutral-100 dark:bg-neutral-800 flex items-center justify-center layer-1 text-neutral-900 dark:text-white font-bold text-lg">
多</div>
</div>
</div>
<div
class="step-card grid grid-cols-1 md:grid-cols-12 gap-4 md:gap-6 p-5 md:p-6 rounded-2xl md:rounded-3xl glass transition-all reveal layer-1 hover:layer-3 glass-card-hover">
<div class="md:col-span-3"><span class="step-number">03</span></div>
<div class="md:col-span-6">
<h3 class="text-xl md:text-2xl font-bold mb-2 md:mb-3 text-neutral-900 dark:text-white">自动化执行与监控
</h3>
<p class="text-sm md:text-base text-neutral-600 dark:text-neutral-400 mb-3 md:mb-4">
系统后台自动运行,无需守候。每秒刷新监控课程余量,发现可选项自动选择并确认,全程无需人工干预。
</p>
</div>
<div class="md:col-span-3 flex items-center justify-start md:justify-end">
<div class="text-right">
<div class="text-2xl md:text-3xl font-black text-neutral-200 dark:text-neutral-700">24/7
</div>
<div class="text-xs text-neutral-500 uppercase tracking-wider">全天候监控</div>
</div>
</div>
</div>
<div
class="step-card grid grid-cols-1 md:grid-cols-12 gap-4 md:gap-6 p-5 md:p-6 rounded-2xl md:rounded-3xl glass transition-all reveal layer-1 hover:layer-3 glass-card-hover">
<div class="md:col-span-3"><span class="step-number">04</span></div>
<div class="md:col-span-6">
<h3 class="text-xl md:text-2xl font-bold mb-2 md:mb-3 text-neutral-900 dark:text-white">完善的管理功能
</h3>
<p class="text-sm md:text-base text-neutral-600 dark:text-neutral-400 mb-3 md:mb-4">
登录信息加密存储、实时状态监控、详细日志输出,提供完整的自动化抢课体验。
</p>
</div>
<div class="md:col-span-3 flex items-center justify-start md:justify-end">
<div
class="w-14 h-14 md:w-16 md:h-16 rounded-xl md:rounded-2xl bg-neutral-900 dark:bg-white text-white dark:text-black flex items-center justify-center layer-3 font-bold text-xl">
✓</div>
</div>
</div>
</div>
</div>
</section>
<!-- Pricing -->
<section id="pricing" class="py-16 md:py-24 px-4 md:px-6 bg-grid transition-colors duration-300">
<div class="max-w-6xl mx-auto">
<div class="text-center mb-10 md:mb-16 reveal">
<h2 class="text-2xl md:text-3xl lg:text-5xl font-bold mb-3 md:mb-4 text-neutral-900 dark:text-white">
学期授权定价</h2>
<p class="text-neutral-500 dark:text-neutral-400 text-base md:text-lg">一学期一次授权,覆盖预选、正选、补退选全流程</p>
</div>
<div class="grid grid-cols-1 lg:grid-cols-12 gap-6 md:gap-8">
<div class="lg:col-span-5 space-y-6 md:space-y-8 reveal">
<div
class="glass rounded-2xl md:rounded-3xl p-6 md:p-8 layer-3 border border-neutral-200 dark:border-dark-border">
<!-- 推广码区域 -->
<div id="invite-section" class="mb-6 hidden">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-neutral-600 dark:text-neutral-400">优惠码</span>
<span id="invite-savings" class="invite-savings"></span>
</div>
<div class="invite-code-box locked" id="invite-box">
<svg class="w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7">
</path>
</svg>
<input type="text" id="invite-code-input" class="invite-code-input" value="" disabled
placeholder="输入优惠码">
<span class="invite-badge">已应用</span>
</div>
<p class="text-xs text-neutral-500 dark:text-neutral-400 mt-2" id="invite-info"></p>
</div>
<div
class="bg-blue-50 dark:bg-blue-900/20 border border-blue-100 dark:border-blue-800 rounded-xl p-4 mb-6">
<div class="text-sm font-bold text-blue-900 dark:text-blue-300 mb-1">提前预约优惠</div>
<div class="text-xs text-blue-700 dark:text-blue-400">距离下次抢课还有 <span id="auto-days-display"
class="font-bold">--</span> 天,提前预约享折扣优惠</div>
</div>
<div class="space-y-6">
<div>
<div class="flex justify-between mb-2 text-sm font-medium">
<span class="text-neutral-600 dark:text-neutral-400">提前预约天数</span>
<span
class="bg-black text-white dark:bg-white dark:text-black px-3 py-1 rounded-full text-xs"
id="time-label">提前--天</span>
</div>
<input type="range" id="time-slider" min="0" max="180" value="0" class="w-full" readonly
style="pointer-events: none; opacity: 0.6;">
<div class="flex justify-between text-xs text-neutral-400 dark:text-neutral-500 mt-1">
<span>当天 ¥20</span>
<span>提前180天 ¥8</span>
</div>
</div>
<div>
<div class="flex justify-between mb-2 text-sm font-medium">
<span class="text-neutral-600 dark:text-neutral-400">购买数量</span>
<div
class="flex items-center gap-3 bg-neutral-100 dark:bg-neutral-800 rounded-full px-2 py-1">
<button onclick="adjustQty(-1)"
class="w-8 h-8 rounded-full bg-white dark:bg-neutral-700 shadow-sm flex items-center justify-center hover:shadow transition text-neutral-900 dark:text-white text-lg font-bold">−</button>
<input type="number" id="qty-input" value="1" min="1" max="50" readonly
class="w-12 text-center bg-transparent font-bold text-neutral-900 dark:text-white">
<button onclick="adjustQty(1)"
class="w-8 h-8 rounded-full bg-white dark:bg-neutral-700 shadow-sm flex items-center justify-center hover:shadow transition text-neutral-900 dark:text-white text-lg font-bold">+</button>
</div>
</div>
</div>
<div class="border-t border-neutral-200 dark:border-neutral-700 pt-4 space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-neutral-500 dark:text-neutral-400">原价</span>
<span class="line-through text-neutral-400 dark:text-neutral-600">¥20</span>
</div>
<div class="flex justify-between text-green-600 dark:text-green-400"
id="time-discount-row">
<span>提前预约优惠</span>
<span>-¥<span id="time-save">--</span></span>
</div>
<div class="flex justify-between text-green-600 dark:text-green-400 hidden"
id="bulk-row">
<span>团购优惠</span>
<span>-¥<span id="bulk-save">0</span></span>
</div>
<!-- 推广优惠行 -->
<div class="flex justify-between text-orange-600 dark:text-orange-400 hidden"
id="invite-row">
<span>推广优惠</span>
<span>-¥<span id="invite-save">0</span></span>
</div>
<div
class="flex justify-between items-end border-t border-neutral-200 dark:border-neutral-700 pt-3 mt-2">
<span class="font-bold text-neutral-900 dark:text-white">合计</span>
<span
class="text-2xl md:text-3xl font-black price-pop text-neutral-900 dark:text-white"
id="total-price">--</span>
</div>
<div class="text-xs text-neutral-400 dark:text-neutral-500 text-right">人均 ¥<span
id="per-price">--</span></div>
</div>
<button id="buy-now-btn" onclick="showEmailModal()"
class="w-full btn-primary py-4 rounded-full text-sm font-bold">立即购买(支付宝支付)</button>
<p class="text-xs text-center text-neutral-400 dark:text-neutral-500">授权仅限当前学期使用</p>
</div>
</div>
</div>
<div class="lg:col-span-7 reveal" style="transition-delay: 0.1s;">
<div
class="glass rounded-2xl md:rounded-3xl p-6 md:p-8 layer-2 h-full border border-neutral-200 dark:border-dark-border">
<h3 class="text-lg md:text-xl font-bold mb-4 md:mb-6 text-neutral-900 dark:text-white">功能特色</h3>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 md:gap-4 mb-6 md:mb-8">
<div
class="p-3 md:p-4 rounded-xl md:rounded-2xl glass transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<div class="font-bold mb-1 text-neutral-900 dark:text-white">全自动登录</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400">OCR验证码识别,多线路智能切换
</div>
</div>
<div
class="p-3 md:p-4 rounded-xl md:rounded-2xl glass transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<div class="font-bold mb-1 text-neutral-900 dark:text-white">多任务并行</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400">同时监控多个课程,优先级轮询
</div>
</div>
<div
class="p-3 md:p-4 rounded-xl md:rounded-2xl glass transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<div class="font-bold mb-1 text-neutral-900 dark:text-white">智能选课</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400">自动筛选可选课程,按设定顺序选择
</div>
</div>
<div
class="p-3 md:p-4 rounded-xl md:rounded-2xl glass transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<div class="font-bold mb-1 text-neutral-900 dark:text-white">自动更新</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400">自动检测新版本,保持功能最新
</div>
</div>
<div
class="p-3 md:p-4 rounded-xl md:rounded-2xl glass transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<div class="font-bold mb-1 text-neutral-900 dark:text-white">详细日志</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400">完整操作日志,方便追踪与调试
</div>
</div>
</div>
<div
class="bg-neutral-900 dark:bg-white text-white dark:text-black p-5 md:p-6 rounded-xl md:rounded-2xl">
<div class="flex items-center gap-3 mb-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span class="font-bold">系统说明</span>
</div>
<p class="text-xs md:text-sm text-neutral-400 dark:text-neutral-600 leading-relaxed">
基于 Flask + 后台任务调度开发的 Web 选课系统,专为山东管理学院选课系统优化。
通过浏览器访问即可使用,无需安装任何软件。授权码按学期提供,覆盖预选、正选、补退选全阶段。
登录信息加密存储,确保账号安全。
</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- FAQ -->
<section id="faq" class="py-16 md:py-24 px-4 md:px-6 bg-grid transition-colors duration-300">
<div class="max-w-3xl mx-auto">
<h2 class="text-2xl md:text-3xl font-bold mb-8 md:mb-12 reveal text-neutral-900 dark:text-white">常见问题</h2>
<div class="space-y-2 md:space-y-3 reveal">
<div
class="faq-item rounded-xl md:rounded-2xl glass layer-1 overflow-hidden transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<button
class="w-full p-5 md:p-6 flex justify-between items-center text-left font-bold text-base md:text-lg text-neutral-900 dark:text-white"
onclick="toggleFaq(this)">
<span>系统授权能用多久?</span>
<svg class="w-5 h-6 md:w-6 md:h-6 faq-icon text-neutral-400 flex-shrink-0 ml-4" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</button>
<div class="faq-content">
<div class="faq-inner">
<div class="px-5 md:px-6 pb-5 md:pb-6 text-sm md:text-base text-neutral-600 dark:text-neutral-400 leading-relaxed typewriter-target typewriter-blur-in"
data-text="系统采用学期授权制,每个授权码仅限当前学期使用(包括预选、正选和补退选阶段)。学期结束后授权自动失效,下次选课需重新购买。建议提前预约以获得最大优惠。">
</div>
</div>
</div>
</div>
<div
class="faq-item rounded-xl md:rounded-2xl glass layer-1 overflow-hidden transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<button
class="w-full p-5 md:p-6 flex justify-between items-center text-left font-bold text-base md:text-lg text-neutral-900 dark:text-white"
onclick="toggleFaq(this)">
<span>系统支持什么设备访问?需要安装吗?</span>
<svg class="w-5 h-6 md:w-6 md:h-6 faq-icon text-neutral-400 flex-shrink-0 ml-4" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</button>
<div class="faq-content">
<div class="faq-inner">
<div class="px-5 md:px-6 pb-5 md:pb-6 text-sm md:text-base text-neutral-600 dark:text-neutral-400 leading-relaxed typewriter-target typewriter-blur-in"
data-text="通过浏览器访问即可使用,支持电脑、手机、平板等各种设备。无需安装任何软件,数据实时同步,随时随地查看抢课状态。">
</div>
</div>
</div>
</div>
<div
class="faq-item rounded-xl md:rounded-2xl glass layer-1 overflow-hidden transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<button
class="w-full p-5 md:p-6 flex justify-between items-center text-left font-bold text-base md:text-lg text-neutral-900 dark:text-white"
onclick="toggleFaq(this)">
<span>系统如何保证账号安全?</span>
<svg class="w-5 h-6 md:w-6 md:h-6 faq-icon text-neutral-400 flex-shrink-0 ml-4" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</button>
<div class="faq-content">
<div class="faq-inner">
<div class="px-5 md:px-6 pb-5 md:pb-6 text-sm md:text-base text-neutral-600 dark:text-neutral-400 leading-relaxed typewriter-target typewriter-blur-in"
data-text="登录信息采用加密存储,账号密码仅用于教务系统登录验证,不会上传到其他服务器。后台运行在独立服务器上,确保安全可靠。">
</div>
</div>
</div>
</div>
<div
class="faq-item rounded-xl md:rounded-2xl glass layer-1 overflow-hidden transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<button
class="w-full p-5 md:p-6 flex justify-between items-center text-left font-bold text-base md:text-lg text-neutral-900 dark:text-white"
onclick="toggleFaq(this)">
<span>系统支持哪些课程类型的抢课?</span>
<svg class="w-5 h-6 md:w-6 md:h-6 faq-icon text-neutral-400 flex-shrink-0 ml-4" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</button>
<div class="faq-content">
<div class="faq-inner">
<div class="px-5 md:px-6 pb-5 md:pb-6 text-sm md:text-base text-neutral-600 dark:text-neutral-400 leading-relaxed typewriter-target typewriter-blur-in"
data-text="系统专门针对山东管理学院选课系统开发,支持通识选修网络课、通识选修课、英语分项等多种课程类型。可以同时监控多个课程,按优先级自动选择。">
</div>
</div>
</div>
</div>
<div
class="faq-item rounded-xl md:rounded-2xl glass layer-1 overflow-hidden transition-all hover:border-neutral-200 dark:hover:border-neutral-700">
<button
class="w-full p-5 md:p-6 flex justify-between items-center text-left font-bold text-base md:text-lg text-neutral-900 dark:text-white"
onclick="toggleFaq(this)">
<span>购买后如何收到兑换码?</span>
<svg class="w-5 h-6 md:w-6 md:h-6 faq-icon text-neutral-400 flex-shrink-0 ml-4" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</button>
<div class="faq-content">
<div class="faq-inner">
<div class="px-5 md:px-6 pb-5 md:pb-6 text-sm md:text-base text-neutral-600 dark:text-neutral-400 leading-relaxed typewriter-target typewriter-blur-in"
data-text="购买时填写的邮箱会自动收到包含兑换码和下载链接的邮件。支付成功后,系统会在1-3分钟内自动发送邮件。请确保邮箱地址准确无误,建议使用常用邮箱如QQ邮箱、163邮箱等。如果未收到邮件,请检查垃圾邮件箱或联系客服。">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer
class="py-8 md:py-12 px-4 md:px-6 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-dark-bg transition-colors duration-300 safe-area-inset-bottom">
<div class="max-w-6xl mx-auto flex flex-col md:flex-row justify-between items-center gap-4">
<div class="flex items-center gap-2">
<div class="text-xl md:text-2xl font-black tracking-tight text-neutral-900 dark:text-white">{{ brand_name }}
</div>
<span
class="px-2 py-0.5 bg-black text-white dark:bg-white dark:text-black text-[10px] font-bold rounded-full"
id="footer-semester">计算中...</span>
</div>
<div class="text-xs md:text-sm text-neutral-500 dark:text-neutral-400 text-center md:text-right">
<p>山东管理学院全自动抢课系统 · 专为山管学子设计</p>
<p class="mt-1">后台自动抢课 · 无需守候 · 智能线路切换</p>
</div>
</div>
</footer>
<!-- Email Modal - 邮箱输入弹窗 -->
<!-- 桌面端:居中模态框 | 移动端:底部弹窗 -->
<div id="emailModal" class="fixed inset-0 z-50 hidden">
<div class="absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity" onclick="closeEmailModal()"></div>
<!-- 桌面端模态框 -->
<div id="emailModalDesktop"
class="hidden md:block absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-white dark:bg-dark-card rounded-3xl layer-4 modal-animate-desktop border border-neutral-200 dark:border-dark-border overflow-hidden p-8">
<button onclick="closeEmailModal()"
class="absolute top-4 right-4 w-8 h-8 flex items-center justify-center rounded-full hover:bg-neutral-100 dark:hover:bg-neutral-800 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 transition-colors text-2xl leading-none">&times;</button>
<div class="text-xs font-bold text-neutral-400 uppercase tracking-widest mb-2">Confirm Purchase</div>
<h3 class="text-2xl font-bold mb-2 text-neutral-900 dark:text-white">确认订单信息</h3>
<!-- 推广信息展示 -->
<div id="modal-invite-info-desktop"
class="bg-orange-50 dark:bg-orange-900/20 border border-orange-100 dark:border-orange-800 rounded-xl p-3 mb-4 hidden">
<div class="flex items-center gap-2 text-sm">
<svg class="w-4 h-4 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7">
</path>
</svg>
<span class="text-orange-800 dark:text-orange-200">已应用优惠</span>
</div>
</div>
<div class="bg-neutral-50 dark:bg-neutral-800/50 rounded-xl p-4 mb-6 space-y-2">
<div class="flex justify-between text-sm">
<span class="text-neutral-500 dark:text-neutral-400">购买数量</span>
<span class="font-bold text-neutral-900 dark:text-white" id="modal-qty-desktop">1 份</span>
</div>
<div class="flex justify-between text-sm">
<span class="text-neutral-500 dark:text-neutral-400">合计金额</span>
<span class="font-bold text-2xl text-neutral-900 dark:text-white"
id="modal-total-desktop">¥--</span>
</div>
</div>
<div class="mb-6">
<label class="input-label">
接收邮箱 <span class="text-red-500">*</span>
</label>
<input type="email" id="emailInputDesktop" class="input-field" placeholder="请输入您的邮箱地址(如:qq@qq.com)"
onblur="validateEmail('desktop')">
<div class="error-message" id="emailErrorDesktop">请输入有效的邮箱地址</div>
<p class="text-xs text-neutral-400 dark:text-neutral-500 mt-2">
支付成功后,兑换码和下载链接将自动发送到此邮箱
</p>
</div>
<!-- 协议勾选 -->
<label class="flex items-start gap-2.5 cursor-pointer select-none mb-4" id="termsLabelDesktop">
<div class="flex-shrink-0 mt-0.5">
<input type="checkbox" id="agreeTermsDesktop" class="sr-only" onchange="updateBuyCheckbox('desktop', this)">
<div id="checkboxBoxDesktop" class="w-[18px] h-[18px] rounded border-2 border-neutral-300 dark:border-neutral-600 transition-all flex items-center justify-center">
<svg id="checkIconDesktop" class="w-2.5 h-2.5 text-white dark:text-black hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/>
</svg>
</div>
</div>
<span class="text-xs text-neutral-500 dark:text-neutral-400 leading-relaxed">
我已阅读并同意
<a href="/terms" target="_blank" onclick="event.stopPropagation()" class="text-neutral-700 dark:text-neutral-300 font-medium underline underline-offset-2 hover:text-black dark:hover:text-white">用户服务协议</a>
和
<a href="/privacy" target="_blank" onclick="event.stopPropagation()" class="text-neutral-700 dark:text-neutral-300 font-medium underline underline-offset-2 hover:text-black dark:hover:text-white">隐私政策</a>
</span>
</label>
<div class="flex gap-3">
<button onclick="closeEmailModal()"
class="flex-1 py-3 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 font-medium hover:bg-neutral-200 dark:hover:bg-neutral-700 transition">
取消
</button>
<button onclick="submitOrder('desktop')"
class="flex-1 py-3 rounded-xl bg-black dark:bg-white text-white dark:text-black font-bold hover:shadow-lg transition">
确认支付
</button>
</div>
</div>
<!-- 移动端底部弹窗 -->
<div id="emailModalMobile"
class="md:hidden absolute bottom-0 left-0 right-0 bg-white dark:bg-dark-card rounded-t-3xl layer-4 modal-animate-mobile border-t border-neutral-200 dark:border-dark-border overflow-hidden max-h-[90vh] overflow-y-auto">
<!-- 拖动指示器 -->
<div class="w-full flex justify-center pt-3 pb-2" onclick="closeEmailModal()">
<div class="w-12 h-1.5 bg-neutral-300 dark:bg-neutral-600 rounded-full"></div>
</div>
<div class="px-5 pb-8 pt-2">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-neutral-900 dark:text-white">确认订单</h3>
<button onclick="closeEmailModal()"
class="w-8 h-8 flex items-center justify-center rounded-full hover:bg-neutral-100 dark:hover:bg-neutral-800 text-neutral-400 transition-colors text-2xl leading-none">&times;</button>
</div>
<!-- 推广信息展示 -->
<div id="modal-invite-info-mobile"
class="bg-orange-50 dark:bg-orange-900/20 border border-orange-100 dark:border-orange-800 rounded-xl p-3 mb-4 hidden">
<div class="flex items-center gap-2 text-sm">
<svg class="w-4 h-4 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7">
</path>
</svg>
<span class="text-orange-800 dark:text-orange-200">已应用优惠</span>
</div>
</div>
<div class="bg-neutral-50 dark:bg-neutral-800/50 rounded-xl p-4 mb-5 space-y-3">
<div class="flex justify-between text-sm">
<span class="text-neutral-500 dark:text-neutral-400">购买数量</span>
<span class="font-bold text-neutral-900 dark:text-white" id="modal-qty-mobile">1 份</span>
</div>
<div class="flex justify-between items-center">
<span class="text-neutral-500 dark:text-neutral-400 text-sm">合计金额</span>
<span class="font-bold text-2xl text-neutral-900 dark:text-white"
id="modal-total-mobile">¥--</span>
</div>
</div>
<div class="mb-5">
<label class="input-label">
接收邮箱 <span class="text-red-500">*</span>
</label>
<input type="email" id="emailInputMobile" class="input-field" placeholder="请输入您的邮箱地址"
onblur="validateEmail('mobile')">
<div class="error-message" id="emailErrorMobile">请输入有效的邮箱地址</div>
<p class="text-xs text-neutral-400 dark:text-neutral-500 mt-2">
支付成功后,兑换码和下载链接将自动发送到此邮箱
</p>
</div>
<!-- 协议勾选 -->
<label class="flex items-start gap-2.5 cursor-pointer select-none mb-4" id="termsLabelMobile">
<div class="flex-shrink-0 mt-0.5">
<input type="checkbox" id="agreeTermsMobile" class="sr-only" onchange="updateBuyCheckbox('mobile', this)">
<div id="checkboxBoxMobile" class="w-[18px] h-[18px] rounded border-2 border-neutral-300 dark:border-neutral-600 transition-all flex items-center justify-center">
<svg id="checkIconMobile" class="w-2.5 h-2.5 text-white dark:text-black hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/>
</svg>
</div>
</div>
<span class="text-xs text-neutral-500 dark:text-neutral-400 leading-relaxed">
我已阅读并同意
<a href="/terms" target="_blank" onclick="event.stopPropagation()" class="text-neutral-700 dark:text-neutral-300 font-medium underline underline-offset-2 hover:text-black dark:hover:text-white">用户服务协议</a>
和
<a href="/privacy" target="_blank" onclick="event.stopPropagation()" class="text-neutral-700 dark:text-neutral-300 font-medium underline underline-offset-2 hover:text-black dark:hover:text-white">隐私政策</a>
</span>
</label>
<div class="flex gap-3">
<button onclick="closeEmailModal()"
class="flex-1 py-3.5 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 font-medium hover:bg-neutral-200 dark:hover:bg-neutral-700 transition">
取消
</button>
<button onclick="submitOrder('mobile')"
class="flex-1 py-3.5 rounded-xl bg-black dark:bg-white text-white dark:text-black font-bold hover:shadow-lg transition">
确认支付
</button>
</div>
</div>
</div>
</div>
<script>
// 全局变量存储推广码信息
let currentInviteCode = null;
let currentInviterName = null;
let inviteDiscountPerUnit = 2; // 默认每人减2元
// ===== 协议勾选 =====
function updateBuyCheckbox(device, input) {
const box = document.getElementById('checkboxBox' + (device === 'desktop' ? 'Desktop' : 'Mobile'));
const icon = document.getElementById('checkIcon' + (device === 'desktop' ? 'Desktop' : 'Mobile'));
if (input.checked) {
box.classList.remove('border-neutral-300', 'dark:border-neutral-600');
box.classList.add('bg-black', 'border-black', 'dark:bg-white', 'dark:border-white');
icon.classList.remove('hidden');
} else {
box.classList.add('border-neutral-300', 'dark:border-neutral-600');
box.classList.remove('bg-black', 'border-black', 'dark:bg-white', 'dark:border-white');
icon.classList.add('hidden');
}
}
// 弹窗打开时重置协议勾选状态
function resetTermsCheckbox() {
['Desktop', 'Mobile'].forEach(suffix => {
const cb = document.getElementById('agreeTerms' + suffix);
const box = document.getElementById('checkboxBox' + suffix);
const icon = document.getElementById('checkIcon' + suffix);
if (cb) cb.checked = false;
if (box) {
box.classList.add('border-neutral-300', 'dark:border-neutral-600');
box.classList.remove('bg-black', 'border-black', 'dark:bg-white', 'dark:border-white');
}
if (icon) icon.classList.add('hidden');
});
}
// 移动端菜单控制
function toggleMobileMenu() {
const menu = document.getElementById('mobileMenu');
const btn = document.querySelector('.hamburger-btn');
menu.classList.toggle('active');
btn.classList.toggle('active');
document.body.style.overflow = menu.classList.contains('active') ? 'hidden' : '';
}
function closeMobileMenu(event) {
if (event && event.target !== document.getElementById('mobileMenu')) return;
const menu = document.getElementById('mobileMenu');
const btn = document.querySelector('.hamburger-btn');
menu.classList.remove('active');
btn.classList.remove('active');
document.body.style.overflow = '';
}
// 主题切换
function initTheme() {
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
}
function toggleTheme() {
if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark');
localStorage.theme = 'light';
} else {
document.documentElement.classList.add('dark');
localStorage.theme = 'dark';
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
if (!localStorage.theme) {
if (e.matches) document.documentElement.classList.add('dark');
else document.documentElement.classList.remove('dark');
}
});
initTheme();
// ===== Toast 通知系统 =====
function showToast(message, type = 'info', duration = 3000) {
const container = document.getElementById('toastContainer');
const toast = document.createElement('div');
toast.className = `toast ${type}`;
// 移动端不显示关闭按钮,符合安卓风格
const isMobile = window.innerWidth <= 768;
if (isMobile) {
toast.innerHTML = `<span>${message}</span>`;
} else {
toast.innerHTML = `
<span>${message}</span>
<span class="toast-close" onclick="this.parentElement.remove()">&times;</span>
`;
}
container.appendChild(toast);
setTimeout(() => toast.classList.add('show'), 10);
setTimeout(() => {
toast.classList.remove('show');
setTimeout(() => toast.remove(), 400);
}, duration);
return toast;
}
// ===== 从URL获取推广码并验证 =====
async function checkInviteCode() {
const urlParams = new URLSearchParams(window.location.search);
// 支持 invitecode 和 invite_code 两种参数名
const code = urlParams.get('invitecode') || urlParams.get('invite_code');
if (!code) {
console.log('URL中没有推广码参数');
return;
}
console.log('检测到推广码:', code);
try {
const response = await fetch(`/api/verify-invite-code?code=${encodeURIComponent(code)}`);
const data = await response.json();
console.log('推广码验证结果:', data);
if (data.valid) {
currentInviteCode = code.toUpperCase();
currentInviterName = data.name;
inviteDiscountPerUnit = data.discount_amount || 2;
document.getElementById('invite-section').classList.remove('hidden');
document.getElementById('invite-code-input').value = code.toUpperCase();
document.getElementById('invite-savings').textContent = `每人减¥${inviteDiscountPerUnit}`;
document.getElementById('invite-info').textContent = `推广人: ${data.name}`;
updateUI();
showToast(`已应用 ${data.name} 的推广优惠`, 'success');
} else {
showToast('优惠码无效或已过期', 'error');
}
} catch (error) {
console.error('验证推广码失败:', error);
showToast('验证推广码失败,请检查网络连接', 'error');
}
}
// ===== 邮箱弹窗逻辑 =====
function showEmailModal() {
const qty = parseInt(document.getElementById('qty-input').value);
const total = document.getElementById('total-price').textContent;
const isMobile = window.innerWidth <= 768;
// 根据设备类型显示对应弹窗
document.getElementById('emailModal').classList.remove('hidden');
resetTermsCheckbox();
if (isMobile) {
document.getElementById('emailModalDesktop').classList.add('hidden');
document.getElementById('emailModalMobile').classList.remove('hidden');
document.getElementById('modal-qty-mobile').textContent = qty + ' 份';
document.getElementById('modal-total-mobile').textContent = '¥' + total;
if (currentInviteCode && currentInviterName) {
document.getElementById('modal-invite-info-mobile').classList.remove('hidden');
} else {
document.getElementById('modal-invite-info-mobile').classList.add('hidden');
}
document.getElementById('emailInputMobile').focus();
} else {
document.getElementById('emailModalDesktop').classList.remove('hidden');
document.getElementById('emailModalMobile').classList.add('hidden');
document.getElementById('modal-qty-desktop').textContent = qty + ' 份';
document.getElementById('modal-total-desktop').textContent = '¥' + total;
if (currentInviteCode && currentInviterName) {
document.getElementById('modal-invite-info-desktop').classList.remove('hidden');
} else {
document.getElementById('modal-invite-info-desktop').classList.add('hidden');
}
document.getElementById('emailInputDesktop').focus();
}
}
function closeEmailModal() {
document.getElementById('emailModal').classList.add('hidden');
document.getElementById('emailInputDesktop').value = '';
document.getElementById('emailInputMobile').value = '';
document.getElementById('emailInputDesktop').classList.remove('input-error');
document.getElementById('emailInputMobile').classList.remove('input-error');
document.getElementById('emailErrorDesktop').classList.remove('show');
document.getElementById('emailErrorMobile').classList.remove('show');
}
function validateEmail(device) {
const inputId = device === 'mobile' ? 'emailInputMobile' : 'emailInputDesktop';
const errorId = device === 'mobile' ? 'emailErrorMobile' : 'emailErrorDesktop';
const email = document.getElementById(inputId).value.trim();
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const isValid = emailRegex.test(email);
const input = document.getElementById(inputId);
const error = document.getElementById(errorId);
if (!isValid && email !== '') {
input.classList.add('input-error');
error.classList.add('show');
} else {
input.classList.remove('input-error');
error.classList.remove('show');
}
return isValid;
}
// ===== 提交订单 =====
async function submitOrder(device) {
const inputId = device === 'mobile' ? 'emailInputMobile' : 'emailInputDesktop';
const email = document.getElementById(inputId).value.trim();
// 验证协议勾选
const termsCbId = device === 'mobile' ? 'agreeTermsMobile' : 'agreeTermsDesktop';
if (!document.getElementById(termsCbId).checked) {
showToast('请先阅读并同意用户服务协议和隐私政策', 'error', 3000);
return;
}
if (!email) {
showToast('请输入邮箱地址', 'error', 3000);
document.getElementById(inputId).focus();
return;
}
if (!validateEmail(device)) {
showToast('请输入有效的邮箱地址', 'error', 3000);
return;
}
const qty = parseInt(document.getElementById('qty-input').value);
const total = parseInt(document.getElementById('total-price').textContent);
showToast('正在创建支付订单...', 'info', 2000);
const formData = new FormData();
formData.append('amount', total);
formData.append('quantity', qty);
formData.append('email', email);
if (currentInviteCode) {
formData.append('invite_code', currentInviteCode);
}
try {
const response = await fetch('/create-pay-order', {
method: 'POST',
body: formData
});
const data = await response.json();
if (data.error || !data.orderNo) {
showToast(data.error || '创建订单失败', 'error', 3000);
return;
}
const form = document.createElement('form');
form.method = 'POST';
form.action = data.api_url;
form.target = '_self';
form.style.display = 'none';
const fields = [
'merchantNum', 'orderNo', 'amount', 'notifyUrl',
'returnUrl', 'payType', 'sign', 'returnType',
'subject', 'body', 'attch'
];
fields.forEach(field => {
if (data[field]) {
const input = document.createElement('input');
input.type = 'hidden';
input.name = field;
input.value = data[field];
form.appendChild(input);
}
});
document.body.appendChild(form);
showToast('正在跳转至支付页面...', 'success', 1500);
setTimeout(() => {
form.submit();
}, 500);
} catch (error) {
console.error('支付请求失败:', error);
showToast('网络错误,请检查连接后重试', 'error', 3000);
}
}
// ===== 打字机效果函数 =====
function typeWriter(element, text, speed = 30) {
return new Promise(resolve => {
element.classList.add('active');
element.innerHTML = '';
element.classList.add('typewriter-cursor');
let i = 0;
setTimeout(() => {
function type() {
if (i < text.length) {
const charSpan = document.createElement('span');
charSpan.className = 'char-blur-in';
charSpan.textContent = text.charAt(i);
element.appendChild(charSpan);
i++;
setTimeout(type, speed);
} else {
element.classList.remove('typewriter-cursor');
element.classList.add('typing-done');
resolve();
}
}
type();
}, 600);
});
}
// Hero区域打字机
function startHeroTypewriter() {
const line1 = document.getElementById('typewriter-line1');
const line2 = document.getElementById('typewriter-line2');
const subtitle = document.getElementById('hero-subtitle');
const buttons = document.getElementById('hero-buttons');
const tags = document.getElementById('hero-tags');
typeWriter(line1, '山管选课助手', 30).then(() => {
setTimeout(() => {
typeWriter(line2, '全自动抢课系统', 30).then(() => {
subtitle.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
subtitle.style.opacity = '0';
subtitle.style.filter = 'blur(10px)';
subtitle.style.transform = 'translateY(20px)';
requestAnimationFrame(() => {
subtitle.classList.remove('opacity-0', 'translate-y-4');
subtitle.style.opacity = '1';
subtitle.style.filter = 'blur(0)';
subtitle.style.transform = 'translateY(0)';
});
setTimeout(() => {
buttons.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
requestAnimationFrame(() => {
buttons.classList.remove('opacity-0', 'translate-y-4');
buttons.style.opacity = '1';
buttons.style.filter = 'blur(0)';
buttons.style.transform = 'translateY(0)';
});
setTimeout(() => {
tags.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
requestAnimationFrame(() => {
tags.classList.remove('opacity-0', 'translate-y-4');
tags.style.opacity = '1';
tags.style.filter = 'blur(0)';
tags.style.transform = 'translateY(0)';
});
}, 200);
}, 200);
});
}, 300);
});
}
window.addEventListener('load', () => {
setTimeout(startHeroTypewriter, 500);
checkInviteCode();
});
// 选课时间逻辑
// ═══════════════════════════════════════════════════
// 选课时间表(每年固定日期)
// ═══════════════════════════════════════════════════
const SCHEDULE = {
fall: {
name: '秋季学期',
pre: { month: 5, day: 17, hour: 12, min: 30 },
preEnd: { month: 5, day: 18, hour: 12, min: 30 },
formal: { month: 5, day: 18, hour: 20, min: 30 },
formalEnd: { month: 5, day: 22, hour: 12, min: 30 },
},
spring: {
name: '春季学期',
pre: { month: 11, day: 9, hour: 12, min: 30 },
preEnd: { month: 11, day: 10, hour: 12, min: 30 },
formal: { month: 11, day: 11, hour: 12, min: 30 },
formalEnd: { month: 11, day: 12, hour: 20, min: 30 },
}
};
function getCurrentSchedule() {
const now = new Date();
const year = now.getFullYear();
const springPre = new Date(year, 11, 9, 12, 30);
const fallPre = new Date(year, 5, 17, 12, 30);
let sem, semYear;
if (now < fallPre) {
sem = 'spring';
semYear = year;
} else if (now < springPre) {
sem = 'fall';
semYear = year;
} else {
sem = 'spring';
semYear = year + 1;
}
const s = SCHEDULE[sem];
const dates = {
preStart: new Date(semYear, s.pre.month, s.pre.day, s.pre.hour, s.pre.min),
preEnd: new Date(semYear, s.preEnd.month, s.preEnd.day, s.preEnd.hour, s.preEnd.min),
formalStart: new Date(semYear, s.formal.month, s.formal.day, s.formal.hour, s.formal.min),
formalEnd: new Date(semYear, s.formalEnd.month, s.formalEnd.day, s.formalEnd.hour, s.formalEnd.min),
};
const semLabel = `${semYear}年${s.name}`;
return { sem, semLabel, dates };
}
function getPhase() {
const now = new Date();
const { semLabel, dates } = getCurrentSchedule();
if (now < dates.preStart) {
return { phase: 'before_pre', label: '选课未开始', semLabel,
nextTarget: dates.preStart, nextLabel: '预选开始' };
} else if (now < dates.preEnd) {
return { phase: 'in_pre', label: '预选阶段', semLabel,
nextTarget: dates.formalStart, nextLabel: '正选开始' };
} else if (now < dates.formalStart) {
return { phase: 'between', label: '预选结束 · 正选待开始', semLabel,
nextTarget: dates.formalStart, nextLabel: '正选开始' };
} else if (now < dates.formalEnd) {
return { phase: 'in_formal', label: '正选阶段', semLabel,
nextTarget: dates.formalEnd, nextLabel: '选课结束' };
} else {
return { phase: 'ended', label: '选课已结束', semLabel,
nextTarget: null, nextLabel: '' };
}
}
function fmtDate(d) {
return `${d.getMonth()+1}月${d.getDate()}日 ${String(d.getHours()).padStart(2,'0')}:${String(d.getMinutes()).padStart(2,'0')}`;
}
function updateUI() {
const info = getPhase();
const { dates } = getCurrentSchedule();
// 更新学期名
document.querySelectorAll('#nav-semester, #footer-semester').forEach(el => {
el.textContent = info.semLabel;
});
// 阶段标签
const badge = document.getElementById('current-phase-badge');
const phaseColors = {
before_pre: 'bg-blue-500/20 text-blue-300',
in_pre: 'bg-yellow-500/20 text-yellow-300',
between: 'bg-purple-500/20 text-purple-300',
in_formal: 'bg-green-500/20 text-green-300',
ended: 'bg-red-500/20 text-red-300',
};
badge.innerHTML = `<span class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full ${phaseColors[info.phase] || ''} text-sm">
<span class="w-1.5 h-1.5 rounded-full ${info.phase === 'ended' ? 'bg-red-400' : 'bg-current animate-pulse'}"></span>
${info.label}
</span>`;
document.getElementById('schedule-title').textContent = info.semLabel;
document.getElementById('pre-date').textContent = `${fmtDate(dates.preStart)} ~ ${fmtDate(dates.preEnd)}`;
document.getElementById('formal-date').textContent = `${fmtDate(dates.formalStart)} ~ ${fmtDate(dates.formalEnd)}`;
// 倒计时
const cdLabel = document.getElementById('countdown-label');
if (info.nextTarget) {
cdLabel.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline-block -mt-0.5 mr-1"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> 距离${info.nextLabel}`;
const diff = info.nextTarget - new Date();
if (diff > 0) {
document.getElementById('cd-days').textContent = String(Math.floor(diff / 86400000)).padStart(2,'0');
document.getElementById('cd-hours').textContent = String(Math.floor((diff % 86400000) / 3600000)).padStart(2,'0');
document.getElementById('cd-mins').textContent = String(Math.floor((diff % 3600000) / 60000)).padStart(2,'0');
document.getElementById('cd-secs').textContent = String(Math.floor((diff % 60000) / 1000)).padStart(2,'0');
}
} else {
// 选课已结束,计算到下学期预选的时间
const now = new Date();
const y = now.getFullYear();
const nextFall = new Date(y, 5, 17, 12, 30);
const nextSpring = new Date(y, 11, 9, 12, 30);
const next = now < nextFall ? nextFall : now < nextSpring ? nextSpring : new Date(y+1, 5, 17, 12, 30);
cdLabel.textContent = '距离下学期选课';
const diff = next - now;
if (diff > 0) {
document.getElementById('cd-days').textContent = String(Math.floor(diff / 86400000)).padStart(2,'0');
document.getElementById('cd-hours').textContent = String(Math.floor((diff % 86400000) / 3600000)).padStart(2,'0');
document.getElementById('cd-mins').textContent = String(Math.floor((diff % 3600000) / 60000)).padStart(2,'0');
document.getElementById('cd-secs').textContent = String(Math.floor((diff % 60000) / 1000)).padStart(2,'0');
}
}
// 计费信息
// 注意:折扣天数必须与后端 /create-pay-order 的算法完全一致
// (锚点=12月9日12:00 / 6月17日10:00,floor,0~180),
// 以前这里按"距当前阶段结束"算,正选阶段显示价会与实收费不一致
const preDays = getServerAdvanceDays();
const daysDisplay = document.getElementById('auto-days-display');
if (info.nextTarget) {
daysDisplay.textContent = preDays;
document.getElementById('time-label').textContent = `提前${preDays}天`;
const slider = document.getElementById('time-slider');
slider.value = preDays;
slider.style.setProperty('--progress', `${(preDays / 180) * 100}%`);
updatePrice(preDays);
} else {
// 选课已结束 → 预习下学期,按最大天数
daysDisplay.textContent = '--';
document.getElementById('time-label').textContent = '预习下学期';
updatePrice(180);
}
}
// 与后端 /create-pay-order 完全一致的提前天数算法
function getServerAdvanceDays() {
const now = new Date();
const y = now.getFullYear();
const fall = new Date(y, 5, 17, 10, 0, 0);
const spring = new Date(y, 11, 9, 12, 0, 0);
let target;
if (now < fall) target = fall;
else if (now < spring) target = spring;
else target = new Date(y + 1, 5, 17, 10, 0, 0);
const days = Math.floor((target - now) / 86400000);
return Math.min(Math.max(days, 0), 180);
}
// 选课结束时不启动倒计时
function startScheduleInterval() {
setInterval(updateUI, 1000);
updateUI();
}
function updatePrice(days) {
const qty = parseInt(document.getElementById('qty-input').value);
const basePrice = 20;
let discount = 0;
if (days >= 150) discount = 0.6;
else if (days >= 120) discount = 0.5;
else if (days >= 90) discount = 0.4;
else if (days >= 60) discount = 0.3;
else if (days >= 30) discount = 0.2;
else if (days >= 14) discount = 0.1;
let bulkDiscount = 0;
if (qty >= 16) bulkDiscount = 0.25;
else if (qty >= 6) bulkDiscount = 0.15;
else if (qty >= 2) bulkDiscount = 0.05;
let inviteDiscount = 0;
const inviteRow = document.getElementById('invite-row');
const inviteSave = document.getElementById('invite-save');
if (currentInviteCode) {
inviteDiscount = inviteDiscountPerUnit * qty;
inviteRow.classList.remove('hidden');
inviteSave.textContent = inviteDiscount;
} else {
inviteRow.classList.add('hidden');
}
const unitPrice = Math.round(basePrice * (1 - discount));
const subtotal = unitPrice * qty * (1 - bulkDiscount);
const total = Math.round(subtotal - inviteDiscount);
const perPerson = Math.round(total / qty);
document.getElementById('total-price').textContent = total;
document.getElementById('per-price').textContent = perPerson;
document.getElementById('time-save').textContent = Math.round(basePrice * discount);
if (bulkDiscount > 0) {
document.getElementById('bulk-row').classList.remove('hidden');
document.getElementById('bulk-save').textContent = Math.round(unitPrice * qty * bulkDiscount);
} else {
document.getElementById('bulk-row').classList.add('hidden');
}
}
function adjustQty(delta) {
const input = document.getElementById('qty-input');
let val = parseInt(input.value) + delta;
if (val < 1) val = 1;
if (val > 50) val = 50;
input.value = val;
updateUI();
}
// FAQ 带打字机效果
async function toggleFaq(btn) {
const item = btn.closest('.faq-item');
const isActive = item.classList.contains('active');
const target = item.querySelector('.typewriter-target');
const fullText = target.getAttribute('data-text');
document.querySelectorAll('.faq-item').forEach(faq => {
if (faq !== item) {
faq.classList.remove('active');
const otherTarget = faq.querySelector('.typewriter-target');
if (otherTarget) {
setTimeout(() => {
if (!faq.classList.contains('active')) {
otherTarget.innerHTML = '';
otherTarget.classList.remove('active', 'typing-done', 'typewriter-cursor');
otherTarget.classList.add('typewriter-blur-in');
}
}, 400);
}
}
});
if (!isActive) {
item.classList.add('active');
setTimeout(async () => {
await typeWriter(target, fullText, 30);
}, 200);
} else {
item.classList.remove('active');
setTimeout(() => {
if (!item.classList.contains('active')) {
target.innerHTML = '';
target.classList.remove('active', 'typing-done', 'typewriter-cursor');
target.classList.add('typewriter-blur-in');
}
}, 400);
}
}
// 启动选课时序展示
startScheduleInterval();
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) entry.target.classList.add('active');
});
}, { threshold: 0.1 });
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
// 仪表盘跳转:检测登录状态,已登录跳 /dashboard,否则跳 /login
async function goDashboard() {
try {
const resp = await fetch('/api/user/info', { credentials: 'same-origin' });
if (resp.ok) {
window.location.href = '/dashboard';
} else {
window.location.href = '/login';
}
} catch (e) {
window.location.href = '/login';
}
}
// ESC键关闭弹窗
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
closeEmailModal();
closeMobileMenu();
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
<script src="/static/js/hero-particles.js"></script>
</body>
</html>