fix: 净菜验收页删除验收进度条及相关逻辑
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
810a817e47
commit
07be7fb86e
@@ -27,18 +27,6 @@
|
||||
.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: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; 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;
|
||||
@@ -261,13 +249,6 @@
|
||||
<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>
|
||||
@@ -391,7 +372,6 @@
|
||||
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();
|
||||
})();
|
||||
|
||||
// ---- 渲染净菜列表 ----
|
||||
@@ -413,17 +393,9 @@
|
||||
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');
|
||||
@@ -505,7 +477,6 @@
|
||||
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);
|
||||
@@ -536,7 +507,6 @@
|
||||
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 = '';
|
||||
|
||||
Reference in New Issue
Block a user