data&device ready
This commit is contained in:
97
test.html
Normal file
97
test.html
Normal file
@@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>TalkingQ - Test</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; padding: 20px; background: #f5f5f5; }
|
||||
.login-wrapper { display: flex; width: 100%; height: 100vh; overflow: hidden; }
|
||||
.login-container { width: 460px; padding: 60px 50px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
|
||||
.login-bg { flex: 1; background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); display: flex; align-items: center; justify-content: center; color: #fff; }
|
||||
.login-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
|
||||
.login-subtitle { font-size: 14px; color: #666; margin-bottom: 40px; }
|
||||
.form-group { margin-bottom: 18px; }
|
||||
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
|
||||
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
|
||||
.btn-primary { width: 100%; padding: 12px; background: #52c41a; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; }
|
||||
.btn-primary:hover { background: #389e0d; }
|
||||
.error-box { background: #fff2f0; border: 1px solid #ffccc7; padding: 20px; border-radius: 8px; margin-bottom: 20px; color: #ff4d4f; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="error-container"></div>
|
||||
<div id="app"></div>
|
||||
|
||||
<script>
|
||||
// Simple test to check for errors
|
||||
window.onerror = function(msg, url, line, col, error) {
|
||||
document.getElementById('error-container').innerHTML = '<div class="error-box"><strong>JS Error:</strong><br>' + msg + '<br><small>Line: ' + line + '</small></div>';
|
||||
return true;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="scripts/api.js"></script>
|
||||
<script>
|
||||
console.log('API loaded');
|
||||
</script>
|
||||
<script src="scripts/login.js"></script>
|
||||
<script>
|
||||
console.log('Login loaded');
|
||||
</script>
|
||||
<script src="scripts/app.js"></script>
|
||||
<script>
|
||||
console.log('App loaded, registering pages...');
|
||||
|
||||
// Check if registerPage exists
|
||||
if (typeof registerPage !== 'function') {
|
||||
document.getElementById('error-container').innerHTML += '<div class="error-box">ERROR: registerPage function not found!</div>';
|
||||
} else {
|
||||
console.log('registerPage exists');
|
||||
}
|
||||
|
||||
// Check if login page renderer exists
|
||||
console.log('Checking pageRenderers:', typeof pageRenderers);
|
||||
|
||||
// Init
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('DOMContentLoaded fired');
|
||||
|
||||
// Show login directly
|
||||
const app = document.getElementById('app');
|
||||
app.innerHTML = `
|
||||
<div class="login-wrapper">
|
||||
<div class="login-container">
|
||||
<div class="login-header">
|
||||
<h1 class="login-title">欢迎回来</h1>
|
||||
<p class="login-subtitle">AI 玩具智能运营平台</p>
|
||||
</div>
|
||||
<form id="testLoginForm">
|
||||
<div class="form-group">
|
||||
<label class="form-label">用户名 / 邮箱</label>
|
||||
<input type="text" class="form-control" id="testUsername" placeholder="请输入用户名或邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">密码</label>
|
||||
<input type="password" class="form-control" id="testPassword" placeholder="请输入密码">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary">登 录</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="login-bg">
|
||||
<h2>智能运营,尽在掌控</h2>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('testLoginForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var username = document.getElementById('testUsername').value;
|
||||
var password = document.getElementById('testPassword').value;
|
||||
console.log('Login attempt:', username);
|
||||
alert('登录功能测试中...');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user