feat: 完善项目功能和部署脚本
- 修复页面跳转白屏闪烁问题
- 集成过渡岗位页面(岗位装配中心)
- 添加iframe全屏嵌入(教务系统、就业规划)
- 优化企业资源卡片hover分裂效果
- 添加Windows和macOS快捷部署脚本
- 更新.gitignore忽略测试文件和缓存
🤖 Generated with Claude Code
This commit is contained in:
56
js/main.js
56
js/main.js
@@ -8,21 +8,15 @@ import { ListInterface } from './ui/ListInterface.js';
|
||||
import { DetailInterface } from './ui/DetailInterface.js';
|
||||
import { SearchController } from './ui/SearchController.js';
|
||||
import { UIUtils } from './ui/UIUtils.js';
|
||||
import { initWebsite, switchPage } from './website.js';
|
||||
|
||||
class App {
|
||||
constructor() {
|
||||
// 官网 DOM 引用
|
||||
this.websiteContainer = document.getElementById('website-container');
|
||||
this.appContainer = document.getElementById('app-container');
|
||||
this.navbar = document.getElementById('navbar');
|
||||
|
||||
// 3D平台 DOM 引用
|
||||
this.appContainer = document.getElementById('app-container');
|
||||
this.canvasContainer = document.getElementById('canvas-container');
|
||||
this.mapInterface = document.getElementById('map-interface');
|
||||
this.listInterface = document.getElementById('list-interface');
|
||||
this.detailInterface = document.getElementById('detail-interface');
|
||||
this.mapLogoArea = document.getElementById('map-logo-area');
|
||||
|
||||
// UI 元素
|
||||
this.uiLayer = document.getElementById('ui-layer');
|
||||
@@ -44,10 +38,7 @@ class App {
|
||||
|
||||
// 初始化应用
|
||||
async init() {
|
||||
// 1. 优先初始化官网(立即执行,等待CSV加载)
|
||||
await initWebsite(() => this.switchToApp());
|
||||
|
||||
// 2. 初始化 3D 平台的控制器(但不启动场景)
|
||||
// 初始化 3D 平台的控制器(但不启动)
|
||||
this.mapController = new MapInterface(
|
||||
this.mapInterface,
|
||||
(cityName) => this.showList(cityName)
|
||||
@@ -100,28 +91,15 @@ class App {
|
||||
});
|
||||
}
|
||||
|
||||
// 3. 绑定全局函数和事件
|
||||
// 绑定全局函数和事件
|
||||
this.bindGlobalFunctions();
|
||||
|
||||
// 4. 默认显示官网首页
|
||||
this.showWebsite();
|
||||
}
|
||||
|
||||
// 显示官网(确保官网可见,3D隐藏)
|
||||
showWebsite() {
|
||||
this.websiteContainer.classList.remove('hidden');
|
||||
this.appContainer.classList.add('hidden');
|
||||
this.navbar.classList.remove('-translate-y-full');
|
||||
// 将应用实例暴露给全局,供页面切换使用
|
||||
window.appInstance = this;
|
||||
}
|
||||
|
||||
// 切换到 3D 内推平台
|
||||
switchToApp() {
|
||||
// 隐藏官网
|
||||
this.websiteContainer.classList.add('hidden');
|
||||
|
||||
// 隐藏顶部导航栏(全屏体验)
|
||||
this.navbar.classList.add('-translate-y-full');
|
||||
|
||||
// 显示 3D 容器
|
||||
this.appContainer.classList.remove('hidden');
|
||||
|
||||
@@ -165,21 +143,6 @@ class App {
|
||||
});
|
||||
}
|
||||
|
||||
// 从 3D 平台返回官网
|
||||
switchToWebsite(pageId = 'news') {
|
||||
// 隐藏 3D 容器
|
||||
this.appContainer.classList.add('hidden');
|
||||
|
||||
// 显示官网
|
||||
this.websiteContainer.classList.remove('hidden');
|
||||
|
||||
// 显示导航栏
|
||||
this.navbar.classList.remove('-translate-y-full');
|
||||
|
||||
// 切换到指定页面
|
||||
switchPage(pageId);
|
||||
}
|
||||
|
||||
// 转场完成回调(3D地球 → 2D地图)
|
||||
onTransitionComplete() {
|
||||
this.switchTo2D();
|
||||
@@ -255,10 +218,11 @@ class App {
|
||||
|
||||
// 绑定全局函数和事件
|
||||
bindGlobalFunctions() {
|
||||
// 地图界面logo点击返回官网
|
||||
if (this.mapLogoArea) {
|
||||
this.mapLogoArea.addEventListener('click', () => {
|
||||
this.switchToWebsite('news');
|
||||
// 地图界面logo点击返回首页
|
||||
const mapLogoArea = document.getElementById('map-logo-area');
|
||||
if (mapLogoArea) {
|
||||
mapLogoArea.addEventListener('click', () => {
|
||||
window.backToHome();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -138,8 +138,11 @@ export class DetailInterface {
|
||||
// 填充业务板块
|
||||
this.renderSegments(company.segments);
|
||||
|
||||
// 显示界面
|
||||
// 显示界面 - 先设置为不可见状态,避免闪烁
|
||||
this.container.style.opacity = '0';
|
||||
this.container.style.display = 'block';
|
||||
|
||||
// 立即淡入
|
||||
gsap.to(this.container, {
|
||||
opacity: 1,
|
||||
duration: CONFIG.animation.ui.fadeDuration
|
||||
|
||||
@@ -51,8 +51,11 @@ export class ListInterface {
|
||||
this.cardsContainer.appendChild(card);
|
||||
});
|
||||
|
||||
// 显示界面
|
||||
// 显示界面 - 先设置为不可见状态,避免闪烁
|
||||
this.container.style.opacity = '0';
|
||||
this.container.style.display = 'block';
|
||||
|
||||
// 立即淡入
|
||||
gsap.to(this.container, {
|
||||
opacity: 1,
|
||||
duration: CONFIG.animation.ui.fadeDuration
|
||||
|
||||
Reference in New Issue
Block a user