refactor: 加工毛菜秤首页删除「称重录入」和「清洗操作」入口

删除这两个功能卡片及对应的子页面文件(02-weighing.html、03-washing.html),
仅保留员工登录、今日清洗任务、清洗记录、设备设置四个入口。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
zhangyan
2026-06-16 08:33:20 +08:00
co-authored by Claude Opus 4.6
parent dac2f771d2
commit 0da2f87505
4 changed files with 9 additions and 1158 deletions
@@ -1,604 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1280, initial-scale=1.0">
<title>加工毛菜秤 - 称重录入 | 蚁熊智能餐养平台</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
background: #0e1326; color: #fff; width: 1280px; height: 720px; overflow: hidden;
}
/* 顶部导航栏 */
.top-bar {
display: flex; align-items: center; height: 44px; background: #1a2b4a; padding: 0 20px;
}
.back-btn {
font-size: 14px; cursor: pointer; color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s;
}
.back-btn:hover { color: #fff; }
.top-bar__title {
flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
}
.top-bar__user {
font-size: 12px; color: rgba(255,255,255,0.5);
}
/* 主内容区 */
.main-content {
height: calc(100% - 44px); padding: 20px 28px; display: flex; gap: 24px;
}
/* 左侧:秤区 */
.scale-panel {
flex: 0 0 560px; display: flex; flex-direction: column; gap: 16px;
}
/* 当前任务卡 */
.current-task {
background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
border: 1px solid rgba(255,255,255,0.06);
}
.current-task__header {
display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.current-task__label {
font-size: 12px; color: rgba(255,255,255,0.5);
}
.current-task__switch {
font-size: 12px; color: #4a90d9; cursor: pointer;
}
.current-task__switch:hover { text-decoration: underline; }
.current-task__body {
display: flex; align-items: center; gap: 16px;
}
.current-task__icon {
width: 52px; height: 52px; border-radius: 12px;
display: flex; align-items: center; justify-content: center;
font-size: 26px; background: rgba(250,173,22,0.15);
}
.current-task__info {
flex: 1;
}
.current-task__name {
font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px;
}
.current-task__detail {
font-size: 12px; color: rgba(255,255,255,0.5);
}
.current-task__progress {
display: flex; align-items: center; gap: 8px;
}
.progress-mini {
width: 80px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
}
.progress-mini__fill {
height: 100%; background: #4a90d9; border-radius: 2px;
}
.progress-mini__text {
font-size: 11px; color: rgba(255,255,255,0.5);
}
/* 秤显示区 */
.scale-display {
flex: 1; background: #1a2b4a; border-radius: 16px; padding: 24px;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
border: 2px solid rgba(255,255,255,0.06); position: relative;
}
.scale-display.weighing {
border-color: #4a90d9;
}
.scale-display.stable {
border-color: #52c41a;
}
/* AI 识别结果 */
.ai-result {
display: flex; align-items: center; gap: 16px; padding: 16px 24px;
background: rgba(0,0,0,0.2); border-radius: 12px; width: 100%;
}
.ai-result__icon {
width: 56px; height: 56px; border-radius: 12px;
display: flex; align-items: center; justify-content: center;
font-size: 30px; background: rgba(74,144,217,0.15);
}
.ai-result__info {
flex: 1;
}
.ai-result__label {
font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 4px;
}
.ai-result__name {
font-size: 20px; font-weight: 700; color: #fff;
}
.ai-result__confidence {
font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px;
}
.ai-result__status {
font-size: 12px; padding: 4px 10px; border-radius: 4px;
}
.ai-result__status--matching { background: rgba(82,196,26,0.15); color: #52c41a; }
.ai-result__status--mismatch { background: rgba(255,77,79,0.15); color: #ff4d4f; }
.ai-result__status--idle { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }
/* 重量显示 */
.weight-display {
text-align: center;
}
.weight-display__value {
font-size: 72px; font-weight: 700; color: #fff; line-height: 1;
font-family: "Courier New", monospace;
}
.weight-display__unit {
font-size: 20px; color: rgba(255,255,255,0.5); margin-left: 4px;
}
.weight-display__status {
font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 8px;
}
.weight-display__status.weighing { color: #4a90d9; }
.weight-display__status.stable { color: #52c41a; }
/* 操作按钮区 */
.scale-actions {
display: flex; gap: 12px; width: 100%;
}
.scale-btn {
flex: 1; padding: 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
border: none; cursor: pointer; transition: all 0.2s;
}
.scale-btn--primary {
background: #4a90d9; color: #fff;
}
.scale-btn--primary:hover { background: #5ba0e9; }
.scale-btn--primary:disabled {
background: rgba(74,144,217,0.3); cursor: not-allowed;
}
.scale-btn--secondary {
background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8);
}
.scale-btn--secondary:hover { background: rgba(255,255,255,0.12); }
/* 右侧:记录区 */
.record-panel {
flex: 1; display: flex; flex-direction: column; gap: 16px;
}
/* 今日统计 */
.today-stats {
background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
display: flex; gap: 20px;
}
.today-stat {
flex: 1; text-align: center;
}
.today-stat__value {
font-size: 24px; font-weight: 700; color: #fff;
}
.today-stat__label {
font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px;
}
/* 本次称重记录 */
.records-section {
flex: 1; background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
display: flex; flex-direction: column; overflow: hidden;
}
.records-header {
display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.records-title {
font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8);
}
.records-count {
font-size: 12px; color: rgba(255,255,255,0.4);
}
.records-list {
flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.records-list::-webkit-scrollbar { width: 4px; }
.records-list::-webkit-scrollbar-track { background: transparent; }
.records-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.record-item {
display: flex; align-items: center; gap: 12px;
padding: 12px; background: rgba(0,0,0,0.15); border-radius: 8px;
}
.record-item__icon {
width: 36px; height: 36px; border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: 18px; background: rgba(250,173,22,0.15);
}
.record-item__info {
flex: 1;
}
.record-item__name {
font-size: 13px; font-weight: 500; color: #fff;
}
.record-item__time {
font-size: 11px; color: rgba(255,255,255,0.4);
}
.record-item__weight {
font-size: 14px; font-weight: 600; color: #4a90d9;
}
/* 空状态 */
.empty-state {
flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
color: rgba(255,255,255,0.3);
}
.empty-state__icon {
font-size: 36px; margin-bottom: 12px;
}
.empty-state__text {
font-size: 13px;
}
/* Toast */
.toast {
position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px);
background: rgba(0,0,0,0.85); color: #fff; padding: 12px 28px; border-radius: 8px;
font-size: 13px; z-index: 1000; opacity: 0; visibility: hidden;
transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
white-space: nowrap; pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast--error { background: rgba(255,77,79,0.92); }
.toast--success { background: rgba(82,196,26,0.92); }
</style>
</head>
<body>
<div class="top-bar">
<a class="back-btn" id="backBtn" href="javascript:void(0)">&#x25C0; 返回</a> <span class="top-bar__title">称重录入</span>
<span class="top-bar__user" id="topUser">--</span>
</div>
<div class="main-content">
<!-- 左侧:秤区 -->
<div class="scale-panel">
<!-- 当前任务卡 -->
<div class="current-task">
<div class="current-task__header">
<span class="current-task__label">当前任务</span>
<span class="current-task__switch" onclick="switchTask()">切换任务</span>
</div>
<div class="current-task__body">
<div class="current-task__icon" id="taskIcon">&#x1F954;</div>
<div class="current-task__info">
<div class="current-task__name" id="taskName">土豆</div>
<div class="current-task__detail">
<span id="taskDetail">午餐 | 截止 10:30</span>
</div>
</div>
<div class="current-task__progress">
<div class="progress-mini">
<div class="progress-mini__fill" id="taskProgressFill" style="width: 60%"></div>
</div>
<span class="progress-mini__text" id="taskProgressText">3.0/5.0斤</span>
</div>
</div>
</div>
<!-- 秤显示区 -->
<div class="scale-display" id="scaleDisplay">
<!-- AI 识别结果 -->
<div class="ai-result">
<div class="ai-result__icon" id="aiIcon">&#x1F4C7;</div>
<div class="ai-result__info">
<div class="ai-result__label">AI 识别结果</div>
<div class="ai-result__name" id="aiName">等待放置食材...</div>
<div class="ai-result__confidence" id="aiConfidence"></div>
</div>
<span class="ai-result__status ai-result__status--idle" id="aiStatus">待机</span>
</div>
<!-- 重量显示 -->
<div class="weight-display">
<span class="weight-display__value" id="weightValue">0.00</span>
<span class="weight-display__unit"></span>
<div class="weight-display__status" id="weightStatus">请将食材放置秤上</div>
</div>
<!-- 操作按钮 -->
<div class="scale-actions">
<button class="scale-btn scale-btn--secondary" onclick="resetScale()">清零</button>
<button class="scale-btn scale-btn--primary" id="confirmBtn" onclick="confirmWeighing()" disabled>确认提交</button>
</div>
</div>
</div>
<!-- 右侧:记录区 -->
<div class="record-panel">
<!-- 今日统计 -->
<div class="today-stats">
<div class="today-stat">
<div class="today-stat__value">5</div>
<div class="today-stat__label">今日称重次数</div>
</div>
<div class="today-stat">
<div class="today-stat__value">15.6</div>
<div class="today-stat__label">总重量(斤)</div>
</div>
<div class="today-stat">
<div class="today-stat__value">3</div>
<div class="today-stat__label">完成品类</div>
</div>
</div>
<!-- 本次称重记录 -->
<div class="records-section">
<div class="records-header">
<span class="records-title">本次操作记录</span>
<span class="records-count" id="recordsCount">共 0 条</span>
</div>
<div class="records-list" id="recordsList">
<div class="empty-state" id="emptyState">
<div class="empty-state__icon">&#x1F4ED;</div>
<div class="empty-state__text">暂无称重记录</div>
</div>
</div>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
// 模拟任务数据
var tasks = [
{ id: 1, name: '土豆', icon: '&#x1F954;', need: 5.0, done: 3.0, deadline: '10:30', meal: '午餐' },
{ id: 2, name: '西红柿', icon: '&#x1F345;', need: 3.5, done: 0, deadline: '11:00', meal: '午餐' },
{ id: 3, name: '黄瓜', icon: '&#x1F952;', need: 4.0, done: 2.0, deadline: '10:00', meal: '午餐' }
];
var currentTaskIndex = 0;
// 模拟AI识别结果
var aiResults = {
'potato': { name: '土豆', icon: '&#x1F954;', confidence: 98 },
'tomato': { name: '西红柿', icon: '&#x1F345;', confidence: 96 },
'cabbage': { name: '大白菜', icon: '&#x1F96C;', confidence: 95 },
'carrot': { name: '胡萝卜', icon: '&#x1F955;', confidence: 97 },
'cucumber': { name: '黄瓜', icon: '&#x1F952;', confidence: 94 },
'unknown': { name: '未识别', icon: '&#x2753;', confidence: 0 }
};
var state = 'idle'; // idle | detecting | stable
var currentWeight = 0;
var currentAiResult = null;
var records = [];
// 获取 URL 参数
function getUrlParam(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r !== null) return decodeURIComponent(r[2]);
return null;
}
// 初始化
function init() {
var userName = getUrlParam('user');
if (userName) {
document.getElementById('topUser').textContent = '操作员: ' + userName;
}
var ingredient = getUrlParam('ingredient');
if (ingredient) {
var idx = tasks.findIndex(function(t) { return t.name.includes(ingredient) || ingredient.includes(t.name); });
if (idx >= 0) currentTaskIndex = idx;
}
updateTaskDisplay();
simulateWeighing();
}
// 更新任务显示
function updateTaskDisplay() {
var task = tasks[currentTaskIndex];
document.getElementById('taskIcon').innerHTML = task.icon;
document.getElementById('taskName').textContent = task.name;
document.getElementById('taskDetail').textContent = task.meal + ' | 截止 ' + task.deadline;
var percent = Math.round((task.done / task.need) * 100);
document.getElementById('taskProgressFill').style.width = percent + '%';
document.getElementById('taskProgressText').textContent = task.done.toFixed(1) + '/' + task.need.toFixed(1) + '斤';
}
// 切换任务
function switchTask() {
currentTaskIndex = (currentTaskIndex + 1) % tasks.length;
updateTaskDisplay();
resetScale();
showToast('已切换到: ' + tasks[currentTaskIndex].name, 1500);
}
// 模拟称重流程
function simulateWeighing() {
// 模拟用户放菜
setTimeout(function() {
startDetecting('potato'); // 模拟识别到土豆
}, 2000);
}
// 开始识别
function startDetecting(ingredientKey) {
state = 'detecting';
var scale = document.getElementById('scaleDisplay');
scale.classList.add('weighing');
scale.classList.remove('stable');
document.getElementById('weightStatus').textContent = '正在称重...';
document.getElementById('weightStatus').className = 'weight-display__status weighing';
// 模拟重量变化
var targetWeight = 2.35;
var currentWeightAnim = 0;
var weightInterval = setInterval(function() {
currentWeightAnim += 0.15;
if (currentWeightAnim >= targetWeight) {
currentWeightAnim = targetWeight;
clearInterval(weightInterval);
onWeightStable(ingredientKey, targetWeight);
}
document.getElementById('weightValue').textContent = currentWeightAnim.toFixed(2);
}, 100);
// AI识别
setTimeout(function() {
var result = aiResults[ingredientKey];
currentAiResult = result;
document.getElementById('aiIcon').innerHTML = result.icon;
document.getElementById('aiName').textContent = result.name;
document.getElementById('aiConfidence').textContent = '置信度: ' + result.confidence + '%';
// 检查是否匹配当前任务
var task = tasks[currentTaskIndex];
var isMatch = task.name === result.name || task.name.includes(result.name);
var statusEl = document.getElementById('aiStatus');
if (isMatch) {
statusEl.textContent = '匹配';
statusEl.className = 'ai-result__status ai-result__status--matching';
} else {
statusEl.textContent = '不匹配';
statusEl.className = 'ai-result__status ai-result__status--mismatch';
showToast('AI识别不匹配,请检查食材', 2500, 'error');
}
}, 800);
}
// 重量稳定
function onWeightStable(ingredientKey, weight) {
state = 'stable';
currentWeight = weight;
var scale = document.getElementById('scaleDisplay');
scale.classList.remove('weighing');
scale.classList.add('stable');
document.getElementById('weightStatus').textContent = '重量已稳定';
document.getElementById('weightStatus').className = 'weight-display__status stable';
document.getElementById('confirmBtn').disabled = false;
}
// 确认提交
function confirmWeighing() {
if (state !== 'stable' || !currentAiResult) return;
var task = tasks[currentTaskIndex];
task.done += currentWeight;
// 添加记录
var record = {
name: currentAiResult.name,
icon: currentAiResult.icon,
weight: currentWeight,
time: new Date().toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' })
};
records.unshift(record);
updateRecordsDisplay();
showToast('提交成功: ' + currentAiResult.name + ' ' + currentWeight.toFixed(2) + '斤', 2000, 'success');
// 重置秤
resetScale();
updateTaskDisplay();
}
// 更新记录显示
function updateRecordsDisplay() {
var list = document.getElementById('recordsList');
var empty = document.getElementById('emptyState');
if (records.length === 0) {
empty.style.display = 'flex';
document.getElementById('recordsCount').textContent = '共 0 条';
return;
}
empty.style.display = 'none';
document.getElementById('recordsCount').textContent = '共 ' + records.length + ' 条';
// 清空并重新渲染
var existingItems = list.querySelectorAll('.record-item');
existingItems.forEach(function(el) { el.remove(); });
records.forEach(function(r) {
var item = document.createElement('div');
item.className = 'record-item';
item.innerHTML = '<div class="record-item__icon">' + r.icon + '</div>' +
'<div class="record-item__info"><div class="record-item__name">' + r.name + '</div>' +
'<div class="record-item__time">' + r.time + '</div></div>' +
'<div class="record-item__weight">+' + r.weight.toFixed(2) + '斤</div>';
list.appendChild(item);
});
}
// 清零
function resetScale() {
state = 'idle';
currentWeight = 0;
currentAiResult = null;
var scale = document.getElementById('scaleDisplay');
scale.classList.remove('weighing', 'stable');
document.getElementById('weightValue').textContent = '0.00';
document.getElementById('weightStatus').textContent = '请将食材放置秤上';
document.getElementById('weightStatus').className = 'weight-display__status';
document.getElementById('aiIcon').innerHTML = '&#x1F4C7;';
document.getElementById('aiName').textContent = '等待放置食材...';
document.getElementById('aiConfidence').textContent = '';
document.getElementById('aiStatus').textContent = '待机';
document.getElementById('aiStatus').className = 'ai-result__status ai-result__status--idle';
document.getElementById('confirmBtn').disabled = true;
// 模拟下一次称重
setTimeout(function() {
var ingredients = ['potato', 'tomato', 'cabbage'];
var randomIng = ingredients[Math.floor(Math.random() * ingredients.length)];
startDetecting(randomIng);
}, 3000);
}
// Toast
function showToast(msg, duration, type) {
var el = document.getElementById('toast');
el.textContent = msg;
el.className = 'toast';
if (type === 'error') el.classList.add('toast--error');
if (type === 'success') el.classList.add('toast--success');
el.classList.add('show');
clearTimeout(el._timer);
el._timer = setTimeout(function() { el.classList.remove('show'); }, duration || 2000);
}
init();
</script>
/* 返回按钮:从哪来回哪去 */
(function() {
var backBtn = document.getElementById('backBtn');
if (backBtn) {
var params = new URLSearchParams(window.location.search);
var referer = params.get('referer');
if (referer) {
backBtn.href = referer;
} else if (document.referrer && document.referrer.indexOf(window.location.hostname) !== -1) {
backBtn.href = document.referrer;
} else {
backBtn.href = 'index.html';
}
}
})();
</body>
</html>
@@ -1,538 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1280, initial-scale=1.0">
<title>加工毛菜秤 - 清洗操作 | 蚁熊智能餐养平台</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
background: #0e1326; color: #fff; width: 1280px; height: 720px; overflow: hidden;
}
/* 顶部导航栏 */
.top-bar {
display: flex; align-items: center; height: 44px; background: #1a2b4a; padding: 0 20px;
}
.back-btn {
font-size: 14px; cursor: pointer; color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s;
}
.back-btn:hover { color: #fff; }
.top-bar__title {
flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
}
.top-bar__user {
font-size: 12px; color: rgba(255,255,255,0.5);
}
/* 主内容区 */
.main-content {
height: calc(100% - 44px); padding: 24px 32px; display: flex; gap: 28px;
}
/* 左侧:清洗状态区 */
.washing-panel {
flex: 0 0 520px; display: flex; flex-direction: column; gap: 20px;
}
/* 食材信息卡 */
.ingredient-card {
background: #1a2b4a; border-radius: 16px; padding: 24px;
border: 1px solid rgba(255,255,255,0.06);
}
.ingredient-card__header {
display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.ingredient-card__icon {
width: 64px; height: 64px; border-radius: 14px;
display: flex; align-items: center; justify-content: center;
font-size: 34px; background: rgba(250,173,22,0.15);
}
.ingredient-card__info {
flex: 1;
}
.ingredient-card__name {
font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.ingredient-card__meta {
font-size: 12px; color: rgba(255,255,255,0.5); display: flex; gap: 12px;
}
.ingredient-card__batch {
display: inline-flex; align-items: center; gap: 6px;
padding: 4px 10px; background: rgba(74,144,217,0.15); border-radius: 4px;
font-size: 11px; color: #4a90d9;
}
/* 清洗参数 */
.wash-params {
display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.param-item {
background: rgba(0,0,0,0.15); border-radius: 10px; padding: 14px 16px;
}
.param-item__label {
font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 6px;
}
.param-item__value {
font-size: 18px; font-weight: 600; color: #fff;
}
.param-item__value--blue { color: #4a90d9; }
.param-item__value--green { color: #52c41a; }
/* 清洗进度区 */
.wash-progress {
flex: 1; background: #1a2b4a; border-radius: 16px; padding: 28px;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
border: 2px solid rgba(255,255,255,0.06);
}
.wash-progress.active {
border-color: #4a90d9;
}
.wash-progress.done {
border-color: #52c41a;
}
/* 圆形进度 */
.progress-circle {
position: relative; width: 180px; height: 180px;
}
.progress-circle__svg {
transform: rotate(-90deg);
}
.progress-circle__bg {
fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8;
}
.progress-circle__fill {
fill: none; stroke: #4a90d9; stroke-width: 8;
stroke-linecap: round; stroke-dasharray: 502; stroke-dashoffset: 502;
transition: stroke-dashoffset 0.5s;
}
.progress-circle__fill.done {
stroke: #52c41a;
}
.progress-circle__text {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center;
}
.progress-circle__percent {
font-size: 36px; font-weight: 700; color: #fff;
}
.progress-circle__label {
font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px;
}
/* 清洗阶段 */
.wash-stages {
display: flex; gap: 12px; width: 100%;
}
.wash-stage {
flex: 1; text-align: center; padding: 12px; border-radius: 10px;
background: rgba(0,0,0,0.15);
}
.wash-stage__icon {
font-size: 20px; margin-bottom: 6px;
}
.wash-stage__name {
font-size: 12px; color: rgba(255,255,255,0.5);
}
.wash-stage.active {
background: rgba(74,144,217,0.15);
}
.wash-stage.active .wash-stage__name {
color: #4a90d9;
}
.wash-stage.done {
background: rgba(82,196,26,0.15);
}
.wash-stage.done .wash-stage__name {
color: #52c41a;
}
/* 操作按钮 */
.wash-actions {
display: flex; gap: 12px; width: 100%;
}
.wash-btn {
flex: 1; padding: 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
border: none; cursor: pointer; transition: all 0.2s;
}
.wash-btn--primary {
background: #4a90d9; color: #fff;
}
.wash-btn--primary:hover { background: #5ba0e9; }
.wash-btn--success {
background: #52c41a; color: #fff;
}
.wash-btn--success:hover { background: #62d42a; }
.wash-btn--secondary {
background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8);
}
.wash-btn--secondary:hover { background: rgba(255,255,255,0.12); }
/* 右侧:队列区 */
.queue-panel {
flex: 1; display: flex; flex-direction: column; gap: 16px;
}
/* 待清洗队列 */
.queue-section {
flex: 1; background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
display: flex; flex-direction: column; overflow: hidden;
}
.queue-header {
display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.queue-title {
font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8);
}
.queue-count {
font-size: 12px; color: rgba(255,255,255,0.4);
}
.queue-list {
flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.queue-list::-webkit-scrollbar { width: 4px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.queue-item {
display: flex; align-items: center; gap: 12px;
padding: 12px; background: rgba(0,0,0,0.15); border-radius: 8px;
}
.queue-item__icon {
width: 36px; height: 36px; border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: 18px; background: rgba(250,173,22,0.15);
}
.queue-item__info { flex: 1; }
.queue-item__name {
font-size: 13px; font-weight: 500; color: #fff;
}
.queue-item__weight {
font-size: 11px; color: rgba(255,255,255,0.4);
}
.queue-item__status {
font-size: 11px; padding: 3px 8px; border-radius: 4px;
}
.queue-item__status--waiting { background: rgba(250,173,22,0.15); color: #faad16; }
.queue-item__status--washing { background: rgba(74,144,217,0.15); color: #4a90d9; }
.queue-item__status--done { background: rgba(82,196,26,0.15); color: #52c41a; }
/* 已完成统计 */
.done-stats {
background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
display: flex; gap: 20px;
}
.done-stat {
flex: 1; text-align: center;
}
.done-stat__value {
font-size: 20px; font-weight: 700; color: #52c41a;
}
.done-stat__label {
font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px;
}
/* Toast */
.toast {
position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px);
background: rgba(0,0,0,0.85); color: #fff; padding: 12px 28px; border-radius: 8px;
font-size: 13px; z-index: 1000; opacity: 0; visibility: hidden;
transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
white-space: nowrap; pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast--success { background: rgba(82,196,26,0.92); }
</style>
</head>
<body>
<div class="top-bar">
<a class="back-btn" id="backBtn" href="javascript:void(0)">&#x25C0; 返回</a> <span class="top-bar__title">清洗操作</span>
<span class="top-bar__user" id="topUser">--</span>
</div>
<div class="main-content">
<!-- 左侧:清洗状态区 -->
<div class="washing-panel">
<!-- 食材信息卡 -->
<div class="ingredient-card">
<div class="ingredient-card__header">
<div class="ingredient-card__icon">&#x1F954;</div>
<div class="ingredient-card__info">
<div class="ingredient-card__name">土豆</div>
<div class="ingredient-card__meta">
<span>重量: 2.35斤</span>
<span>午餐</span>
</div>
</div>
<div class="ingredient-card__batch">批次 #20260613-001</div>
</div>
<!-- 清洗参数 -->
<div class="wash-params">
<div class="param-item">
<div class="param-item__label">水温</div>
<div class="param-item__value param-item__value--blue">18°C</div>
</div>
<div class="param-item">
<div class="param-item__label">清洗时长</div>
<div class="param-item__value param-item__value--green">8分钟</div>
</div>
<div class="param-item">
<div class="param-item__label">水流强度</div>
<div class="param-item__value">中等</div>
</div>
<div class="param-item">
<div class="param-item__label">消毒液浓度</div>
<div class="param-item__value">50ppm</div>
</div>
</div>
</div>
<!-- 清洗进度区 -->
<div class="wash-progress" id="washProgress">
<!-- 圆形进度 -->
<div class="progress-circle">
<svg class="progress-circle__svg" width="180" height="180" viewBox="0 0 180 180">
<circle class="progress-circle__bg" cx="90" cy="90" r="80"/>
<circle class="progress-circle__fill" id="progressFill" cx="90" cy="90" r="80"/>
</svg>
<div class="progress-circle__text">
<div class="progress-circle__percent" id="progressPercent">0%</div>
<div class="progress-circle__label" id="progressLabel">等待开始</div>
</div>
</div>
<!-- 清洗阶段 -->
<div class="wash-stages">
<div class="wash-stage" id="stage1">
<div class="wash-stage__icon">&#x1F4A7;</div>
<div class="wash-stage__name">浸泡</div>
</div>
<div class="wash-stage" id="stage2">
<div class="wash-stage__icon">&#x1F30A;</div>
<div class="wash-stage__name">冲洗</div>
</div>
<div class="wash-stage" id="stage3">
<div class="wash-stage__icon">&#x2728;</div>
<div class="wash-stage__name">消毒</div>
</div>
<div class="wash-stage" id="stage4">
<div class="wash-stage__icon">&#x1F32C;</div>
<div class="wash-stage__name">沥水</div>
</div>
</div>
<!-- 操作按钮 -->
<div class="wash-actions">
<button class="wash-btn wash-btn--secondary" onclick="skipWash()">跳过</button>
<button class="wash-btn wash-btn--primary" id="startBtn" onclick="startWash()">开始清洗</button>
<button class="wash-btn wash-btn--success" id="completeBtn" onclick="completeWash()" style="display:none">完成清洗</button>
</div>
</div>
</div>
<!-- 右侧:队列区 -->
<div class="queue-panel">
<!-- 已完成统计 -->
<div class="done-stats">
<div class="done-stat">
<div class="done-stat__value">3</div>
<div class="done-stat__label">今日已清洗</div>
</div>
<div class="done-stat">
<div class="done-stat__value">12.5斤</div>
<div class="done-stat__label">总重量</div>
</div>
<div class="done-stat">
<div class="done-stat__value">100%</div>
<div class="done-stat__label">合格率</div>
</div>
</div>
<!-- 待清洗队列 -->
<div class="queue-section">
<div class="queue-header">
<span class="queue-title">待清洗队列</span>
<span class="queue-count" id="queueCount">共 4 项</span>
</div>
<div class="queue-list">
<div class="queue-item">
<div class="queue-item__icon">&#x1F345;</div>
<div class="queue-item__info">
<div class="queue-item__name">西红柿</div>
<div class="queue-item__weight">2.8斤</div>
</div>
<span class="queue-item__status queue-item__status--waiting">待清洗</span>
</div>
<div class="queue-item">
<div class="queue-item__icon">&#x1F952;</div>
<div class="queue-item__info">
<div class="queue-item__name">黄瓜</div>
<div class="queue-item__weight">3.2斤</div>
</div>
<span class="queue-item__status queue-item__status--waiting">待清洗</span>
</div>
<div class="queue-item">
<div class="queue-item__icon">&#x1F955;</div>
<div class="queue-item__info">
<div class="queue-item__name">胡萝卜</div>
<div class="queue-item__weight">1.8斤</div>
</div>
<span class="queue-item__status queue-item__status--waiting">待清洗</span>
</div>
<div class="queue-item">
<div class="queue-item__icon">&#x1F96C;</div>
<div class="queue-item__info">
<div class="queue-item__name">大白菜</div>
<div class="queue-item__weight">4.5斤</div>
</div>
<span class="queue-item__status queue-item__status--waiting">待清洗</span>
</div>
</div>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
// 获取 URL 参数
function getUrlParam(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r !== null) return decodeURIComponent(r[2]);
return null;
}
var userName = getUrlParam('user');
if (userName) {
document.getElementById('topUser').textContent = '操作员: ' + userName;
}
var isWashing = false;
var washProgress = 0;
var washInterval = null;
// 开始清洗
function startWash() {
if (isWashing) return;
isWashing = true;
washProgress = 0;
document.getElementById('startBtn').style.display = 'none';
document.getElementById('washProgress').classList.add('active');
showToast('清洗开始...', 1500);
washInterval = setInterval(function() {
washProgress += 1;
// 更新进度圆环
var offset = 502 - (502 * washProgress / 100);
document.getElementById('progressFill').style.strokeDashoffset = offset;
document.getElementById('progressPercent').textContent = washProgress + '%';
// 更新阶段
updateStages();
if (washProgress >= 100) {
clearInterval(washInterval);
onWashComplete();
}
}, 200); // 20秒完成(演示用)
}
// 更新阶段状态
function updateStages() {
var stages = ['stage1', 'stage2', 'stage3', 'stage4'];
var thresholds = [25, 50, 75, 100];
stages.forEach(function(id, idx) {
var el = document.getElementById(id);
el.classList.remove('active', 'done');
if (washProgress >= thresholds[idx]) {
el.classList.add('done');
} else if (washProgress >= (thresholds[idx - 1] || 0)) {
el.classList.add('active');
}
});
// 更新标签
if (washProgress < 25) {
document.getElementById('progressLabel').textContent = '浸泡中...';
} else if (washProgress < 50) {
document.getElementById('progressLabel').textContent = '冲洗中...';
} else if (washProgress < 75) {
document.getElementById('progressLabel').textContent = '消毒中...';
} else if (washProgress < 100) {
document.getElementById('progressLabel').textContent = '沥水中...';
} else {
document.getElementById('progressLabel').textContent = '清洗完成';
}
}
// 清洗完成
function onWashComplete() {
isWashing = false;
document.getElementById('washProgress').classList.remove('active');
document.getElementById('washProgress').classList.add('done');
document.getElementById('progressFill').classList.add('done');
document.getElementById('completeBtn').style.display = 'block';
showToast('清洗完成,请点击"完成清洗"提交', 3000, 'success');
}
// 完成清洗
function completeWash() {
showToast('已提交,食材已转入净菜加工区', 2500, 'success');
setTimeout(function() {
window.location.href = '02-weighing.html' + (userName ? '?user=' + encodeURIComponent(userName) : '');
}, 1500);
}
// 跳过清洗
function skipWash() {
if (confirm('确定跳过清洗步骤?')) {
showToast('已跳过清洗', 1500);
setTimeout(function() {
window.location.href = '02-weighing.html' + (userName ? '?user=' + encodeURIComponent(userName) : '');
}, 1000);
}
}
// Toast
function showToast(msg, duration, type) {
var el = document.getElementById('toast');
el.textContent = msg;
el.className = 'toast';
if (type === 'success') el.classList.add('toast--success');
el.classList.add('show');
clearTimeout(el._timer);
el._timer = setTimeout(function() { el.classList.remove('show'); }, duration || 2000);
}
</script>
/* 返回按钮:从哪来回哪去 */
(function() {
var backBtn = document.getElementById('backBtn');
if (backBtn) {
var params = new URLSearchParams(window.location.search);
var referer = params.get('referer');
if (referer) {
backBtn.href = referer;
} else if (document.referrer && document.referrer.indexOf(window.location.hostname) !== -1) {
backBtn.href = document.referrer;
} else {
backBtn.href = 'index.html';
}
}
})();
</body>
</html>
@@ -1,5 +1,14 @@
# 加工毛菜秤 CHANGELOG
## [2026-06-16] refactor: 删除称重录入和清洗操作入口
### 删除
- 首页移除「称重录入」和「清洗操作」两个功能卡片
- 删除 `02-weighing.html`(称重录入页面)
- 删除 `03-washing.html`(清洗操作页面)
---
## [2026-06-15] feat: 新增重新识别按钮
### 新增
@@ -43,22 +43,6 @@
</div>
<span class="card__arrow">&#x203A;</span>
</a>
<a class="card" href="02-weighing.html">
<span class="card__icon">&#x2696;&#xFE0F;</span>
<div class="card__info">
<div class="card__title">称重录入</div>
<div class="card__desc">毛菜上秤AI识别、称重、确认提交</div>
</div>
<span class="card__arrow">&#x203A;</span>
</a>
<a class="card" href="03-washing.html">
<span class="card__icon">&#x1F4A7;</span>
<div class="card__info">
<div class="card__title">清洗操作</div>
<div class="card__desc">清洗流程确认、进度跟踪</div>
</div>
<span class="card__arrow">&#x203A;</span>
</a>
<a class="card" href="04-history.html">
<span class="card__icon">&#x1F4DD;</span>
<div class="card__info">