feat: complete web app features and fix encoding
This commit is contained in:
66
templates/analysis.html
Normal file
66
templates/analysis.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>营养分析 - 个性化饮食推荐助手</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/analysis.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<h1>? 营养分析</h1>
|
||||
<p class="subtitle">AI智能营养分析与建议</p>
|
||||
</header>
|
||||
|
||||
<nav class="nav">
|
||||
<a href="/" class="nav-item">首页</a>
|
||||
<a href="/data-collection" class="nav-item">数据采集</a>
|
||||
<a href="/recommendation" class="nav-item">智能推荐</a>
|
||||
<a href="/analysis" class="nav-item active">营养分析</a>
|
||||
<a href="/recitation" class="nav-item">背诵排序</a>
|
||||
</nav>
|
||||
|
||||
<main class="main">
|
||||
<div class="analysis-container">
|
||||
<!-- 用户登录区域 -->
|
||||
<div id="loginSection" class="section">
|
||||
<h2>用户登录</h2>
|
||||
<div class="form-group">
|
||||
<label for="userId">用户ID:</label>
|
||||
<input type="text" id="userId" class="form-input" placeholder="请输入用户ID">
|
||||
</div>
|
||||
<button id="loginBtn" class="btn btn-primary">登录</button>
|
||||
</div>
|
||||
|
||||
<!-- 分析请求区域 -->
|
||||
<div id="requestSection" class="section" style="display: none;">
|
||||
<h2>营养分析</h2>
|
||||
<div class="form-group">
|
||||
<label>餐食信息:</label>
|
||||
<textarea id="mealData" class="form-textarea" rows="5" placeholder="请输入餐食信息,例如: 早餐:燕麦粥、香蕉、牛奶 热量:350大卡"></textarea>
|
||||
</div>
|
||||
<button id="analyzeBtn" class="btn btn-primary">开始分析</button>
|
||||
</div>
|
||||
|
||||
<!-- 分析结果显示 -->
|
||||
<div id="analysisSection" class="section" style="display: none;">
|
||||
<h2>分析结果</h2>
|
||||
<div id="analysisResult" class="analysis-result"></div>
|
||||
</div>
|
||||
|
||||
<!-- 操作提示 -->
|
||||
<div id="messageArea" class="message-area"></div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<p>© 2024 个性化饮食推荐助手</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/analysis.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
120
templates/data_collection.html
Normal file
120
templates/data_collection.html
Normal file
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>数据采集 - 个性化饮食推荐助手</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/data_collection.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<h1>? 数据采集</h1>
|
||||
<p class="subtitle">建立你的个人饮食档案</p>
|
||||
</header>
|
||||
|
||||
<nav class="nav">
|
||||
<a href="/" class="nav-item">首页</a>
|
||||
<a href="/data-collection" class="nav-item active">数据采集</a>
|
||||
<a href="/recommendation" class="nav-item">智能推荐</a>
|
||||
<a href="/analysis" class="nav-item">营养分析</a>
|
||||
<a href="/recitation" class="nav-item">背诵排序</a>
|
||||
</nav>
|
||||
|
||||
<main class="main">
|
||||
<div class="data-collection-container">
|
||||
<!-- 用户登录区域 -->
|
||||
<div id="loginSection" class="section">
|
||||
<h2>用户登录</h2>
|
||||
<div class="form-group">
|
||||
<label for="userId">用户ID:</label>
|
||||
<input type="text" id="userId" class="form-input" placeholder="请输入用户ID">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userName">姓名:</label>
|
||||
<input type="text" id="userName" class="form-input" placeholder="请输入姓名">
|
||||
</div>
|
||||
<button id="loginBtn" class="btn btn-primary">登录/注册</button>
|
||||
</div>
|
||||
|
||||
<!-- 基础信息问卷 -->
|
||||
<div id="basicQuestionnaire" class="section" style="display: none;">
|
||||
<h2>基础信息问卷</h2>
|
||||
<div class="form-group">
|
||||
<label>年龄:</label>
|
||||
<input type="number" id="age" class="form-input" placeholder="请输入年龄">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>性别:</label>
|
||||
<select id="gender" class="form-input">
|
||||
<option value="">请选择</option>
|
||||
<option value="男">男</option>
|
||||
<option value="女">女</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>身高(cm):</label>
|
||||
<input type="number" id="height" class="form-input" placeholder="请输入身高">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>体重(kg):</label>
|
||||
<input type="number" id="weight" class="form-input" placeholder="请输入体重">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>活动水平:</label>
|
||||
<select id="activityLevel" class="form-input">
|
||||
<option value="">请选择</option>
|
||||
<option value="久坐">久坐</option>
|
||||
<option value="轻度活动">轻度活动</option>
|
||||
<option value="中度活动">中度活动</option>
|
||||
<option value="高度活动">高度活动</option>
|
||||
</select>
|
||||
</div>
|
||||
<button id="submitBasicBtn" class="btn btn-primary">提交基础信息</button>
|
||||
</div>
|
||||
|
||||
<!-- 餐食记录 -->
|
||||
<div id="mealRecord" class="section" style="display: none;">
|
||||
<h2>记录餐食</h2>
|
||||
<div class="form-group">
|
||||
<label>日期:</label>
|
||||
<input type="date" id="mealDate" class="form-input">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>餐次:</label>
|
||||
<select id="mealType" class="form-input">
|
||||
<option value="breakfast">早餐</option>
|
||||
<option value="lunch">午餐</option>
|
||||
<option value="dinner">晚餐</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>食物列表(每行一个):</label>
|
||||
<textarea id="foods" class="form-textarea" rows="5" placeholder="例如: 燕麦粥 1碗 香蕉 1根 牛奶 200ml"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>热量(大卡):</label>
|
||||
<input type="number" id="calories" class="form-input" placeholder="请输入热量">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>满意度(1-5分):</label>
|
||||
<input type="number" id="satisfaction" class="form-input" min="1" max="5" value="3">
|
||||
</div>
|
||||
<button id="submitMealBtn" class="btn btn-primary">记录餐食</button>
|
||||
</div>
|
||||
|
||||
<!-- 操作提示 -->
|
||||
<div id="messageArea" class="message-area"></div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<p>© 2024 个性化饮食推荐助手</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/data_collection.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
<nav class="nav">
|
||||
<a href="/" class="nav-item active">首页</a>
|
||||
<a href="/data-collection" class="nav-item">数据采集</a>
|
||||
<a href="/recommendation" class="nav-item">智能推荐</a>
|
||||
<a href="/analysis" class="nav-item">营养分析</a>
|
||||
<a href="/recitation" class="nav-item">背诵排序</a>
|
||||
</nav>
|
||||
|
||||
@@ -24,6 +27,24 @@
|
||||
<p>这是一个集成了智能饮食推荐和背诵排序功能的网页应用。</p>
|
||||
|
||||
<div class="feature-cards">
|
||||
<div class="card">
|
||||
<div class="card-icon">📝</div>
|
||||
<h3>数据采集</h3>
|
||||
<p>填写基础信息问卷,记录你的饮食习惯和偏好,建立个人档案。</p>
|
||||
<a href="/data-collection" class="btn btn-primary">开始使用</a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon">🤖</div>
|
||||
<h3>智能推荐</h3>
|
||||
<p>基于你的饮食习惯和偏好,AI为你推荐个性化的餐食搭配。</p>
|
||||
<a href="/recommendation" class="btn btn-primary">开始使用</a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon">🔬</div>
|
||||
<h3>营养分析</h3>
|
||||
<p>分析你的餐食营养状况,提供专业的营养建议和健康指导。</p>
|
||||
<a href="/analysis" class="btn btn-primary">开始使用</a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon">🎯</div>
|
||||
<h3>背诵排序</h3>
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
<!-- 排序结果显示 -->
|
||||
<div id="resultSection" class="result-section" style="display: none;">
|
||||
<h2>随机排序结果</h2>
|
||||
<div class="export-buttons">
|
||||
<button id="exportTxtBtn" class="btn btn-export">导出为TXT</button>
|
||||
<button id="exportJsonBtn" class="btn btn-export">导出为JSON</button>
|
||||
<button id="exportCsvBtn" class="btn btn-export">导出为CSV</button>
|
||||
</div>
|
||||
<div id="sortedList" class="sorted-list"></div>
|
||||
<button id="resetBtn" class="btn btn-secondary">重新开始</button>
|
||||
</div>
|
||||
|
||||
70
templates/recommendation.html
Normal file
70
templates/recommendation.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>智能推荐 - 个性化饮食推荐助手</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/recommendation.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<h1>? 智能推荐</h1>
|
||||
<p class="subtitle">基于AI的个性化餐食推荐</p>
|
||||
</header>
|
||||
|
||||
<nav class="nav">
|
||||
<a href="/" class="nav-item">首页</a>
|
||||
<a href="/data-collection" class="nav-item">数据采集</a>
|
||||
<a href="/recommendation" class="nav-item active">智能推荐</a>
|
||||
<a href="/analysis" class="nav-item">营养分析</a>
|
||||
<a href="/recitation" class="nav-item">背诵排序</a>
|
||||
</nav>
|
||||
|
||||
<main class="main">
|
||||
<div class="recommendation-container">
|
||||
<!-- 用户登录区域 -->
|
||||
<div id="loginSection" class="section">
|
||||
<h2>用户登录</h2>
|
||||
<div class="form-group">
|
||||
<label for="userId">用户ID:</label>
|
||||
<input type="text" id="userId" class="form-input" placeholder="请输入用户ID">
|
||||
</div>
|
||||
<button id="loginBtn" class="btn btn-primary">登录</button>
|
||||
</div>
|
||||
|
||||
<!-- 推荐请求区域 -->
|
||||
<div id="requestSection" class="section" style="display: none;">
|
||||
<h2>获取推荐</h2>
|
||||
<div class="form-group">
|
||||
<label>餐次:</label>
|
||||
<select id="mealType" class="form-input">
|
||||
<option value="breakfast">早餐</option>
|
||||
<option value="lunch">午餐</option>
|
||||
<option value="dinner">晚餐</option>
|
||||
</select>
|
||||
</div>
|
||||
<button id="getRecommendationBtn" class="btn btn-primary">获取推荐</button>
|
||||
</div>
|
||||
|
||||
<!-- 推荐结果显示 -->
|
||||
<div id="recommendationsSection" class="section" style="display: none;">
|
||||
<h2>推荐结果</h2>
|
||||
<div id="recommendationsList" class="recommendations-list"></div>
|
||||
</div>
|
||||
|
||||
<!-- 操作提示 -->
|
||||
<div id="messageArea" class="message-area"></div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<p>© 2024 个性化饮食推荐助手</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/recommendation.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user