Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aafecd719e | ||
|
|
0da2f87505 |
@@ -3,33 +3,27 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=1280, initial-scale=1.0">
|
||||
<title>净菜加工秤 - 欢迎 | 蚁熊智能餐养平台</title>
|
||||
<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;
|
||||
.login-page {
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
.back-btn {
|
||||
font-size: 14px; cursor: pointer; color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s;
|
||||
.login-card {
|
||||
width: 420px; background: #1a2b4a; border-radius: 16px; padding: 32px;
|
||||
display: flex; flex-direction: column; gap: 20px;
|
||||
border: 1px solid rgba(255,255,255,0.06);
|
||||
}
|
||||
.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);
|
||||
.login-card__title {
|
||||
font-size: 20px; font-weight: 700; text-align: center; color: rgba(255,255,255,0.9);
|
||||
}
|
||||
.welcome-main {
|
||||
display: flex; align-items: stretch;
|
||||
height: calc(100% - 44px); padding: 24px 32px; gap: 32px;
|
||||
}
|
||||
.login-panel {
|
||||
flex: 0 0 420px; display: flex; flex-direction: column; gap: 20px;
|
||||
background: #1a2b4a; border-radius: 16px; padding: 24px;
|
||||
}
|
||||
.login-panel__title {
|
||||
font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.8); text-align: center;
|
||||
.login-card__subtitle {
|
||||
font-size: 12px; text-align: center; color: rgba(255,255,255,0.35); margin-top: -12px;
|
||||
}
|
||||
.login-tabs {
|
||||
display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||
@@ -41,14 +35,14 @@
|
||||
.login-tab:hover { color: rgba(255,255,255,0.8); }
|
||||
.login-tab.active { color: #4a90d9; border-bottom-color: #4a90d9; }
|
||||
.face-section {
|
||||
display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px 0;
|
||||
display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 0;
|
||||
}
|
||||
.face-section.hidden { display: none; }
|
||||
.face-frame {
|
||||
width: 180px; height: 180px; border-radius: 50%;
|
||||
border: 3px dashed rgba(74,144,217,0.4);
|
||||
display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
|
||||
position: relative; background: rgba(26,43,74,0.3);
|
||||
background: rgba(26,43,74,0.3);
|
||||
cursor: pointer; transition: all 0.3s;
|
||||
}
|
||||
.face-frame:hover { border-color: #4a90d9; background: rgba(74,144,217,0.1); }
|
||||
@@ -69,7 +63,7 @@
|
||||
.face-info__name.show { display: block; }
|
||||
.face-info__detail { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px; display: none; }
|
||||
.face-info__detail.show { display: block; }
|
||||
.password-section { display: flex; flex-direction: column; gap: 14px; padding: 16px 0; }
|
||||
.password-section { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
|
||||
.password-section.hidden { display: none; }
|
||||
.form-group { display: flex; flex-direction: column; gap: 6px; }
|
||||
.form-label { font-size: 12px; color: rgba(255,255,255,0.6); }
|
||||
@@ -86,45 +80,6 @@
|
||||
cursor: pointer; transition: all 0.2s; margin-top: 8px;
|
||||
}
|
||||
.login-btn:hover { background: #5ba0e9; transform: translateY(-1px); }
|
||||
.menu-panel {
|
||||
flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px;
|
||||
}
|
||||
.menu-panel__header {
|
||||
display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
|
||||
}
|
||||
.menu-panel__title { font-size: 14px; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
|
||||
.menu-panel__user { font-size: 12px; color: rgba(255,255,255,0.5); }
|
||||
.menu-panel__user.show { display: block; }
|
||||
.menu-panel__user.hidden { display: none; }
|
||||
.menu-btn {
|
||||
display: flex; align-items: center; gap: 14px;
|
||||
padding: 16px 20px; border-radius: 12px;
|
||||
background: #1a2b4a; border: 1px solid rgba(255,255,255,0.06);
|
||||
cursor: pointer; transition: all 0.2s; text-decoration: none; color: #fff;
|
||||
}
|
||||
.menu-btn:hover {
|
||||
transform: translateX(4px); border-color: rgba(74,144,217,0.3);
|
||||
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
|
||||
}
|
||||
.menu-btn:active { transform: translateX(2px) scale(0.99); }
|
||||
.menu-btn.disabled {
|
||||
opacity: 0.4; cursor: not-allowed; transform: none !important;
|
||||
box-shadow: none !important; border-color: transparent !important;
|
||||
}
|
||||
.menu-btn__icon {
|
||||
width: 44px; height: 44px; border-radius: 10px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 22px; flex-shrink: 0;
|
||||
}
|
||||
.menu-btn__icon--blue { background: rgba(74,144,217,0.15); }
|
||||
.menu-btn__icon--green { background: rgba(82,196,26,0.15); }
|
||||
.menu-btn__icon--orange { background: rgba(250,173,22,0.15); }
|
||||
.menu-btn__icon--purple { background: rgba(114,46,209,0.15); }
|
||||
.menu-btn__icon--gray { background: rgba(255,255,255,0.08); }
|
||||
.menu-btn__info { flex: 1; }
|
||||
.menu-btn__title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
|
||||
.menu-btn__desc { font-size: 12px; color: rgba(255,255,255,0.4); }
|
||||
.menu-btn__arrow { font-size: 16px; color: rgba(255,255,255,0.25); flex-shrink: 0; }
|
||||
.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;
|
||||
@@ -138,12 +93,10 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="top-bar">
|
||||
<span class="top-bar__title">净菜加工秤</span>
|
||||
</div>
|
||||
<div class="welcome-main">
|
||||
<div class="login-panel">
|
||||
<div class="login-panel__title">员工登录</div>
|
||||
<div class="login-page">
|
||||
<div class="login-card">
|
||||
<div class="login-card__title">净菜加工秤</div>
|
||||
<div class="login-card__subtitle">员工登录</div>
|
||||
<div class="login-tabs">
|
||||
<div class="login-tab active" data-tab="face" onclick="switchTab('face')">人脸识别</div>
|
||||
<div class="login-tab" data-tab="password" onclick="switchTab('password')">账号密码</div>
|
||||
@@ -154,7 +107,7 @@
|
||||
<div class="face-frame__text" id="faceText">点击激活<br>人脸识别</div>
|
||||
</div>
|
||||
<div class="face-info">
|
||||
<span class="face-info__status" id="faceStatus">识别成功后即可使用各项功能</span>
|
||||
<span class="face-info__status" id="faceStatus">识别成功后即可进入功能菜单</span>
|
||||
<div class="face-info__name" id="faceName"></div>
|
||||
<div class="face-info__detail" id="faceDetail"></div>
|
||||
</div>
|
||||
@@ -171,56 +124,16 @@
|
||||
<button class="login-btn" onclick="passwordLogin()">登录</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-panel">
|
||||
<div class="menu-panel__header">
|
||||
<div class="menu-panel__title">📌 功能菜单</div>
|
||||
<div class="menu-panel__user hidden" id="menuUser"></div>
|
||||
</div>
|
||||
<a class="menu-btn disabled" id="btnTasks" onclick="handleMenu('01-cutting-tasks.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--blue">📋</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">今日任务</div>
|
||||
<div class="menu-btn__desc">查看系统分配的切配任务清单</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
<a class="menu-btn disabled" id="btnWeighing" onclick="handleMenu('02-weighing.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--green">⚖️</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">称重录入</div>
|
||||
<div class="menu-btn__desc">净菜上秤识别、称重、确认</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
<a class="menu-btn disabled" id="btnHistory" onclick="handleMenu('04-history.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--orange">📝</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">切配记录</div>
|
||||
<div class="menu-btn__desc">历史切配记录查看与筛选</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
<a class="menu-btn disabled" id="btnSettings" onclick="handleMenu('05-settings.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--gray">⚙️</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">设备设置</div>
|
||||
<div class="menu-btn__desc">设备参数配置与状态查看</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="toast" id="toast"></div>
|
||||
<script>
|
||||
var loginState = 'idle';
|
||||
var currentUser = null;
|
||||
var loginTab = 'face';
|
||||
var mockUsers = [
|
||||
{ name: '赵六', id: 'EMP-20260030', dept: '加工车间', role: '切配员', empId: '20001', password: '123456' },
|
||||
{ name: '孙七', id: 'EMP-20260035', dept: '加工车间', role: '切配员', empId: '20002', password: '123456' },
|
||||
{ name: '周八', id: 'EMP-20260040', dept: '质检部', role: '质检员', empId: '20003', password: '123456' }
|
||||
];
|
||||
var menuButtons = ['btnTasks', 'btnWeighing', 'btnHistory', 'btnSettings'];
|
||||
|
||||
function switchTab(tab) {
|
||||
loginTab = tab;
|
||||
@@ -263,7 +176,6 @@
|
||||
}
|
||||
|
||||
function loginSuccess(user) {
|
||||
currentUser = user;
|
||||
loginState = 'success';
|
||||
var frame = document.getElementById('faceFrame');
|
||||
var icon = document.getElementById('faceIcon');
|
||||
@@ -279,21 +191,10 @@
|
||||
var detailEl = document.getElementById('faceDetail');
|
||||
detailEl.textContent = user.dept + ' · ' + user.id;
|
||||
detailEl.classList.add('show');
|
||||
var menuUser = document.getElementById('menuUser');
|
||||
menuUser.textContent = '当前用户:' + user.name;
|
||||
menuUser.classList.remove('hidden');
|
||||
menuButtons.forEach(function(id) {
|
||||
document.getElementById(id).classList.remove('disabled');
|
||||
});
|
||||
showToast('欢迎,' + user.name, 2000);
|
||||
}
|
||||
|
||||
function handleMenu(target) {
|
||||
if (loginState !== 'success' || !currentUser) {
|
||||
showToast('请先登录', 2000, 'warn');
|
||||
return;
|
||||
}
|
||||
window.location.href = target + '?user=' + encodeURIComponent(currentUser.name) + '&uid=' + currentUser.id;
|
||||
showToast('欢迎,' + user.name, 1500);
|
||||
setTimeout(function() {
|
||||
window.location.href = '01-menu.html?user=' + encodeURIComponent(user.name) + '&uid=' + user.id;
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function showToast(msg, duration, type) {
|
||||
@@ -308,4 +209,4 @@
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -0,0 +1,585 @@
|
||||
<!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;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* ---- 顶部导航栏 ---- */
|
||||
.top-bar {
|
||||
display: flex; align-items: center; height: 52px; 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;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.back-btn:hover { color: #fff; }
|
||||
.page-title {
|
||||
font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
|
||||
}
|
||||
.user-info {
|
||||
margin-left: auto; font-size: 12px; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 6px;
|
||||
}
|
||||
.top-progress {
|
||||
display: flex; align-items: center; gap: 8px; margin: 0 16px;
|
||||
}
|
||||
.top-progress__label { font-size: 11px; color: rgba(255,255,255,0.4); }
|
||||
.top-progress__count { font-size: 12px; color: #4a90d9; font-weight: 600; }
|
||||
.top-progress__bar-wrap {
|
||||
width: 120px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
|
||||
}
|
||||
.top-progress__bar {
|
||||
height: 100%; background: linear-gradient(90deg, #4a90d9, #52c41a); border-radius: 2px;
|
||||
transition: width 0.4s ease;
|
||||
}
|
||||
.user-info .avatar {
|
||||
width: 28px; height: 28px; border-radius: 50%; background: #4a90d9;
|
||||
display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
|
||||
}
|
||||
.logout-btn {
|
||||
margin-left: 10px; padding: 4px 10px; font-size: 11px;
|
||||
background: rgba(255,77,79,0.08); border: 1px solid rgba(255,77,79,0.2);
|
||||
border-radius: 5px; color: rgba(255,77,79,0.7); cursor: pointer;
|
||||
transition: all 0.2s; font-family: inherit;
|
||||
}
|
||||
.logout-btn:hover { background: rgba(255,77,79,0.18); color: #ff6b6d; border-color: rgba(255,77,79,0.4); }
|
||||
|
||||
/* ===== 主页面:两列布局 ===== */
|
||||
.main-page {
|
||||
display: flex; height: calc(100% - 52px);
|
||||
}
|
||||
|
||||
/* 左列:识别 + 候选 */
|
||||
.col-left {
|
||||
width: 440px; flex-shrink: 0; padding: 12px 12px 12px 20px;
|
||||
display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
|
||||
}
|
||||
.col-left::-webkit-scrollbar { width: 3px; }
|
||||
.col-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
|
||||
.col-label {
|
||||
font-size: 12px; color: rgba(255,255,255,0.4); font-weight: 500; letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* 识别画面 */
|
||||
.camera-frame {
|
||||
width: 100%; height: 200px; flex-shrink: 0; background: #0D1117; border-radius: 12px;
|
||||
border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center;
|
||||
justify-content: center; position: relative; overflow: hidden;
|
||||
}
|
||||
.camera-frame__text { color: rgba(255,255,255,0.2); font-size: 12px; z-index: 1; }
|
||||
.camera-frame::before, .camera-frame::after {
|
||||
content: ""; position: absolute; pointer-events: none; z-index: 2;
|
||||
}
|
||||
.camera-frame::before {
|
||||
top: 0; bottom: 0; left: 50%; width: 1px; border-left: 1px dashed rgba(74,144,217,0.25);
|
||||
}
|
||||
.camera-frame::after {
|
||||
left: 0; right: 0; top: 50%; height: 1px; border-top: 1px dashed rgba(74,144,217,0.25);
|
||||
}
|
||||
.corner { position: absolute; width: 20px; height: 20px; z-index: 3; }
|
||||
.corner--tl { top: 12px; left: 12px; border-top: 2px solid #4a90d9; border-left: 2px solid #4a90d9; }
|
||||
.corner--tr { top: 12px; right: 12px; border-top: 2px solid #4a90d9; border-right: 2px solid #4a90d9; }
|
||||
.corner--bl { bottom: 12px; left: 12px; border-bottom: 2px solid #4a90d9; border-left: 2px solid #4a90d9; }
|
||||
.corner--br { bottom: 12px; right: 12px; border-bottom: 2px solid #4a90d9; border-right: 2px solid #4a90d9; }
|
||||
.camera-overlay {
|
||||
position: absolute; inset: 0; background: rgba(0,0,0,0.55);
|
||||
display: none; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
|
||||
z-index: 5; cursor: pointer; border-radius: 12px;
|
||||
}
|
||||
.camera-overlay.show { display: flex; }
|
||||
.camera-overlay__icon { font-size: 28px; }
|
||||
.camera-overlay__text { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 500; }
|
||||
|
||||
/* 识别状态 */
|
||||
.recognize-status {
|
||||
display: flex; align-items: center; justify-content: center; gap: 8px;
|
||||
padding: 8px; background: #1a2b4a; border-radius: 8px; font-size: 12px; color: rgba(255,255,255,0.6);
|
||||
}
|
||||
.reidentify-btn {
|
||||
width: 100%; padding: 9px 0; background: rgba(74,144,217,0.1);
|
||||
border: 1px solid rgba(74,144,217,0.25); border-radius: 8px;
|
||||
color: #4a90d9; font-size: 13px; font-weight: 500; cursor: pointer;
|
||||
transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
|
||||
}
|
||||
.reidentify-btn:hover { background: rgba(74,144,217,0.2); border-color: #4a90d9; }
|
||||
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
|
||||
.status-dot--ready { background: #52c41a; box-shadow: 0 0 6px #52c41a; }
|
||||
.status-dot--detecting { background: #faad14; box-shadow: 0 0 6px #faad14; animation: pulse 1s infinite; }
|
||||
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
|
||||
|
||||
/* 候选食材区 */
|
||||
.candidate-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
|
||||
.candidate-header {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
padding: 6px 0; font-size: 12px; color: rgba(255,255,255,0.5);
|
||||
}
|
||||
.candidate-title { font-weight: 500; }
|
||||
.candidate-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
|
||||
.candidate-list::-webkit-scrollbar { width: 3px; }
|
||||
.candidate-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
|
||||
.candidate-item {
|
||||
display: flex; align-items: center; gap: 10px; padding: 8px 10px;
|
||||
background: rgba(0,0,0,0.15); border-radius: 8px; cursor: pointer; transition: all 0.2s;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.candidate-item:hover { border-color: rgba(74,144,217,0.3); background: rgba(74,144,217,0.06); }
|
||||
.candidate-item__icon { font-size: 20px; width: 32px; text-align: center; }
|
||||
.candidate-item__info { flex: 1; }
|
||||
.candidate-item__name { font-size: 13px; font-weight: 600; color: #fff; }
|
||||
.candidate-item__conf { font-size: 11px; color: rgba(255,255,255,0.4); }
|
||||
.candidate-item__add {
|
||||
width: 28px; height: 28px; border-radius: 50%; border: none;
|
||||
background: rgba(74,144,217,0.15); color: #4a90d9; font-size: 16px;
|
||||
cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.candidate-item__add:hover { background: rgba(74,144,217,0.3); }
|
||||
.candidate-empty {
|
||||
flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
||||
gap: 8px; color: rgba(255,255,255,0.2);
|
||||
}
|
||||
.candidate-empty__icon { font-size: 32px; }
|
||||
.candidate-empty__text { font-size: 12px; }
|
||||
|
||||
.scene-note {
|
||||
font-size: 11px; color: rgba(255,255,255,0.2); text-align: center; padding: 4px 0;
|
||||
}
|
||||
|
||||
/* 右列:验收信息 + 净菜列表 */
|
||||
.col-right {
|
||||
flex: 1; min-width: 0; padding: 12px 20px 12px 12px;
|
||||
display: flex; flex-direction: column; gap: 10px; overflow: hidden;
|
||||
}
|
||||
|
||||
/* 净菜列表 */
|
||||
.food-list {
|
||||
background: #1a2b4a; border-radius: 10px; border: 1px solid rgba(255,255,255,0.06);
|
||||
overflow: hidden; flex: 1; min-height: 0; display: flex; flex-direction: column;
|
||||
}
|
||||
.food-list__head {
|
||||
display: grid; grid-template-columns: 1fr 180px 80px 40px; gap: 6px;
|
||||
padding: 8px 12px; background: rgba(255,255,255,0.03);
|
||||
font-size: 11px; color: rgba(255,255,255,0.4); align-items: center; flex-shrink: 0;
|
||||
}
|
||||
.food-list__body {
|
||||
flex: 1; overflow-y: auto; min-height: 0;
|
||||
}
|
||||
.food-list__body::-webkit-scrollbar { width: 3px; }
|
||||
.food-list__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
|
||||
.food-row {
|
||||
display: grid; grid-template-columns: 1fr 180px 80px 40px; gap: 6px;
|
||||
padding: 8px 12px; font-size: 13px; align-items: center;
|
||||
border-top: 1px solid rgba(255,255,255,0.04);
|
||||
}
|
||||
.food-row__name { font-weight: 600; font-size: 13px; }
|
||||
.food-row__type { font-size: 11px; color: #40a9ff; background: rgba(24,144,255,0.12); padding: 2px 6px; border-radius: 4px; text-align: center; display: inline-block; }
|
||||
.food-row__actual { color: #4a90d9; font-weight: 600; }
|
||||
.food-row__delete {
|
||||
width: 24px; height: 24px; border-radius: 4px; border: none;
|
||||
background: rgba(255,77,79,0.1); color: rgba(255,77,79,0.7); font-size: 12px;
|
||||
cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
|
||||
margin-left: auto;
|
||||
}
|
||||
.food-row__delete:hover { background: rgba(255,77,79,0.25); color: #ff6b6d; }
|
||||
|
||||
/* 底部操作栏 */
|
||||
.bottom-bar {
|
||||
display: flex; align-items: center; justify-content: flex-end; gap: 12px;
|
||||
padding: 10px 0; flex-shrink: 0;
|
||||
}
|
||||
.bottom-bar__btn {
|
||||
padding: 9px 24px; border-radius: 8px; font-size: 13px; font-weight: 600;
|
||||
cursor: pointer; transition: all 0.2s; font-family: inherit; border: none;
|
||||
}
|
||||
.bottom-bar__btn--save {
|
||||
background: rgba(74,144,217,0.12); color: #4a90d9;
|
||||
border: 1px solid rgba(74,144,217,0.25);
|
||||
}
|
||||
.bottom-bar__btn--save:hover { background: rgba(74,144,217,0.2); border-color: #4a90d9; }
|
||||
.bottom-bar__btn--continue {
|
||||
background: #4a90d9; color: #fff;
|
||||
}
|
||||
.bottom-bar__btn--continue:hover { background: #5ba0e9; }
|
||||
|
||||
/* 搜索区 */
|
||||
.search-section { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
|
||||
.search-input-wrap {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
background: #1a2b4a; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 0 10px;
|
||||
}
|
||||
.search-input__icon { font-size: 14px; opacity: 0.4; flex-shrink: 0; }
|
||||
.search-input {
|
||||
flex: 1; background: none; border: none; outline: none;
|
||||
color: #fff; font-size: 12px; padding: 9px 0; font-family: inherit;
|
||||
}
|
||||
.search-input::placeholder { color: rgba(255,255,255,0.25); }
|
||||
.search-results {
|
||||
max-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
|
||||
}
|
||||
.search-results::-webkit-scrollbar { width: 3px; }
|
||||
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
|
||||
.search-item {
|
||||
display: flex; align-items: center; gap: 10px; padding: 6px 10px;
|
||||
background: rgba(0,0,0,0.15); border-radius: 6px; cursor: pointer; transition: all 0.2s;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.search-item:hover { border-color: rgba(74,144,217,0.3); background: rgba(74,144,217,0.06); }
|
||||
.search-item__icon { font-size: 18px; width: 28px; text-align: center; }
|
||||
.search-item__name { font-size: 12px; font-weight: 500; color: #fff; }
|
||||
.search-item__type { font-size: 11px; color: rgba(255,255,255,0.35); }
|
||||
.search-item__add {
|
||||
width: 24px; height: 24px; border-radius: 50%; border: none;
|
||||
background: rgba(82,196,26,0.15); color: #52c41a; font-size: 14px;
|
||||
cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.search-item__add:hover { background: rgba(82,196,26,0.3); }
|
||||
|
||||
/* 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: 1100; opacity: 0; visibility: hidden;
|
||||
transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
|
||||
white-space: nowrap; pointer-events: none; max-width: 90%;
|
||||
text-align: center; line-height: 1.5;
|
||||
}
|
||||
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
|
||||
.toast--warn { background: rgba(250,173,22,0.92); }
|
||||
.toast--error { background: rgba(255,77,79,0.92); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- 顶部导航 -->
|
||||
<div class="top-bar">
|
||||
<a class="back-btn" id="backBtn" href="javascript:void(0)">◀ 返回</a>
|
||||
<span class="page-title">净菜验收识别屏</span>
|
||||
<div class="top-progress" id="topProgress">
|
||||
<span class="top-progress__label">验收进度</span>
|
||||
<span class="top-progress__count" id="progressCount">0/0 净菜已完成</span>
|
||||
<div class="top-progress__bar-wrap">
|
||||
<div class="top-progress__bar" id="progressBar" style="width:0%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="avatar" id="userAvatar">赵</div>
|
||||
<span id="userName">赵六</span>
|
||||
<button class="logout-btn" onclick="handleLogout()">退出</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ===== 主页面:两列布局 ===== -->
|
||||
<div class="main-page" id="mainPage">
|
||||
<!-- 左列:识别 + 候选 -->
|
||||
<div class="col-left">
|
||||
<div class="col-label">📷 净菜识别</div>
|
||||
<div class="camera-frame" id="foodCam">
|
||||
<span class="camera-frame__text">净菜识别区域</span>
|
||||
<div class="corner corner--tl"></div>
|
||||
<div class="corner corner--tr"></div>
|
||||
<div class="corner corner--bl"></div>
|
||||
<div class="corner corner--br"></div>
|
||||
<div class="camera-overlay" id="cameraOverlay">
|
||||
<div class="camera-overlay__icon">📷</div>
|
||||
<div class="camera-overlay__text">点击继续识别</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="recognize-status" id="foodStatus">
|
||||
<span class="status-dot status-dot--ready"></span>
|
||||
<span id="foodStatusText">就绪,等待净菜放置</span>
|
||||
</div>
|
||||
<button class="reidentify-btn" onclick="handleReidentify()">🔄 重新识别</button>
|
||||
<div class="search-section">
|
||||
<div class="search-input-wrap">
|
||||
<span class="search-input__icon">🔍</span>
|
||||
<input type="text" class="search-input" id="searchInput" placeholder="搜索净菜名称,回车搜索..." onkeydown="if(event.key==='Enter')handleSearch()">
|
||||
</div>
|
||||
<div class="search-results" id="searchResults"></div>
|
||||
</div>
|
||||
<div class="candidate-section" id="candidateSection">
|
||||
<div class="candidate-header">
|
||||
<span class="candidate-title" id="candidateTitle">AI识别候选</span>
|
||||
</div>
|
||||
<div class="candidate-list" id="candidateList"></div>
|
||||
<div class="candidate-empty" id="candidateEmpty">
|
||||
<div class="candidate-empty__icon">📷</div>
|
||||
<div class="candidate-empty__text">等待净菜放置后自动识别</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右列:净菜列表 -->
|
||||
<div class="col-right">
|
||||
<!-- 净菜验收列表 -->
|
||||
<div class="food-list">
|
||||
<div class="food-list__head">
|
||||
<span>净菜</span><span>净菜类型</span><span>实称量</span><span>操作</span>
|
||||
</div>
|
||||
<div class="food-list__body" id="foodList"></div>
|
||||
</div>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<div class="bottom-bar">
|
||||
<button class="bottom-bar__btn bottom-bar__btn--save" onclick="handleSave()">保存</button>
|
||||
<button class="bottom-bar__btn bottom-bar__btn--continue" onclick="handleSaveContinue()">保存并继续</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script>
|
||||
// ---- 模拟数据 ----
|
||||
// 当前任务净菜列表
|
||||
var mockFoods = [
|
||||
{ name: '土豆丝', size: '35mm*1mm*1mm', shape: '长条', blade: '平刀', target: '5.0斤', icon: '\u{1F954}' },
|
||||
{ name: '胡萝卜丝', size: '20mm*1mm*1mm', shape: '细丝', blade: '平刀', target: '2.0斤', icon: '\u{1F955}' },
|
||||
{ name: '黄瓜片', size: '30mm*30mm*3mm', shape: '圆片', blade: '平刀', target: '4.0斤', icon: '\u{1F952}' }
|
||||
];
|
||||
|
||||
// 净菜食材数据库(供搜索用)
|
||||
var foodDatabase = [
|
||||
{ name: '土豆丝', size: '35mm*1mm*1mm', shape: '长条', blade: '平刀', icon: '\u{1F954}' },
|
||||
{ name: '土豆块', size: '20mm*20mm*20mm', shape: '方丁', blade: '平刀', icon: '\u{1F954}' },
|
||||
{ name: '土豆片', size: '30mm*30mm*3mm', shape: '圆片', blade: '平刀', icon: '\u{1F954}' },
|
||||
{ name: '胡萝卜丝', size: '20mm*1mm*1mm', shape: '细丝', blade: '平刀', icon: '\u{1F955}' },
|
||||
{ name: '胡萝卜片', size: '25mm*25mm*2mm', shape: '圆片', blade: '平刀', icon: '\u{1F955}' },
|
||||
{ name: '黄瓜片', size: '30mm*30mm*3mm', shape: '圆片', blade: '平刀', icon: '\u{1F952}' },
|
||||
{ name: '黄瓜条', size: '40mm*8mm*8mm', shape: '长条', blade: '平刀', icon: '\u{1F952}' },
|
||||
{ name: '大白菜段', size: '50mm*30mm*30mm', shape: '宽段', blade: '平刀', icon: '\u{1F96C}' },
|
||||
{ name: '大白菜丝', size: '30mm*2mm*2mm', shape: '细丝', blade: '平刀', icon: '\u{1F96C}' },
|
||||
{ name: '西红柿块', size: '25mm*25mm*20mm', shape: '楔形块', blade: '平刀', icon: '\u{1F345}' },
|
||||
{ name: '西红柿片', size: '30mm*30mm*5mm', shape: '圆片', blade: '平刀', icon: '\u{1F345}' },
|
||||
{ name: '青椒丝', size: '30mm*3mm*3mm', shape: '长条', blade: '平刀', icon: '\u{1FAD1}' },
|
||||
{ name: '青椒块', size: '20mm*20mm*20mm', shape: '方丁', blade: '平刀', icon: '\u{1FAD1}' },
|
||||
{ name: '洋葱丝', size: '30mm*2mm*2mm', shape: '细丝', blade: '平刀', icon: '\u{1F9C5}' },
|
||||
{ name: '洋葱块', size: '15mm*15mm*15mm', shape: '方丁', blade: '平刀', icon: '\u{1F9C5}' },
|
||||
{ name: '芹菜段', size: '40mm*10mm*10mm', shape: '宽段', blade: '平刀', icon: '\u{1F96C}' },
|
||||
{ name: '芹菜丝', size: '30mm*2mm*2mm', shape: '细丝', blade: '平刀', icon: '\u{1F96C}' },
|
||||
{ name: '莲藕片', size: '35mm*35mm*3mm', shape: '圆片', blade: '平刀', icon: '\u{1FAD1}' },
|
||||
{ name: '莴笋丝', size: '30mm*2mm*2mm', shape: '细丝', blade: '平刀', icon: '\u{1F96C}' },
|
||||
{ name: '豆角段', size: '40mm*10mm*10mm', shape: '宽段', blade: '平刀', icon: '\u{1FAD8}' }
|
||||
];
|
||||
|
||||
var currentUser = null;
|
||||
var acceptedFoods = [];
|
||||
|
||||
// ---- 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() {
|
||||
var userName = getUrlParam('user') || '赵六';
|
||||
var userId = getUrlParam('uid') || 'EMP-20260030';
|
||||
currentUser = { name: userName, id: userId };
|
||||
document.getElementById('userName').textContent = userName;
|
||||
document.getElementById('userAvatar').textContent = userName.charAt(0);
|
||||
|
||||
// 初始化净菜列表(添加即带实称重量)
|
||||
acceptedFoods = mockFoods.map(function(f) {
|
||||
return { name: f.name, size: f.size, shape: f.shape, blade: f.blade, target: f.target, icon: f.icon, actual: f.target, status: 'pass' };
|
||||
});
|
||||
renderFoodList();
|
||||
updateProgress();
|
||||
})();
|
||||
|
||||
// ---- 渲染净菜列表 ----
|
||||
function renderFoodList() {
|
||||
var list = document.getElementById('foodList');
|
||||
var html = '';
|
||||
acceptedFoods.forEach(function(f, idx) {
|
||||
html += '<div class="food-row">'
|
||||
+ '<div class="food-row__name">' + f.icon + ' ' + f.name + '</div>'
|
||||
+ '<div><span class="food-row__type">' + f.size + ' ' + f.shape + ' ' + f.blade + '</span></div>'
|
||||
+ '<div class="food-row__actual">' + f.actual + '</div>'
|
||||
+ '<div><button class="food-row__delete" onclick="removeFood(' + idx + ')" title="删除">✕</button></div>'
|
||||
+ '</div>';
|
||||
});
|
||||
list.innerHTML = html;
|
||||
}
|
||||
|
||||
// ---- 删除净菜 ----
|
||||
function removeFood(idx) {
|
||||
acceptedFoods.splice(idx, 1);
|
||||
renderFoodList();
|
||||
updateProgress();
|
||||
showToast('已删除', 1000);
|
||||
}
|
||||
|
||||
// ---- 更新进度 ----
|
||||
function updateProgress() {
|
||||
var total = acceptedFoods.length;
|
||||
document.getElementById('progressBar').style.width = (total > 0 ? 100 : 0) + '%';
|
||||
document.getElementById('progressCount').textContent = total + '/' + total + ' 净菜已完成';
|
||||
}
|
||||
|
||||
// ---- 模拟识别(演示用,自动逐个验收) ----
|
||||
function simulateRecognize() {
|
||||
var statusDot = document.querySelector('.status-dot');
|
||||
var statusText = document.getElementById('foodStatusText');
|
||||
|
||||
statusDot.className = 'status-dot status-dot--detecting';
|
||||
statusText.textContent = '识别中...';
|
||||
|
||||
setTimeout(function() {
|
||||
var f = mockFoods[Math.floor(Math.random() * mockFoods.length)];
|
||||
statusDot.className = 'status-dot status-dot--ready';
|
||||
statusText.textContent = '识别完成:' + f.name;
|
||||
|
||||
showCandidate(f);
|
||||
|
||||
showToast(f.name + ' 识别成功', 1500);
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// ---- 显示AI识别候选 ----
|
||||
function showCandidate(food) {
|
||||
var list = document.getElementById('candidateList');
|
||||
var empty = document.getElementById('candidateEmpty');
|
||||
empty.style.display = 'none';
|
||||
list.innerHTML = '<div class="candidate-item" onclick="addFromCandidate(\'' + food.name.replace(/'/g, "\\'") + '\')">'
|
||||
+ '<div class="candidate-item__icon">' + food.icon + '</div>'
|
||||
+ '<div class="candidate-item__info">'
|
||||
+ '<div class="candidate-item__name">' + food.name + '</div>'
|
||||
+ '<div class="candidate-item__conf">置信度 96% · ' + food.size + ' · ' + food.shape + ' · ' + food.blade + '</div>'
|
||||
+ '</div>'
|
||||
+ '<button class="candidate-item__add" onclick="event.stopPropagation();addFromCandidate(\'' + food.name.replace(/'/g, "\\'") + '\')">+</button>'
|
||||
+ '</div>';
|
||||
}
|
||||
|
||||
// ---- 搜索处理 ----
|
||||
var searchTimer = null;
|
||||
function handleSearch() {
|
||||
clearTimeout(searchTimer);
|
||||
var keyword = document.getElementById('searchInput').value.trim();
|
||||
if (!keyword) {
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
return;
|
||||
}
|
||||
searchTimer = setTimeout(function() {
|
||||
var results = foodDatabase.filter(function(f) {
|
||||
return f.name.indexOf(keyword) !== -1;
|
||||
});
|
||||
// 排除已在列表中的净菜
|
||||
var existingNames = acceptedFoods.map(function(f) { return f.name; });
|
||||
results = results.filter(function(f) { return existingNames.indexOf(f.name) === -1; });
|
||||
|
||||
var wrap = document.getElementById('searchResults');
|
||||
if (results.length === 0) {
|
||||
wrap.innerHTML = '<div style="font-size:11px;color:rgba(255,255,255,0.25);text-align:center;padding:4px;">无匹配结果</div>';
|
||||
return;
|
||||
}
|
||||
var html = '';
|
||||
results.forEach(function(f) {
|
||||
html += '<div class="search-item" onclick="addFromSearch(\'' + f.name.replace(/'/g, "\\'") + '\')">'
|
||||
+ '<div class="search-item__icon">' + f.icon + '</div>'
|
||||
+ '<div style="flex:1;min-width:0;">'
|
||||
+ '<div class="search-item__name">' + f.name + '</div>'
|
||||
+ '<div class="search-item__type">' + f.size + ' · ' + f.shape + ' · ' + f.blade + '</div>'
|
||||
+ '</div>'
|
||||
+ '<button class="search-item__add" onclick="event.stopPropagation();addFromSearch(\'' + f.name.replace(/'/g, "\\'") + '\')">+</button>'
|
||||
+ '</div>';
|
||||
});
|
||||
wrap.innerHTML = html;
|
||||
}, 200);
|
||||
}
|
||||
|
||||
// ---- 从搜索结果添加净菜 ----
|
||||
function addFromSearch(name) {
|
||||
var food = foodDatabase.find(function(f) { return f.name === name; });
|
||||
if (!food) return;
|
||||
// 检查是否已存在
|
||||
var exists = acceptedFoods.find(function(f) { return f.name === name; });
|
||||
if (exists) { showToast(name + ' 已在列表中', 1200, 'warn'); return; }
|
||||
var randomWeight = (Math.random() * 4 + 1).toFixed(1) + '斤';
|
||||
acceptedFoods.push({ name: food.name, size: food.size, shape: food.shape, blade: food.blade, target: '--', icon: food.icon, actual: randomWeight, status: 'pass' });
|
||||
renderFoodList();
|
||||
updateProgress();
|
||||
document.getElementById('searchInput').value = '';
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
showToast(name + ' 已添加到列表', 1200);
|
||||
}
|
||||
|
||||
// ---- 从AI候选添加净菜 ----
|
||||
function addFromCandidate(name) {
|
||||
var exists = acceptedFoods.find(function(f) { return f.name === name; });
|
||||
if (exists) { showToast(name + ' 已在列表中', 1200, 'warn'); return; }
|
||||
simulateRecognize();
|
||||
}
|
||||
|
||||
// ---- 重新识别 ----
|
||||
function handleReidentify() {
|
||||
showToast('重新识别中...', 1000);
|
||||
simulateRecognize();
|
||||
}
|
||||
|
||||
// ---- 保存(跳转菜单页) ----
|
||||
function handleSave() {
|
||||
window.location.href = '01-menu.html?user=' + encodeURIComponent(currentUser.name) + '&uid=' + currentUser.id;
|
||||
}
|
||||
|
||||
// ---- 保存并继续(重置页面) ----
|
||||
function handleSaveContinue() {
|
||||
showToast('保存成功', 1500);
|
||||
acceptedFoods = mockFoods.map(function(f) {
|
||||
return { name: f.name, size: f.size, shape: f.shape, blade: f.blade, target: f.target, icon: f.icon, actual: f.target, status: 'pass' };
|
||||
});
|
||||
renderFoodList();
|
||||
updateProgress();
|
||||
document.getElementById('candidateEmpty').style.display = 'flex';
|
||||
document.getElementById('candidateList').innerHTML = '';
|
||||
document.getElementById('searchInput').value = '';
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
document.getElementById('foodStatusText').textContent = '就绪,等待净菜放置';
|
||||
document.querySelector('.status-dot').className = 'status-dot status-dot--ready';
|
||||
}
|
||||
|
||||
// ---- 退出登录 ----
|
||||
function handleLogout() {
|
||||
window.location.href = '00-welcome.html';
|
||||
}
|
||||
|
||||
// ---- Toast ----
|
||||
function showToast(msg, duration, type) {
|
||||
var el = document.getElementById('toast');
|
||||
el.textContent = msg;
|
||||
el.className = 'toast';
|
||||
if (type === 'warn') el.classList.add('toast--warn');
|
||||
if (type === 'error') el.classList.add('toast--error');
|
||||
el.classList.add('show');
|
||||
clearTimeout(el._timer);
|
||||
el._timer = setTimeout(function() { el.classList.remove('show'); }, duration || 2000);
|
||||
}
|
||||
</script>
|
||||
|
||||
<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 = '01-menu.html';
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,618 +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; flex-direction: column; gap: 16px; }
|
||||
|
||||
/* 状态标签卡(统计+筛选二合一) */
|
||||
.tasks-tabs { display: flex; gap: 10px; }
|
||||
.status-tab {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 20px; border-radius: 8px;
|
||||
background: #1a2b4a; border: 1px solid rgba(255,255,255,0.06);
|
||||
cursor: pointer; transition: all 0.2s; user-select: none;
|
||||
}
|
||||
.status-tab:hover { border-color: rgba(255,255,255,0.15); }
|
||||
.status-tab.active--pending { background: rgba(250,173,22,0.15); border-color: rgba(250,173,22,0.4); }
|
||||
.status-tab.active--done { background: rgba(82,196,26,0.15); border-color: rgba(82,196,26,0.4); }
|
||||
.status-tab__label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.7); }
|
||||
.status-tab__count { font-size: 20px; font-weight: 700; color: #fff; }
|
||||
|
||||
.tasks-section { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
|
||||
.task-list {
|
||||
flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
|
||||
padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
|
||||
}
|
||||
.task-list::-webkit-scrollbar { width: 4px; }
|
||||
.task-list::-webkit-scrollbar-track { background: transparent; }
|
||||
.task-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
|
||||
.task-item {
|
||||
display: flex; align-items: center; gap: 16px;
|
||||
background: #1a2b4a; border-radius: 12px; padding: 16px 20px;
|
||||
border: 1px solid rgba(255,255,255,0.06); cursor: pointer; transition: all 0.2s;
|
||||
}
|
||||
.task-item:hover { border-color: rgba(74,144,217,0.3); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
|
||||
.task-icon {
|
||||
width: 52px; height: 52px; border-radius: 12px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 26px; flex-shrink: 0;
|
||||
}
|
||||
.task-icon--potato { background: rgba(250,173,22,0.15); }
|
||||
.task-icon--tomato { background: rgba(255,77,79,0.15); }
|
||||
.task-icon--cabbage { background: rgba(82,196,26,0.15); }
|
||||
.task-icon--carrot { background: rgba(250,140,22,0.15); }
|
||||
.task-icon--cucumber { background: rgba(20,184,166,0.15); }
|
||||
.task-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
|
||||
.task-name { font-size: 15px; font-weight: 600; color: #fff; }
|
||||
.task-detail { font-size: 12px; color: rgba(255,255,255,0.5); display: flex; gap: 12px; }
|
||||
.task-detail__item { display: flex; align-items: center; gap: 4px; }
|
||||
.task-cutting {
|
||||
display: flex; align-items: center; gap: 6px;
|
||||
padding: 4px 10px; background: rgba(114,46,209,0.15); border-radius: 4px;
|
||||
font-size: 11px; color: #722ed1;
|
||||
}
|
||||
.task-progress { width: 140px; display: flex; flex-direction: column; gap: 4px; }
|
||||
.progress-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
|
||||
.progress-bar__fill { height: 100%; border-radius: 3px; }
|
||||
.progress-bar__fill--blue { background: #4a90d9; }
|
||||
.progress-bar__fill--green { background: #52c41a; }
|
||||
.progress-text { font-size: 11px; color: rgba(255,255,255,0.5); text-align: right; }
|
||||
.task-status { width: 80px; text-align: center; }
|
||||
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
|
||||
.status-badge--pending { background: rgba(250,173,22,0.15); color: #faad16; }
|
||||
.status-badge--done { background: rgba(82,196,26,0.15); color: #52c41a; }
|
||||
.task-action { width: 80px; }
|
||||
.action-btn {
|
||||
padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 500;
|
||||
background: #4a90d9; color: #fff; border: none; cursor: pointer; transition: all 0.2s;
|
||||
}
|
||||
.action-btn:hover { background: #5ba0e9; }
|
||||
.action-btn--done { background: rgba(82,196,26,0.15); color: #52c41a; cursor: default; }
|
||||
|
||||
/* 弹窗遮罩层 */
|
||||
.modal-overlay {
|
||||
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.6); z-index: 900;
|
||||
display: none; align-items: center; justify-content: center;
|
||||
}
|
||||
.modal-overlay.open { display: flex; }
|
||||
.modal-box {
|
||||
width: 1220px; height: 660px; background: #0e1326; border-radius: 16px;
|
||||
display: flex; flex-direction: column; overflow: hidden;
|
||||
box-shadow: 0 24px 64px rgba(0,0,0,0.7);
|
||||
}
|
||||
.modal-header {
|
||||
display: flex; align-items: center; height: 44px; background: #1a2b4a; padding: 0 20px;
|
||||
}
|
||||
.modal-close {
|
||||
font-size: 14px; cursor: pointer; color: rgba(255,255,255,0.7); transition: color 0.2s;
|
||||
background: none; border: none;
|
||||
}
|
||||
.modal-close:hover { color: #fff; }
|
||||
.modal-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85); }
|
||||
.modal-body { flex: 1; display: flex; gap: 20px; padding: 16px 20px; overflow: hidden; }
|
||||
.modal-scale-panel { flex: 0 0 540px; display: flex; flex-direction: column; gap: 12px; }
|
||||
.modal-task { background: #1a2b4a; border-radius: 12px; padding: 12px 16px; border: 1px solid rgba(255,255,255,0.06); }
|
||||
.modal-task__body { display: flex; align-items: center; gap: 12px; }
|
||||
.modal-task__icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
|
||||
.modal-task__info { flex: 1; }
|
||||
.modal-task__name { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 2px; }
|
||||
.modal-task__cutting { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: rgba(114,46,209,0.15); border-radius: 4px; font-size: 11px; color: #722ed1; }
|
||||
.modal-task__progress { display: flex; align-items: center; gap: 8px; margin-top: 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: 14px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border: 2px solid rgba(255,255,255,0.06); }
|
||||
.scale-display.weighing { border-color: #4a90d9; }
|
||||
.scale-display.stable { border-color: #52c41a; }
|
||||
.ai-result { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: rgba(0,0,0,0.2); border-radius: 10px; width: 100%; }
|
||||
.ai-result__icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 26px; 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: 2px; }
|
||||
.ai-result__name { font-size: 18px; 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: 60px; font-weight: 700; color: #fff; line-height: 1; font-family: "Courier New", monospace; }
|
||||
.weight-display__unit { font-size: 18px; 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: 6px; }
|
||||
.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: 12px; 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); }
|
||||
.modal-records-panel { flex: 1; display: flex; flex-direction: column; gap: 12px; }
|
||||
.modal-records { flex: 1; background: #1a2b4a; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; overflow: hidden; }
|
||||
.modal-records__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
|
||||
.modal-records__title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8); }
|
||||
.modal-records__count { font-size: 12px; color: rgba(255,255,255,0.4); }
|
||||
.modal-records__list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
|
||||
.modal-records__list::-webkit-scrollbar { width: 4px; }
|
||||
.modal-records__list::-webkit-scrollbar-track { background: transparent; }
|
||||
.modal-records__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
|
||||
.modal-record { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(0,0,0,0.15); border-radius: 8px; }
|
||||
.modal-record__icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; background: rgba(250,173,22,0.15); }
|
||||
.modal-record__info { flex: 1; }
|
||||
.modal-record__name { font-size: 12px; font-weight: 500; color: #fff; }
|
||||
.modal-record__cutting { font-size: 11px; color: #722ed1; }
|
||||
.modal-record__time { font-size: 10px; color: rgba(255,255,255,0.3); }
|
||||
.modal-record__weight { font-size: 13px; font-weight: 600; color: #4a90d9; }
|
||||
.modal-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,0.3); }
|
||||
.modal-empty__icon { font-size: 28px; margin-bottom: 8px; }
|
||||
.modal-empty__text { font-size: 12px; }
|
||||
|
||||
.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: 1100; 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)">◀ 返回</a> <span class="top-bar__title">今日切配任务</span>
|
||||
<span class="top-bar__user" id="topUser">--</span>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<!-- 状态标签卡(统计+筛选) -->
|
||||
<div class="tasks-tabs">
|
||||
<div class="status-tab active--pending" data-filter="pending" onclick="filterTasks('pending', this)">
|
||||
<span class="status-tab__label">待处理</span>
|
||||
<span class="status-tab__count" id="pendingCount">3</span>
|
||||
</div>
|
||||
<div class="status-tab" data-filter="done" onclick="filterTasks('done', this)">
|
||||
<span class="status-tab__label">已完成</span>
|
||||
<span class="status-tab__count" id="doneCount">2</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tasks-section">
|
||||
<div class="task-list" id="taskList">
|
||||
<!-- 任务项1 -->
|
||||
<div class="task-item" data-status="pending">
|
||||
<div class="task-icon task-icon--potato">🥔</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">土豆</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 5.0斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 11:00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切丝</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--blue" style="width: 40%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 2.0 / 需 5.0 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--pending">待处理</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn" onclick="openModal('potato')">去处理</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任务项2 -->
|
||||
<div class="task-item" data-status="pending">
|
||||
<div class="task-icon task-icon--carrot">🥕</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">胡萝卜</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 2.0斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 11:30</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切丝</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--blue" style="width: 0%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 0 / 需 2.0 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--pending">待处理</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn" onclick="openModal('carrot')">去处理</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任务项3 -->
|
||||
<div class="task-item" data-status="done">
|
||||
<div class="task-icon task-icon--cucumber">🥒</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">黄瓜</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 4.0斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 10:30</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切片</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--green" style="width: 100%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 4.2 / 需 4.0 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--done">已完成</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn action-btn--done">完成</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任务项4 -->
|
||||
<div class="task-item" data-status="pending">
|
||||
<div class="task-icon task-icon--potato">🥔</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">土豆(晚餐)</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 3.0斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 15:30</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切块</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--blue" style="width: 0%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 0 / 需 3.0 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--pending">待处理</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn" onclick="openModal('potato_dinner')">去处理</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任务项5 -->
|
||||
<div class="task-item" data-status="done">
|
||||
<div class="task-icon task-icon--cabbage">🥬</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">大白菜</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 8.0斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 10:00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切段</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--green" style="width: 100%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 8.5 / 需 8.0 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--done">已完成</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn action-btn--done">完成</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任务项6 -->
|
||||
<div class="task-item" data-status="pending">
|
||||
<div class="task-icon task-icon--tomato">🍅</div>
|
||||
<div class="task-info">
|
||||
<div class="task-name">西红柿</div>
|
||||
<div class="task-detail">
|
||||
<span class="task-detail__item">📦 需求: 3.5斤</span>
|
||||
<span class="task-detail__item">⏰ 截止: 11:30</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-cutting">🔪 切块</div>
|
||||
<div class="task-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__fill progress-bar__fill--blue" style="width: 0%"></div>
|
||||
</div>
|
||||
<div class="progress-text">已切 0 / 需 3.5 斤</div>
|
||||
</div>
|
||||
<div class="task-status">
|
||||
<span class="status-badge status-badge--pending">待处理</span>
|
||||
</div>
|
||||
<div class="task-action">
|
||||
<button class="action-btn" onclick="openModal('tomato')">去处理</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 处理弹窗 -->
|
||||
<div class="modal-overlay" id="modalOverlay">
|
||||
<div class="modal-box">
|
||||
<div class="modal-header">
|
||||
<button class="modal-close" onclick="closeModal()">◀ 返回任务列表</button>
|
||||
<span class="modal-title" id="modalTitle">称重录入</span>
|
||||
<span style="width:80px"></span>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-scale-panel">
|
||||
<div class="modal-task">
|
||||
<div class="modal-task__body">
|
||||
<div class="modal-task__icon task-icon--potato" id="modalTaskIcon">🥔</div>
|
||||
<div class="modal-task__info">
|
||||
<div class="modal-task__name" id="modalTaskName">土豆</div>
|
||||
<span class="modal-task__cutting" id="modalTaskCutting">🔪 切丝</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-task__progress">
|
||||
<div class="progress-mini">
|
||||
<div class="progress-mini__fill" id="modalProgressFill" style="width:40%"></div>
|
||||
</div>
|
||||
<span class="progress-mini__text" id="modalProgressText">2.0/5.0斤</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scale-display" id="scaleDisplay">
|
||||
<div class="ai-result">
|
||||
<div class="ai-result__icon" id="aiIcon">📇</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="confirmCutting()" disabled>确认并切配</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-records-panel">
|
||||
<div class="modal-records">
|
||||
<div class="modal-records__header">
|
||||
<span class="modal-records__title">处理记录</span>
|
||||
<span class="modal-records__count" id="recordsCount">共 0 条</span>
|
||||
</div>
|
||||
<div class="modal-records__list" id="recordsList">
|
||||
<div class="modal-empty" id="emptyState">
|
||||
<div class="modal-empty__icon">📭</div>
|
||||
<div class="modal-empty__text">暂无处理记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script>
|
||||
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;
|
||||
|
||||
// 筛选任务
|
||||
function filterTasks(status, tab) {
|
||||
document.querySelectorAll('.status-tab').forEach(function(el) {
|
||||
el.classList.remove('active--pending', 'active--done');
|
||||
});
|
||||
tab.classList.add(status === 'pending' ? 'active--pending' : 'active--done');
|
||||
document.querySelectorAll('.task-item').forEach(function(item) {
|
||||
item.style.display = (item.dataset.status === status) ? 'flex' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
// ── 弹窗逻辑 ──
|
||||
var modalKey = '';
|
||||
var scaleState = 'idle';
|
||||
var currentWeight = 0;
|
||||
var currentAiResult = null;
|
||||
var records = [];
|
||||
|
||||
var taskData = {
|
||||
'potato': { name: '土豆', icon: '🥔', iconClass: 'task-icon--potato', need: 5.0, done: 2.0, deadline: '11:00', cutting: '切丝' },
|
||||
'carrot': { name: '胡萝卜', icon: '🥕', iconClass: 'task-icon--carrot', need: 2.0, done: 0, deadline: '11:30', cutting: '切丝' },
|
||||
'tomato': { name: '西红柿', icon: '🍅', iconClass: 'task-icon--tomato', need: 3.5, done: 0, deadline: '11:30', cutting: '切块' },
|
||||
'potato_dinner': { name: '土豆(晚餐)', icon: '🥔', iconClass: 'task-icon--potato', need: 3.0, done: 0, deadline: '15:30', cutting: '切块' }
|
||||
};
|
||||
|
||||
var aiResults = {
|
||||
'potato': { name: '土豆', icon: '🥔', confidence: 97 },
|
||||
'carrot': { name: '胡萝卜', icon: '🥕', confidence: 96 },
|
||||
'tomato': { name: '西红柿', icon: '🍅', confidence: 95 },
|
||||
'cabbage': { name: '大白菜', icon: '🥬', confidence: 94 },
|
||||
'cucumber':{ name: '黄瓜', icon: '🥒', confidence: 93 }
|
||||
};
|
||||
|
||||
function openModal(key) {
|
||||
modalKey = key;
|
||||
var task = taskData[key] || taskData['potato'];
|
||||
var iconEl = document.getElementById('modalTaskIcon');
|
||||
iconEl.innerHTML = task.icon;
|
||||
iconEl.className = 'modal-task__icon ' + task.iconClass;
|
||||
document.getElementById('modalTaskName').textContent = task.name;
|
||||
document.getElementById('modalTaskCutting').innerHTML = '🔪 ' + task.cutting;
|
||||
var pct = Math.round((task.done / task.need) * 100);
|
||||
document.getElementById('modalProgressFill').style.width = pct + '%';
|
||||
document.getElementById('modalProgressText').textContent = task.done.toFixed(1) + '/' + task.need.toFixed(1) + '斤';
|
||||
document.getElementById('modalTitle').textContent = task.name + ' - 称重录入';
|
||||
resetScale();
|
||||
records = [];
|
||||
updateRecordsDisplay();
|
||||
document.getElementById('modalOverlay').classList.add('open');
|
||||
setTimeout(function() { startDetecting(key.replace('_dinner','')); }, 1500);
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('modalOverlay').classList.remove('open');
|
||||
}
|
||||
|
||||
function startDetecting(ingredientKey) {
|
||||
scaleState = '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 = 1.85;
|
||||
var anim = 0;
|
||||
var timer = setInterval(function() {
|
||||
anim += 0.12;
|
||||
if (anim >= targetWeight) { anim = targetWeight; clearInterval(timer); onWeightStable(ingredientKey, targetWeight); }
|
||||
document.getElementById('weightValue').textContent = anim.toFixed(2);
|
||||
}, 100);
|
||||
setTimeout(function() {
|
||||
var result = aiResults[ingredientKey] || aiResults['potato'];
|
||||
currentAiResult = result;
|
||||
document.getElementById('aiIcon').innerHTML = result.icon;
|
||||
document.getElementById('aiName').textContent = result.name;
|
||||
document.getElementById('aiConfidence').textContent = '置信度: ' + result.confidence + '%';
|
||||
var task = taskData[modalKey];
|
||||
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(key, weight) {
|
||||
scaleState = '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 confirmCutting() {
|
||||
if (scaleState !== 'stable' || !currentAiResult) return;
|
||||
var task = taskData[modalKey];
|
||||
task.done += currentWeight;
|
||||
records.unshift({
|
||||
name: currentAiResult.name,
|
||||
icon: currentAiResult.icon,
|
||||
cutting: task.cutting,
|
||||
weight: currentWeight,
|
||||
time: new Date().toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' })
|
||||
});
|
||||
updateRecordsDisplay();
|
||||
var pct = Math.round((task.done / task.need) * 100);
|
||||
document.getElementById('modalProgressFill').style.width = pct + '%';
|
||||
document.getElementById('modalProgressText').textContent = task.done.toFixed(1) + '/' + task.need.toFixed(1) + '斤';
|
||||
showToast('已确认切配: ' + currentAiResult.name + ' ' + currentWeight.toFixed(2) + '斤', 2000, 'success');
|
||||
resetScale();
|
||||
}
|
||||
|
||||
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 existing = list.querySelectorAll('.modal-record');
|
||||
existing.forEach(function(el) { el.remove(); });
|
||||
records.forEach(function(r) {
|
||||
var item = document.createElement('div');
|
||||
item.className = 'modal-record';
|
||||
item.innerHTML = '<div class="modal-record__icon">' + r.icon + '</div>' +
|
||||
'<div class="modal-record__info"><div class="modal-record__name">' + r.name + '</div>' +
|
||||
'<div class="modal-record__cutting">' + r.cutting + '</div>' +
|
||||
'<div class="modal-record__time">' + r.time + '</div></div>' +
|
||||
'<div class="modal-record__weight">+' + r.weight.toFixed(2) + '斤</div>';
|
||||
list.appendChild(item);
|
||||
});
|
||||
}
|
||||
|
||||
function resetScale() {
|
||||
scaleState = '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 = '📇';
|
||||
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() {
|
||||
if (scaleState === 'idle' && document.getElementById('modalOverlay').classList.contains('open')) {
|
||||
var keys = ['potato', 'carrot', 'cucumber'];
|
||||
startDetecting(keys[Math.floor(Math.random() * keys.length)]);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
</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>
|
||||
@@ -0,0 +1,144 @@
|
||||
<!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;
|
||||
}
|
||||
.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); display: flex; align-items: center; gap: 6px;
|
||||
}
|
||||
.top-bar__avatar {
|
||||
width: 26px; height: 26px; border-radius: 50%; background: #4a90d9;
|
||||
display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff;
|
||||
}
|
||||
.logout-btn {
|
||||
margin-left: 10px; padding: 4px 10px; font-size: 11px;
|
||||
background: rgba(255,77,79,0.08); border: 1px solid rgba(255,77,79,0.2);
|
||||
border-radius: 5px; color: rgba(255,77,79,0.7); cursor: pointer;
|
||||
transition: all 0.2s; font-family: inherit;
|
||||
}
|
||||
.logout-btn:hover { background: rgba(255,77,79,0.18); color: #ff6b6d; border-color: rgba(255,77,79,0.4); }
|
||||
.menu-main {
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
height: calc(100% - 44px); padding: 24px 32px;
|
||||
}
|
||||
.menu-panel {
|
||||
width: 480px; display: flex; flex-direction: column; gap: 14px;
|
||||
}
|
||||
.menu-panel__header {
|
||||
display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
|
||||
}
|
||||
.menu-panel__title { font-size: 14px; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
|
||||
.menu-btn {
|
||||
display: flex; align-items: center; gap: 14px;
|
||||
padding: 16px 20px; border-radius: 12px;
|
||||
background: #1a2b4a; border: 1px solid rgba(255,255,255,0.06);
|
||||
cursor: pointer; transition: all 0.2s; text-decoration: none; color: #fff;
|
||||
}
|
||||
.menu-btn:hover {
|
||||
transform: translateX(4px); border-color: rgba(74,144,217,0.3);
|
||||
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
|
||||
}
|
||||
.menu-btn:active { transform: translateX(2px) scale(0.99); }
|
||||
.menu-btn__icon {
|
||||
width: 44px; height: 44px; border-radius: 10px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 22px; flex-shrink: 0;
|
||||
}
|
||||
.menu-btn__icon--blue { background: rgba(74,144,217,0.15); }
|
||||
.menu-btn__icon--orange { background: rgba(250,173,22,0.15); }
|
||||
.menu-btn__icon--gray { background: rgba(255,255,255,0.08); }
|
||||
.menu-btn__info { flex: 1; }
|
||||
.menu-btn__title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
|
||||
.menu-btn__desc { font-size: 12px; color: rgba(255,255,255,0.4); }
|
||||
.menu-btn__arrow { font-size: 16px; color: rgba(255,255,255,0.25); flex-shrink: 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="top-bar">
|
||||
<span class="top-bar__title">净菜加工秤</span>
|
||||
<div class="top-bar__user">
|
||||
<div class="top-bar__avatar" id="menuAvatar">赵</div>
|
||||
<span id="menuUserName">赵六</span>
|
||||
<button class="logout-btn" onclick="handleLogout()">退出</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-main">
|
||||
<div class="menu-panel">
|
||||
<div class="menu-panel__header">
|
||||
<div class="menu-panel__title">📌 功能菜单</div>
|
||||
</div>
|
||||
<a class="menu-btn" id="btnAccept" href="javascript:void(0)" onclick="handleMenu('01-accept.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--blue">✅</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">净菜验收</div>
|
||||
<div class="menu-btn__desc">净菜上秤识别、验收确认</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
<a class="menu-btn" id="btnHistory" href="javascript:void(0)" onclick="handleMenu('02-history.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--orange">📝</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">验收记录</div>
|
||||
<div class="menu-btn__desc">历史验收记录查看与筛选</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
<a class="menu-btn" id="btnSettings" href="javascript:void(0)" onclick="handleMenu('03-settings.html')">
|
||||
<div class="menu-btn__icon menu-btn__icon--gray">⚙️</div>
|
||||
<div class="menu-btn__info">
|
||||
<div class="menu-btn__title">设置</div>
|
||||
<div class="menu-btn__desc">设备参数配置与状态查看</div>
|
||||
</div>
|
||||
<div class="menu-btn__arrow">›</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var currentUser = null;
|
||||
|
||||
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() {
|
||||
var userName = getUrlParam('user');
|
||||
var userId = getUrlParam('uid');
|
||||
if (!userName) {
|
||||
window.location.href = '00-welcome.html';
|
||||
return;
|
||||
}
|
||||
currentUser = { name: userName, id: userId || '--' };
|
||||
document.getElementById('menuUserName').textContent = userName;
|
||||
document.getElementById('menuAvatar').textContent = userName.charAt(0);
|
||||
})();
|
||||
|
||||
function handleMenu(target) {
|
||||
if (!currentUser) {
|
||||
window.location.href = '00-welcome.html';
|
||||
return;
|
||||
}
|
||||
window.location.href = target + '?user=' + encodeURIComponent(currentUser.name) + '&uid=' + currentUser.id;
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
window.location.href = '00-welcome.html';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+25
-23
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=1280, initial-scale=1.0">
|
||||
<title>净菜加工秤 - 切配记录 | 蚁熊智能餐养平台</title>
|
||||
<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; }
|
||||
@@ -55,7 +55,7 @@
|
||||
.record-row:hover { background: rgba(74,144,217,0.08); }
|
||||
.record-row__cell { font-size: 13px; color: rgba(255,255,255,0.8); }
|
||||
.record-row__cell--icon { font-size: 18px; }
|
||||
.cutting-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 11px; background: rgba(114,46,209,0.15); color: #722ed1; }
|
||||
.spec-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 11px; background: rgba(24,144,255,0.15); color: #40a9ff; }
|
||||
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
|
||||
.status-badge--done { background: rgba(82,196,26,0.15); color: #52c41a; }
|
||||
.action-link { font-size: 12px; color: #4a90d9; cursor: pointer; text-decoration: none; }
|
||||
@@ -71,7 +71,7 @@
|
||||
<body>
|
||||
<div class="top-bar">
|
||||
|
||||
<a class="back-btn" id="backBtn" href="javascript:void(0)">◀ 返回</a> <span class="top-bar__title">切配记录</span>
|
||||
<a class="back-btn" id="backBtn" href="javascript:void(0)">◀ 返回</a> <span class="top-bar__title">验收记录</span>
|
||||
<span class="top-bar__user" id="topUser">--</span>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
@@ -92,14 +92,14 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group">
|
||||
<span class="filter-label">切法</span>
|
||||
<span class="filter-label">规格</span>
|
||||
<select class="filter-select">
|
||||
<option value="">全部</option>
|
||||
<option value="slice">切片</option>
|
||||
<option value="shred">切丝</option>
|
||||
<option value="chunk">切块</option>
|
||||
<option value="dice">切丁</option>
|
||||
<option value="section">切段</option>
|
||||
<option value="slice">圆片</option>
|
||||
<option value="shred">丝条</option>
|
||||
<option value="chunk">滚刀块</option>
|
||||
<option value="dice">方丁</option>
|
||||
<option value="section">宽段</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="filter-btn">查询</button>
|
||||
@@ -107,15 +107,15 @@
|
||||
</div>
|
||||
<div class="stats-row">
|
||||
<div class="stat-card">
|
||||
<div class="stat-card__label">今日切配批次</div>
|
||||
<div class="stat-card__label">今日验收批次</div>
|
||||
<div class="stat-card__value stat-card__value--purple">8</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-card__label">切配总量</div>
|
||||
<div class="stat-card__label">验收总量</div>
|
||||
<div class="stat-card__value">32.5斤</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-card__label">平均切配时长</div>
|
||||
<div class="stat-card__label">平均验收时长</div>
|
||||
<div class="stat-card__value">5.3分钟</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
@@ -125,13 +125,13 @@
|
||||
</div>
|
||||
<div class="records-section">
|
||||
<div class="records-header">
|
||||
<span class="records-title">切配记录列表</span>
|
||||
<span class="records-title">验收记录列表</span>
|
||||
<span class="records-count">共 8 条记录</span>
|
||||
</div>
|
||||
<div class="table-header">
|
||||
<div class="table-header__cell col-batch">批次号</div>
|
||||
<div class="table-header__cell col-name">食材</div>
|
||||
<div class="table-header__cell col-cutting">切法</div>
|
||||
<div class="table-header__cell col-cutting">规格</div>
|
||||
<div class="table-header__cell col-weight">重量</div>
|
||||
<div class="table-header__cell col-time">完成时间</div>
|
||||
<div class="table-header__cell col-duration">时长</div>
|
||||
@@ -143,7 +143,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C01</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥔</span> 土豆</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切丝</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">丝条</span></div>
|
||||
<div class="record-row__cell col-weight">5.2斤</div>
|
||||
<div class="record-row__cell col-time">09:35</div>
|
||||
<div class="record-row__cell col-duration">5分钟</div>
|
||||
@@ -154,7 +154,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C02</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥒</span> 黄瓜</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切片</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">圆片</span></div>
|
||||
<div class="record-row__cell col-weight">4.2斤</div>
|
||||
<div class="record-row__cell col-time">09:52</div>
|
||||
<div class="record-row__cell col-duration">4分钟</div>
|
||||
@@ -165,7 +165,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C03</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥬</span> 大白菜</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切段</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">宽段</span></div>
|
||||
<div class="record-row__cell col-weight">8.5斤</div>
|
||||
<div class="record-row__cell col-time">10:15</div>
|
||||
<div class="record-row__cell col-duration">6分钟</div>
|
||||
@@ -176,7 +176,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C04</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥕</span> 胡萝卜</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切丝</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">丝条</span></div>
|
||||
<div class="record-row__cell col-weight">2.8斤</div>
|
||||
<div class="record-row__cell col-time">10:32</div>
|
||||
<div class="record-row__cell col-duration">5分钟</div>
|
||||
@@ -187,7 +187,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C05</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🍅</span> 西红柿</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切块</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">滚刀块</span></div>
|
||||
<div class="record-row__cell col-weight">3.5斤</div>
|
||||
<div class="record-row__cell col-time">10:48</div>
|
||||
<div class="record-row__cell col-duration">4分钟</div>
|
||||
@@ -198,7 +198,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C06</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥔</span> 土豆</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切块</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">滚刀块</span></div>
|
||||
<div class="record-row__cell col-weight">3.2斤</div>
|
||||
<div class="record-row__cell col-time">14:20</div>
|
||||
<div class="record-row__cell col-duration">5分钟</div>
|
||||
@@ -209,7 +209,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C07</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥔</span> 土豆</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切条</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">细条</span></div>
|
||||
<div class="record-row__cell col-weight">2.6斤</div>
|
||||
<div class="record-row__cell col-time">14:38</div>
|
||||
<div class="record-row__cell col-duration">5分钟</div>
|
||||
@@ -220,7 +220,7 @@
|
||||
<div class="record-row">
|
||||
<div class="record-row__cell col-batch">#20260613-C08</div>
|
||||
<div class="record-row__cell col-name"><span class="record-row__cell--icon">🥕</span> 胡萝卜</div>
|
||||
<div class="record-row__cell col-cutting"><span class="cutting-badge">切丁</span></div>
|
||||
<div class="record-row__cell col-cutting"><span class="spec-badge">方丁</span></div>
|
||||
<div class="record-row__cell col-weight">2.5斤</div>
|
||||
<div class="record-row__cell col-time">14:55</div>
|
||||
<div class="record-row__cell col-duration">6分钟</div>
|
||||
@@ -248,6 +248,7 @@
|
||||
if (userName) document.getElementById('topUser').textContent = '操作员: ' + userName;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
/* 返回按钮:从哪来回哪去 */
|
||||
(function() {
|
||||
var backBtn = document.getElementById('backBtn');
|
||||
@@ -259,10 +260,11 @@
|
||||
} else if (document.referrer && document.referrer.indexOf(window.location.hostname) !== -1) {
|
||||
backBtn.href = document.referrer;
|
||||
} else {
|
||||
backBtn.href = 'index.html';
|
||||
backBtn.href = '01-menu.html';
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,374 +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__cutting { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: rgba(114,46,209,0.15); border-radius: 4px; font-size: 11px; color: #722ed1; margin-top: 4px; }
|
||||
.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-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--success { background: #52c41a; color: #fff; }
|
||||
.scale-btn--success:hover { background: #62d42a; }
|
||||
.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__cutting { font-size: 11px; color: #722ed1; }
|
||||
.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 { 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)">◀ 返回</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">🥔</div>
|
||||
<div class="current-task__info">
|
||||
<div class="current-task__name" id="taskName">土豆</div>
|
||||
<div class="current-task__detail">截止 11:00 | 来自清洗工序</div>
|
||||
<div class="current-task__cutting">🔪 切丝</div>
|
||||
</div>
|
||||
<div class="current-task__progress">
|
||||
<div class="progress-mini">
|
||||
<div class="progress-mini__fill" id="taskProgressFill" style="width: 40%"></div>
|
||||
</div>
|
||||
<span class="progress-mini__text" id="taskProgressText">2.0/5.0斤</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scale-display" id="scaleDisplay">
|
||||
<div class="ai-result">
|
||||
<div class="ai-result__icon" id="aiIcon">📇</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="goCuttingBtn" onclick="goToCutting()" disabled>确认并切配</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="record-panel">
|
||||
<div class="today-stats">
|
||||
<div class="today-stat">
|
||||
<div class="today-stat__value">4</div>
|
||||
<div class="today-stat__label">今日切配次数</div>
|
||||
</div>
|
||||
<div class="today-stat">
|
||||
<div class="today-stat__value">18.2</div>
|
||||
<div class="today-stat__label">总重量(斤)</div>
|
||||
</div>
|
||||
<div class="today-stat">
|
||||
<div class="today-stat__value">2</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">📭</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: '🥔', need: 5.0, done: 2.0, deadline: '11:00', cutting: '切丝' },
|
||||
{ id: 2, name: '胡萝卜', icon: '🥕', need: 2.0, done: 0, deadline: '11:30', cutting: '切丝' },
|
||||
{ id: 3, name: '西红柿', icon: '🍅', need: 3.5, done: 0, deadline: '11:30', cutting: '切块' }
|
||||
];
|
||||
var currentTaskIndex = 0;
|
||||
var aiResults = {
|
||||
'potato': { name: '土豆', icon: '🥔', confidence: 97 },
|
||||
'tomato': { name: '西红柿', icon: '🍅', confidence: 95 },
|
||||
'cabbage': { name: '大白菜', icon: '🥬', confidence: 94 },
|
||||
'carrot': { name: '胡萝卜', icon: '🥕', confidence: 96 },
|
||||
'cucumber': { name: '黄瓜', icon: '🥒', confidence: 93 },
|
||||
'unknown': { name: '未识别', icon: '❓', confidence: 0 }
|
||||
};
|
||||
var state = 'idle';
|
||||
var currentWeight = 0;
|
||||
var currentAiResult = null;
|
||||
var records = [];
|
||||
|
||||
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.querySelector('.current-task__cutting').innerHTML = '🔪 ' + task.cutting;
|
||||
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 = 1.85;
|
||||
var currentWeightAnim = 0;
|
||||
var weightInterval = setInterval(function() {
|
||||
currentWeightAnim += 0.12;
|
||||
if (currentWeightAnim >= targetWeight) {
|
||||
currentWeightAnim = targetWeight;
|
||||
clearInterval(weightInterval);
|
||||
onWeightStable(ingredientKey, targetWeight);
|
||||
}
|
||||
document.getElementById('weightValue').textContent = currentWeightAnim.toFixed(2);
|
||||
}, 100);
|
||||
|
||||
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('goCuttingBtn').disabled = false;
|
||||
}
|
||||
|
||||
function goToCutting() {
|
||||
if (state !== 'stable' || !currentAiResult) return;
|
||||
var task = tasks[currentTaskIndex];
|
||||
task.done += currentWeight;
|
||||
var record = {
|
||||
name: currentAiResult.name,
|
||||
icon: currentAiResult.icon,
|
||||
cutting: task.cutting,
|
||||
weight: currentWeight,
|
||||
time: new Date().toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' })
|
||||
};
|
||||
records.unshift(record);
|
||||
updateRecordsDisplay();
|
||||
showToast('已确认,进入切配环节', 2000, 'success');
|
||||
setTimeout(function() {
|
||||
var userName = getUrlParam('user') || '';
|
||||
window.location.href = '03-cutting.html?user=' + encodeURIComponent(userName) + '&ingredient=' + task.name + '&cutting=' + task.cutting + '&weight=' + currentWeight;
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
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__cutting">' + r.cutting + '</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 = '📇';
|
||||
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('goCuttingBtn').disabled = true;
|
||||
}
|
||||
|
||||
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,333 +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; }
|
||||
.cutting-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__cutting { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(114,46,209,0.15); border-radius: 4px; font-size: 12px; color: #722ed1; font-weight: 500; }
|
||||
.cutting-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: 16px; font-weight: 600; color: #fff; }
|
||||
.param-item__value--purple { color: #722ed1; }
|
||||
.cutting-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); }
|
||||
.cutting-progress.active { border-color: #722ed1; }
|
||||
.cutting-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: #722ed1; 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; }
|
||||
.cutting-steps { display: flex; gap: 12px; width: 100%; }
|
||||
.cutting-step { flex: 1; text-align: center; padding: 12px; border-radius: 10px; background: rgba(0,0,0,0.15); }
|
||||
.cutting-step__icon { font-size: 20px; margin-bottom: 6px; }
|
||||
.cutting-step__name { font-size: 12px; color: rgba(255,255,255,0.5); }
|
||||
.cutting-step.active { background: rgba(114,46,209,0.15); }
|
||||
.cutting-step.active .cutting-step__name { color: #722ed1; }
|
||||
.cutting-step.done { background: rgba(82,196,26,0.15); }
|
||||
.cutting-step.done .cutting-step__name { color: #52c41a; }
|
||||
.cutting-actions { display: flex; gap: 12px; width: 100%; }
|
||||
.cutting-btn { flex: 1; padding: 14px; border-radius: 10px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
|
||||
.cutting-btn--primary { background: #722ed1; color: #fff; }
|
||||
.cutting-btn--primary:hover { background: #8240e0; }
|
||||
.cutting-btn--success { background: #52c41a; color: #fff; }
|
||||
.cutting-btn--success:hover { background: #62d42a; }
|
||||
.cutting-btn--secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
|
||||
.cutting-btn--secondary:hover { background: rgba(255,255,255,0.12); }
|
||||
.queue-panel { flex: 1; display: flex; flex-direction: column; gap: 16px; }
|
||||
.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; }
|
||||
.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__cutting { font-size: 11px; color: #722ed1; }
|
||||
.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--cutting { background: rgba(114,46,209,0.15); color: #722ed1; }
|
||||
.queue-item__status--done { background: rgba(82,196,26,0.15); color: #52c41a; }
|
||||
.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)">◀ 返回</a> <span class="top-bar__title">切配操作</span>
|
||||
<span class="top-bar__user" id="topUser">--</span>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<div class="cutting-panel">
|
||||
<div class="ingredient-card">
|
||||
<div class="ingredient-card__header">
|
||||
<div class="ingredient-card__icon">🥔</div>
|
||||
<div class="ingredient-card__info">
|
||||
<div class="ingredient-card__name">土豆</div>
|
||||
<div class="ingredient-card__meta">
|
||||
<span>重量: 1.85斤</span>
|
||||
<span>批次 #20260613-C01</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ingredient-card__cutting">🔪 系统指定: 切丝</div>
|
||||
</div>
|
||||
<div class="cutting-params">
|
||||
<div class="param-item">
|
||||
<div class="param-item__label">切法</div>
|
||||
<div class="param-item__value param-item__value--purple">丝</div>
|
||||
</div>
|
||||
<div class="param-item">
|
||||
<div class="param-item__label">粗细</div>
|
||||
<div class="param-item__value">3mm</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">5分钟</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cutting-progress" id="cuttingProgress">
|
||||
<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="cutting-steps">
|
||||
<div class="cutting-step" id="step1">
|
||||
<div class="cutting-step__icon">🔪</div>
|
||||
<div class="cutting-step__name">切片</div>
|
||||
</div>
|
||||
<div class="cutting-step" id="step2">
|
||||
<div class="cutting-step__icon">🔪</div>
|
||||
<div class="cutting-step__name">切丝</div>
|
||||
</div>
|
||||
<div class="cutting-step" id="step3">
|
||||
<div class="cutting-step__icon">✅</div>
|
||||
<div class="cutting-step__name">完成</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cutting-actions">
|
||||
<button class="cutting-btn cutting-btn--secondary" onclick="skipCutting()">跳过</button>
|
||||
<button class="cutting-btn cutting-btn--primary" id="startBtn" onclick="startCutting()">开始切配</button>
|
||||
<button class="cutting-btn cutting-btn--success" id="completeBtn" onclick="completeCutting()" style="display:none">完成切配</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="queue-panel">
|
||||
<div class="done-stats">
|
||||
<div class="done-stat">
|
||||
<div class="done-stat__value">2</div>
|
||||
<div class="done-stat__label">今日已切配</div>
|
||||
</div>
|
||||
<div class="done-stat">
|
||||
<div class="done-stat__value">8.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">共 3 项</span>
|
||||
</div>
|
||||
<div class="queue-list">
|
||||
<div class="queue-item">
|
||||
<div class="queue-item__icon">🥕</div>
|
||||
<div class="queue-item__info">
|
||||
<div class="queue-item__name">胡萝卜</div>
|
||||
<div class="queue-item__cutting">切丝</div>
|
||||
<div class="queue-item__weight">2.0斤</div>
|
||||
</div>
|
||||
<span class="queue-item__status queue-item__status--waiting">待切配</span>
|
||||
</div>
|
||||
<div class="queue-item">
|
||||
<div class="queue-item__icon">🍅</div>
|
||||
<div class="queue-item__info">
|
||||
<div class="queue-item__name">西红柿</div>
|
||||
<div class="queue-item__cutting">切块</div>
|
||||
<div class="queue-item__weight">3.5斤</div>
|
||||
</div>
|
||||
<span class="queue-item__status queue-item__status--waiting">待切配</span>
|
||||
</div>
|
||||
<div class="queue-item">
|
||||
<div class="queue-item__icon">🥔</div>
|
||||
<div class="queue-item__info">
|
||||
<div class="queue-item__name">土豆(晚餐)</div>
|
||||
<div class="queue-item__cutting">切块</div>
|
||||
<div class="queue-item__weight">3.0斤</div>
|
||||
</div>
|
||||
<span class="queue-item__status queue-item__status--waiting">待切配</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="toast" id="toast"></div>
|
||||
<script>
|
||||
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;
|
||||
|
||||
// 根据URL参数更新页面
|
||||
var ingredient = getUrlParam('ingredient');
|
||||
var cutting = getUrlParam('cutting');
|
||||
var weight = getUrlParam('weight');
|
||||
if (ingredient) document.querySelector('.ingredient-card__name').textContent = ingredient;
|
||||
if (cutting) document.querySelector('.ingredient-card__cutting').innerHTML = '🔪 系统指定: ' + cutting;
|
||||
if (weight) document.querySelector('.ingredient-card__meta').innerHTML = '<span>重量: ' + weight + '斤</span><span>批次 #20260613-C01</span>';
|
||||
|
||||
var isCutting = false;
|
||||
var cuttingProgress = 0;
|
||||
var cuttingInterval = null;
|
||||
|
||||
function startCutting() {
|
||||
if (isCutting) return;
|
||||
isCutting = true;
|
||||
cuttingProgress = 0;
|
||||
document.getElementById('startBtn').style.display = 'none';
|
||||
document.getElementById('cuttingProgress').classList.add('active');
|
||||
showToast('切配开始...', 1500);
|
||||
|
||||
cuttingInterval = setInterval(function() {
|
||||
cuttingProgress += 2;
|
||||
var offset = 502 - (502 * cuttingProgress / 100);
|
||||
document.getElementById('progressFill').style.strokeDashoffset = offset;
|
||||
document.getElementById('progressPercent').textContent = cuttingProgress + '%';
|
||||
updateSteps();
|
||||
|
||||
if (cuttingProgress >= 100) {
|
||||
clearInterval(cuttingInterval);
|
||||
onCuttingComplete();
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
|
||||
function updateSteps() {
|
||||
var steps = ['step1', 'step2', 'step3'];
|
||||
var thresholds = [33, 66, 100];
|
||||
steps.forEach(function(id, idx) {
|
||||
var el = document.getElementById(id);
|
||||
el.classList.remove('active', 'done');
|
||||
if (cuttingProgress >= thresholds[idx]) {
|
||||
el.classList.add('done');
|
||||
} else if (cuttingProgress >= (thresholds[idx - 1] || 0)) {
|
||||
el.classList.add('active');
|
||||
}
|
||||
});
|
||||
|
||||
if (cuttingProgress < 33) {
|
||||
document.getElementById('progressLabel').textContent = '切片中...';
|
||||
} else if (cuttingProgress < 66) {
|
||||
document.getElementById('progressLabel').textContent = '切丝中...';
|
||||
} else if (cuttingProgress < 100) {
|
||||
document.getElementById('progressLabel').textContent = '整理中...';
|
||||
} else {
|
||||
document.getElementById('progressLabel').textContent = '切配完成';
|
||||
}
|
||||
}
|
||||
|
||||
function onCuttingComplete() {
|
||||
isCutting = false;
|
||||
document.getElementById('cuttingProgress').classList.remove('active');
|
||||
document.getElementById('cuttingProgress').classList.add('done');
|
||||
document.getElementById('progressFill').classList.add('done');
|
||||
document.getElementById('completeBtn').style.display = 'block';
|
||||
showToast('切配完成,请点击"完成切配"提交', 3000, 'success');
|
||||
}
|
||||
|
||||
function completeCutting() {
|
||||
showToast('已提交,净菜已转入打包区', 2500, 'success');
|
||||
setTimeout(function() {
|
||||
window.location.href = '02-weighing.html' + (userName ? '?user=' + encodeURIComponent(userName) : '');
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function skipCutting() {
|
||||
if (confirm('确定跳过切配步骤?')) {
|
||||
showToast('已跳过切配', 1500);
|
||||
setTimeout(function() {
|
||||
window.location.href = '02-weighing.html' + (userName ? '?user=' + encodeURIComponent(userName) : '');
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
+8
-6
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<div class="settings-menu">
|
||||
<div class="menu-item active" onclick="switchSection('cutting', this)"><span class="menu-item__icon">🔪</span><span>切配参数</span></div>
|
||||
<div class="menu-item active" onclick="switchSection('cutting', this)"><span class="menu-item__icon">🔪</span><span>加工参数</span></div>
|
||||
<div class="menu-item" onclick="switchSection('ai', this)"><span class="menu-item__icon">🤖</span><span>AI识别</span></div>
|
||||
<div class="menu-item" onclick="switchSection('scale', this)"><span class="menu-item__icon">⚖️</span><span>秤参数</span></div>
|
||||
<div class="menu-item" onclick="switchSection('device', this)"><span class="menu-item__icon">💻</span><span>设备信息</span></div>
|
||||
@@ -67,17 +67,17 @@
|
||||
</div>
|
||||
<div class="settings-content">
|
||||
<div class="settings-section" id="section-cutting">
|
||||
<div class="section-title">切配参数配置</div>
|
||||
<div class="section-title">加工参数配置</div>
|
||||
<div class="setting-item">
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认切丝粗细</div><div class="setting-item__desc">切丝模式的标准粗细</div></div>
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认丝条粗细</div><div class="setting-item__desc">丝条规格的标准粗细</div></div>
|
||||
<div class="setting-item__control"><input type="number" class="setting-input" value="3" min="1" max="10"> <span style="color: rgba(255,255,255,0.5); font-size: 12px; margin-left: 4px">mm</span></div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认切块大小</div><div class="setting-item__desc">切块模式的标准大小</div></div>
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认滚刀块大小</div><div class="setting-item__desc">滚刀块规格的标准大小</div></div>
|
||||
<div class="setting-item__control"><select class="setting-select"><option>小(2cm)</option><option selected>中(3cm)</option><option>大(5cm)</option></select></div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认切丁大小</div><div class="setting-item__desc">切丁模式的标准大小</div></div>
|
||||
<div class="setting-item__info"><div class="setting-item__label">默认方丁大小</div><div class="setting-item__desc">方丁规格的标准大小</div></div>
|
||||
<div class="setting-item__control"><select class="setting-select"><option>小(5mm)</option><option selected>中(10mm)</option><option>大(15mm)</option></select></div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
@@ -170,6 +170,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
/* 返回按钮:从哪来回哪去 */
|
||||
(function() {
|
||||
var backBtn = document.getElementById('backBtn');
|
||||
@@ -181,10 +182,11 @@
|
||||
} else if (document.referrer && document.referrer.indexOf(window.location.hostname) !== -1) {
|
||||
backBtn.href = document.referrer;
|
||||
} else {
|
||||
backBtn.href = 'index.html';
|
||||
backBtn.href = '01-menu.html';
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,29 @@
|
||||
# 净菜加工秤 CHANGELOG
|
||||
|
||||
## [2026-06-16] refactor: 模块整体重构,聚焦净菜验收单一功能
|
||||
|
||||
### 变更
|
||||
- 删除旧页面:`01-cutting-tasks.html`(任务列表)、`02-weighing.html`(称重录入)、`03-cutting.html`(切配操作)
|
||||
- 新建 `01-accept.html`(净菜验收主操作页):模仿毛菜验收秤流程,包含任务选择→上秤识别→验收确认两步操作
|
||||
- 重命名 `04-history.html` → `02-history.html`:「切配记录」→「验收记录」,规格标签由切法改为加工规格
|
||||
- 重命名 `05-settings.html` → `03-settings.html`:「切配参数」→「加工参数」
|
||||
- 更新 `00-welcome.html`:功能菜单由4个缩减为3个(净菜验收、验收记录、设置)
|
||||
- 更新 `index.html`:导航卡片同步更新为新页面结构
|
||||
|
||||
---
|
||||
|
||||
## [2026-06-16] refactor: 任务列表页重构为三层结构(任务单→食材→属性)
|
||||
|
||||
### 变更
|
||||
- `01-cutting-tasks.html`:将列表结构从扁平的「任务单→食材行」改为三层嵌套「任务单→食材分组→属性行」
|
||||
- 数据关系:任务单(1:1)→食材(1:N)→属性(刀工/形状/尺寸/重量/截止时间/状态)
|
||||
- 同一任务单中同种食材的不同切法归入一个食材分组,方便员工集中切配
|
||||
- 新增 `.ingredient-group` 食材分组(含图标、名称、切法数量)
|
||||
- 新增 `.attr-row` 属性行(替代原 `.ingredient-row`),内缩展示在食材分组下方
|
||||
- 保留任务单卡片外壳、未完成/已完成筛选标签卡、处理按钮
|
||||
|
||||
---
|
||||
|
||||
## [1.0.0] - 2026-06-13
|
||||
|
||||
### 新增
|
||||
|
||||
@@ -28,50 +28,18 @@
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<a class="card" href="00-welcome.html">
|
||||
<span class="card__icon">👋</span>
|
||||
<span class="card__icon">👤</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">欢迎页面</div>
|
||||
<div class="card__title">员工登录</div>
|
||||
<div class="card__desc">人脸识别/账号密码登录、功能菜单入口</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="01-cutting-tasks.html">
|
||||
<span class="card__icon">📋</span>
|
||||
<a class="card" href="01-accept.html">
|
||||
<span class="card__icon">✅</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">今日切配任务</div>
|
||||
<div class="card__desc">系统分配的净菜切配任务列表</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="02-weighing.html">
|
||||
<span class="card__icon">⚖️</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">称重录入</div>
|
||||
<div class="card__desc">净菜上秤AI识别、称重、确认进入切配</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="03-cutting.html">
|
||||
<span class="card__icon">🔪</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">切配操作</div>
|
||||
<div class="card__desc">系统指定切法、切配进度跟踪</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="04-history.html">
|
||||
<span class="card__icon">📝</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">切配记录</div>
|
||||
<div class="card__desc">历史切配记录查看与筛选</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="05-settings.html">
|
||||
<span class="card__icon">⚙️</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">设备设置</div>
|
||||
<div class="card__desc">切配参数、AI识别、秤参数配置</div>
|
||||
<div class="card__title">净菜验收</div>
|
||||
<div class="card__desc">净菜上秤识别、验收确认</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<a class="card" href="clean-veg-ratio-scale/index.html">
|
||||
<div class="card__icon">⚖️</div>
|
||||
<div class="card__name">净菜加工秤</div>
|
||||
<div class="card__desc">净菜切配:AI识别、称重、切丝/片/块/丁</div>
|
||||
<div class="card__desc">净菜加工:任务驱动,含尺寸/形状/刀工要求</div>
|
||||
</a>
|
||||
<a class="card" href="clean-veg-packaging-labeler/index.html">
|
||||
<div class="card__icon">🏷️</div>
|
||||
@@ -152,7 +152,7 @@
|
||||
<a class="card" href="ratio-scale/index.html">
|
||||
<div class="card__icon">📦</div>
|
||||
<div class="card__name">净菜配比秤</div>
|
||||
<div class="card__desc">净菜打包:AI识别、称重、按员工拆单塑封</div>
|
||||
<div class="card__desc">任务驱动打包:净菜包/餐品组合两种模式,三层任务结构</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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)">◀ 返回</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">🥔</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">📇</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">📭</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: '🥔', need: 5.0, done: 3.0, deadline: '10:30', meal: '午餐' },
|
||||
{ id: 2, name: '西红柿', icon: '🍅', need: 3.5, done: 0, deadline: '11:00', meal: '午餐' },
|
||||
{ id: 3, name: '黄瓜', icon: '🥒', need: 4.0, done: 2.0, deadline: '10:00', meal: '午餐' }
|
||||
];
|
||||
var currentTaskIndex = 0;
|
||||
|
||||
// 模拟AI识别结果
|
||||
var aiResults = {
|
||||
'potato': { name: '土豆', icon: '🥔', confidence: 98 },
|
||||
'tomato': { name: '西红柿', icon: '🍅', confidence: 96 },
|
||||
'cabbage': { name: '大白菜', icon: '🥬', confidence: 95 },
|
||||
'carrot': { name: '胡萝卜', icon: '🥕', confidence: 97 },
|
||||
'cucumber': { name: '黄瓜', icon: '🥒', confidence: 94 },
|
||||
'unknown': { name: '未识别', icon: '❓', 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 = '📇';
|
||||
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)">◀ 返回</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">🥔</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">💧</div>
|
||||
<div class="wash-stage__name">浸泡</div>
|
||||
</div>
|
||||
<div class="wash-stage" id="stage2">
|
||||
<div class="wash-stage__icon">🌊</div>
|
||||
<div class="wash-stage__name">冲洗</div>
|
||||
</div>
|
||||
<div class="wash-stage" id="stage3">
|
||||
<div class="wash-stage__icon">✨</div>
|
||||
<div class="wash-stage__name">消毒</div>
|
||||
</div>
|
||||
<div class="wash-stage" id="stage4">
|
||||
<div class="wash-stage__icon">🌬</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">🍅</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">🥒</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">🥕</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">🥬</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">›</span>
|
||||
</a>
|
||||
<a class="card" href="02-weighing.html">
|
||||
<span class="card__icon">⚖️</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">称重录入</div>
|
||||
<div class="card__desc">毛菜上秤AI识别、称重、确认提交</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="03-washing.html">
|
||||
<span class="card__icon">💧</span>
|
||||
<div class="card__info">
|
||||
<div class="card__title">清洗操作</div>
|
||||
<div class="card__desc">清洗流程确认、进度跟踪</div>
|
||||
</div>
|
||||
<span class="card__arrow">›</span>
|
||||
</a>
|
||||
<a class="card" href="04-history.html">
|
||||
<span class="card__icon">📝</span>
|
||||
<div class="card__info">
|
||||
|
||||
Reference in New Issue
Block a user