【m】界面分为3个页面

This commit is contained in:
zhangzheng
2026-03-04 18:40:19 +08:00
parent 93b56da25e
commit 6d0dc478e4
9 changed files with 430 additions and 6 deletions

View File

@@ -325,8 +325,39 @@ function initWebRTC() {
console.log('Initializing WebRTC...');
}
// 页面加载完成后初始化应用
document.addEventListener('DOMContentLoaded', initApp);
// 页面加载完成后初始化
window.addEventListener('DOMContentLoaded', async () => {
try {
// 检查本地存储中是否有连接ID
const connectionId = localStorage.getItem('connectionId');
if (!connectionId) {
// 如果没有连接ID跳转到连接界面
window.location.href = './connect/connect.html';
return;
}
// 初始化 store
store.init();
// 加入通话
store.joinCall(connectionId);
// 初始化渲染器
const renderer = new UIRenderer(store);
// 绑定DOM事件
bindDomEvents();
// 绑定WebSocket事件
bindWebSocketEvents();
console.log('Video call app initialized successfully');
} catch (error) {
console.error('Error initializing app:', error);
showNotification('初始化失败,请刷新页面重试', 'error');
}
});
// 导出全局变量
export { store, renderer, apiClient, wsManager };