| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <!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">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <title>选择机场 - 安检分级质控系统</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- min-height: 100vh;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20px;
- }
- .container {
- width: 100%;
- max-width: 400px;
- }
- .logo-section {
- text-align: center;
- margin-bottom: 40px;
- }
- .logo {
- width: 80px;
- height: 80px;
- background: white;
- border-radius: 20px;
- margin: 0 auto 20px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 40px;
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
- }
- .title {
- color: white;
- font-size: 24px;
- font-weight: 600;
- margin-bottom: 8px;
- }
- .subtitle {
- color: rgba(255, 255, 255, 0.8);
- font-size: 14px;
- }
- .card {
- background: white;
- border-radius: 16px;
- padding: 30px 20px;
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
- }
- .card-title {
- font-size: 18px;
- font-weight: 600;
- color: #333;
- margin-bottom: 20px;
- text-align: center;
- }
- .airport-list {
- list-style: none;
- }
- .airport-item {
- background: #f7f8fa;
- border-radius: 12px;
- padding: 16px;
- margin-bottom: 12px;
- cursor: pointer;
- transition: all 0.3s ease;
- display: flex;
- align-items: center;
- border: 2px solid transparent;
- }
- .airport-item:hover {
- background: #e8ecf4;
- transform: translateY(-2px);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- }
- .airport-item:active {
- transform: translateY(0);
- }
- .airport-item.selected {
- border-color: #667eea;
- background: #f0f3ff;
- }
- .airport-icon {
- width: 40px;
- height: 40px;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 20px;
- margin-right: 15px;
- flex-shrink: 0;
- }
- .airport-info {
- flex: 1;
- }
- .airport-name {
- font-size: 16px;
- font-weight: 600;
- color: #333;
- margin-bottom: 4px;
- }
- .airport-desc {
- font-size: 12px;
- color: #999;
- }
- .arrow {
- color: #ccc;
- font-size: 20px;
- }
- .airport-item.selected .arrow {
- color: #667eea;
- }
- .footer {
- text-align: center;
- margin-top: 20px;
- color: rgba(255, 255, 255, 0.6);
- font-size: 12px;
- }
- .loading {
- display: none;
- text-align: center;
- margin-top: 20px;
- }
- .loading.show {
- display: block;
- }
- .loading-spinner {
- width: 30px;
- height: 30px;
- border: 3px solid rgba(255, 255, 255, 0.3);
- border-radius: 50%;
- border-top-color: white;
- animation: spin 1s ease-in-out infinite;
- margin: 0 auto 10px;
- }
- @keyframes spin {
- to { transform: rotate(360deg); }
- }
- .loading-text {
- color: white;
- font-size: 14px;
- }
- /* 移动端优化 */
- @media (max-width: 480px) {
- .title {
- font-size: 20px;
- }
- .card {
- padding: 24px 16px;
- }
- .airport-item {
- padding: 14px;
- }
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="logo-section">
- <div class="logo">✈️</div>
- <div class="title">安检分级质控系统</div>
- <div class="subtitle">Airport Security Quality Control</div>
- </div>
- <div class="card">
- <div class="card-title">请选择您的机场</div>
- <ul class="airport-list" id="airportList">
- <!-- 动态生成 -->
- </ul>
- </div>
- <div class="loading" id="loading">
- <div class="loading-spinner"></div>
- <div class="loading-text">正在跳转...</div>
- </div>
- <div class="footer">
- © 2025 机场安检质控系统
- </div>
- </div>
- <script>
- // 机场配置列表(根据实际环境配置)
- const airports = [
- {
- code: 'SHUANGLIU',
- name: '双流机场',
- description: '成都双流国际机场',
- icon: '🛫'
- },
- {
- code: 'HAIKOU',
- name: '海口机场',
- description: '海口美兰国际机场',
- icon: '✈️'
- }
- // 可以继续添加更多机场
- // {
- // code: 'ANOTHER_AIRPORT',
- // name: '其他机场',
- // description: '其他机场描述',
- // icon: '🛬'
- // }
- ];
- let selectedCode = null;
- // 渲染机场列表
- function renderAirports() {
- const listEl = document.getElementById('airportList');
- listEl.innerHTML = airports.map(airport => `
- <li class="airport-item" data-code="${airport.code}" onclick="selectAirport('${airport.code}')">
- <div class="airport-icon">${airport.icon}</div>
- <div class="airport-info">
- <div class="airport-name">${airport.name}</div>
- <div class="airport-desc">${airport.description}</div>
- </div>
- <div class="arrow">›</div>
- </li>
- `).join('');
- }
- // 选择机场
- function selectAirport(code) {
- selectedCode = code;
- // 更新UI
- document.querySelectorAll('.airport-item').forEach(item => {
- item.classList.remove('selected');
- });
- document.querySelector(`[data-code="${code}"]`).classList.add('selected');
- // 延迟跳转,让用户看到选中效果
- setTimeout(() => {
- confirmSelection(code);
- }, 300);
- }
- // 确认选择并跳转
- function confirmSelection(code) {
- // 显示加载动画
- document.getElementById('loading').classList.add('show');
- // 设置 Cookie(30天有效期)
- const maxAge = 30 * 24 * 60 * 60; // 30天
- document.cookie = `airport_code=${code}; path=/; max-age=${maxAge}; SameSite=Lax`;
- // 同时设置 localStorage(备用方案)
- try {
- localStorage.setItem('airport_code', code);
- } catch (e) {
- console.warn('无法设置 localStorage:', e);
- }
- // 延迟跳转到首页
- setTimeout(() => {
- window.location.href = '/';
- }, 500);
- }
- // 检查是否已有选择
- function checkExistingSelection() {
- // 从 cookie 读取
- const cookies = document.cookie.split(';');
- for (let cookie of cookies) {
- const [name, value] = cookie.trim().split('=');
- if (name === 'airport_code') {
- // 已有选择,自动跳转
- window.location.href = '/';
- return;
- }
- }
- }
- // 初始化
- document.addEventListener('DOMContentLoaded', () => {
- checkExistingSelection();
- renderAirports();
- });
- // 防止iOS端的bounce效果
- document.addEventListener('touchmove', (e) => {
- if (e.target.closest('.airport-list')) {
- return;
- }
- e.preventDefault();
- }, { passive: false });
- </script>
- </body>
- </html>
|