Files
jiaoyu/frontend/public/test-js-iframe.html
T
Zhang Jing Xuan 0841b1a103 智教助手平台:完整初始化
- 前端:Vue3 + TS + Element Plus,24 个页面路由(课件/组题/教案/动画/思维导图/作文批改/命题/课堂/资源/社区等)
- 后端:FastAPI + SQLAlchemy + SQLite,17 个路由模块,AI 服务层含降级模板
- AI:glm-5.x 推理模型已禁用思维链,确保输出真实内容
- 修复:ai_service 两处请求体注入 enable_thinking/thinking disabled
- 测试账号:13900999999 / test1234
2026-07-29 16:29:10 +08:00

46 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>Vue Iframe Test</title></head>
<body style="padding:20px;background:#f5f5f5;font-family:sans-serif;">
<h2>Test: Does srcdoc work?</h2>
<div id="app"></div>
<script>
const html = `<div style="width:800px;height:600px;margin:0 auto;background:linear-gradient(135deg,#0f2027,#203a43,#2c5364);display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;overflow:hidden;font-family:'Microsoft YaHei',sans-serif;">
<div style="position:absolute;top:-80px;left:-80px;width:260px;height:260px;border-radius:50%;background:rgba(255,165,0,0.08);"></div>
<div style="position:absolute;bottom:-60px;right:-60px;width:220px;height:220px;border-radius:50%;background:rgba(0,200,150,0.08);"></div>
<div style="position:absolute;top:40px;right:60px;width:100px;height:100px;border:3px solid rgba(255,255,255,0.06);border-radius:50%;"></div>
<div style="position:absolute;bottom:60px;left:50px;width:60px;height:60px;border:2px solid rgba(255,255,255,0.05);border-radius:50%;"></div>
<div style="position:relative;z-index:2;text-align:center;">
<div style="display:inline-block;background:linear-gradient(135deg,#ff6b35,#f7931e);padding:8px 32px;border-radius:30px;margin-bottom:20px;">
<span style="color:#fff;font-size:15px;font-weight:bold;letter-spacing:4px;">初一数学</span>
</div>
<h1 style="font-size:52px;color:#ffffff;margin:0 0 12px 0;letter-spacing:6px;text-shadow:0 4px 20px rgba(0,0,0,0.3);">一元一次方程</h1>
<div style="width:80px;height:3px;background:linear-gradient(90deg,#ff6b35,#00c896);margin:0 auto 20px auto;border-radius:2px;"></div>
<p style="color:rgba(255,255,255,0.7);font-size:18px;margin:0 0 30px 0;letter-spacing:2px;">从生活问题到代数思维的桥梁</p>
<div style="display:flex;gap:20px;justify-content:center;">
<div style="background:rgba(255,255,255,0.08);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.1);border-radius:16px;padding:20px 24px;text-align:center;width:160px;">
<div style="font-size:36px;margin-bottom:8px;">📖</div>
<div style="color:#fff;font-size:14px;font-weight:bold;">定义与性质</div>
<div style="color:rgba(255,255,255,0.5);font-size:12px;margin-top:4px;">概念理解</div>
</div>
<div style="background:rgba(255,255,255,0.08);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.1);border-radius:16px;padding:20px 24px;text-align:center;width:160px;">
<div style="font-size:36px;margin-bottom:8px;">✏️</div>
<div style="color:#fff;font-size:14px;font-weight:bold;">解题步骤</div>
<div style="color:rgba(255,255,255,0.5);font-size:12px;margin-top:4px;">方法掌握</div>
</div>
<div style="background:rgba(255,255,255,0.08);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.1);border-radius:16px;padding:20px 24px;text-align:center;width:160px;">
<div style="font-size:36px;margin-bottom:8px;">🎯</div>
<div style="color:#fff;font-size:14px;font-weight:bold;">实战练习</div>
<div style="color:rgba(255,255,255,0.5);font-size:12px;margin-top:4px;">巩固提升</div>
</div>
</div>
</div>
<div style="position:absolute;bottom:20px;color:rgba(255,255,255,0.3);font-size:12px;letter-spacing:1px;">点击下方箭头开始学习 →</div>
</div>`;
const div = document.getElementById('app');
const iframe = document.createElement('iframe');
iframe.style.cssText = 'width:820px;height:620px;border:2px solid blue;display:block;';
div.appendChild(iframe);
iframe.srcdoc = html;
document.body.innerHTML += '<p style="color:green;">iframe created, srcdoc set, length=' + html.length + '</p>';
</script>
</body></html>