diff --git a/employee-app/weight-management/diet-advice.html b/employee-app/weight-management/diet-advice.html index e000e5b..8306864 100644 --- a/employee-app/weight-management/diet-advice.html +++ b/employee-app/weight-management/diet-advice.html @@ -5,232 +5,544 @@ 膳食建议 - 员工端 | 健康CQ原型 @@ -398,10 +710,12 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: -
-
今日三餐推荐
- — 根据你的偏好与健康目标个性化推荐 -
+
+
+
今日三餐推荐
+ 根据你的偏好与健康目标推荐 +
+
早餐
午餐
晚餐
@@ -907,37 +1221,38 @@ function renderCalorie() { if (!skip) filtered.push(items[i]); } - // 存储当前餐次数据,供弹窗使用 - window._currentMealItems = filtered; - var html = '
'; - for (var j = 0; j < filtered.length; j++) { - var it = filtered[j]; - html += '
'; - html += '
'; - html += '
'; - html += '' + it.name + ''; - if (it.badges && it.badges.length) { - html += ''; - for (var b = 0; b < it.badges.length; b++) { - var badge = it.badges[b]; - var t = badge === 'low-sodium' ? '低钠' : badge === 'low-purine' ? '低嘌呤' : '食堂餐品'; - html += '' + t + ''; - } - html += ''; - } - html += '
'; - html += '
' + getTotalWeight(it.qty) + '
'; - html += '
'; - html += '
' + it.kcal + '
'; - html += ''; - html += '
'; - } - html += '
'; + // 存储当前餐次数据,供弹窗使用 + window._currentMealItems = filtered; + var html = '
'; + for (var j = 0; j < filtered.length; j++) { + var it = filtered[j]; + html += '
'; + // 食材图标 + html += '
'; + html += '
'; + html += '' + it.name + ''; + if (it.badges && it.badges.length) { + html += ''; + for (var b = 0; b < it.badges.length; b++) { + var badge = it.badges[b]; + var t = badge === 'low-sodium' ? '低钠' : badge === 'low-purine' ? '低嘌呤' : '食堂餐品'; + html += '' + t + ''; + } + html += ''; + } + html += '
'; + html += '
' + getTotalWeight(it.qty) + '
'; + html += '
'; + html += '
' + it.kcal + '
'; + html += ''; + html += '
'; + } + html += '
'; document.getElementById('mealContent').innerHTML = html; - // 更新推荐理由 - var reason = '— 根据你的偏好与健康目标推荐'; - document.getElementById('mealReason').textContent = reason; + // 更新推荐理由 + var reason = '根据你的偏好与健康目标推荐'; + document.getElementById('mealReason').textContent = reason; } function switchMealTab(tab, el) { @@ -958,20 +1273,28 @@ function renderWeekDays() { } function renderWeekDetail(dayIdx) { - var plan = WEEK_PLANS[dayIdx]; - var html = '
' + plan.total + '千卡
'; - html += '
'; - for (var i = 0; i < plan.meals.length; i++) { - var item = plan.meals[i]; - html += '
'; - html += '
' + item.meal + '
'; - html += '
' + item.name + '
'; - html += '
' + item.kcal + 'kcal
'; - html += '
'; - } - html += '
'; - document.getElementById('weekDetail').innerHTML = html; -} + var plan = WEEK_PLANS[dayIdx]; + var html = '
' + plan.total + '千卡
'; + html += '
'; + var mealIcons = { '早餐':'🌅', '午餐':'☀️', '晚餐':'🌙', '加餐':'🍪' }; + var mealColors = { '早餐':'#faad14', '午餐':'#ff7a45', '晚餐':'#597ef7', '加餐':'#52c41a' }; + for (var i = 0; i < plan.meals.length; i++) { + var item = plan.meals[i]; + var iconEmoji = mealIcons[item.meal] || '🍽️'; + var iconColor = mealColors[item.meal] || '#999'; + html += '
'; + html += '
'; + html += '
'; + html += '' + item.name + ''; + html += '
'; + html += '
' + item.meal + '
'; + html += '
'; + html += '
' + item.kcal + ' kcal
'; + html += '
'; + } + html += '
'; + document.getElementById('weekDetail').innerHTML = html; + } var currentWeekDay = 0; function switchWeekDay(dayIdx, el) { @@ -1000,31 +1323,31 @@ function openMealDetail(idx) { if (!it) return; _currentDetailItem = it; - // 渲染弹窗头部 - var headerHtml = ''; - headerHtml += '
' + it.name + '
'; - if (it.qty) headerHtml += '
' + getTotalWeight(it.qty) + '
'; - headerHtml += '
' + it.kcal + '
'; - if (it.badges && it.badges.length) { - headerHtml += '
'; - for (var b = 0; b < it.badges.length; b++) { - var badge = it.badges[b]; - var t = badge === 'low-sodium' ? '低钠' : badge === 'low-purine' ? '低嘌呤' : '食堂餐品'; - headerHtml += '' + t + ''; - } - headerHtml += '
'; - } - document.getElementById('mealDetailHeader').innerHTML = headerHtml; + // 渲染弹窗头部 + var headerHtml = ''; + headerHtml += '
' + it.name + '
'; + if (it.qty) headerHtml += '
' + getTotalWeight(it.qty) + '
'; + headerHtml += '
' + it.kcal + '
'; + if (it.badges && it.badges.length) { + headerHtml += '
'; + for (var b = 0; b < it.badges.length; b++) { + var badge = it.badges[b]; + var t = badge === 'low-sodium' ? '低钠' : badge === 'low-purine' ? '低嘌呤' : '食堂餐品'; + headerHtml += '' + t + ''; + } + headerHtml += '
'; + } + document.getElementById('mealDetailHeader').innerHTML = headerHtml; - // 渲染弹窗正文 - var bodyHtml = ''; - if (it.desc) { - bodyHtml += '
'; - bodyHtml += '
餐品描述
'; - bodyHtml += '
' + it.desc.replace(/\n/g, '
') + '
'; - bodyHtml += '
'; - } - document.getElementById('mealDetailBody').innerHTML = bodyHtml; + // 渲染弹窗正文 + var bodyHtml = ''; + if (it.desc) { + bodyHtml += '
'; + bodyHtml += '
📋 餐品描述
'; + bodyHtml += '
' + it.desc.replace(/\n/g, '
') + '
'; + bodyHtml += '
'; + } + document.getElementById('mealDetailBody').innerHTML = bodyHtml; document.getElementById('mealDetailOverlay').classList.add('show'); } @@ -1038,7 +1361,7 @@ function dislikeMeal() { if (!_currentDetailItem) return; var itemName = _currentDetailItem.name; // 显示二次确认弹窗 - document.getElementById('dislikeConfirmTitle').textContent = '确认移除【' + itemName + '】吗,后续将不再推荐该餐品'; + document.getElementById('dislikeConfirmTitle').textContent = '后续不再推荐【' + itemName + '】'; document.getElementById('dislikeConfirmReason').value = ''; document.getElementById('dislikeConfirmOverlay').classList.add('show'); } diff --git a/employee-app/weight-management/diet-questionnaire.html b/employee-app/weight-management/diet-questionnaire.html index 3663930..a100f3d 100644 --- a/employee-app/weight-management/diet-questionnaire.html +++ b/employee-app/weight-management/diet-questionnaire.html @@ -20,7 +20,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .questionnaire { flex: 1; overflow-y: auto; background: #f5f7fa; display: flex; flex-direction: column; } .questionnaire::-webkit-scrollbar { display: none; } -.questionnaire__hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 32px 20px 24px; color: #fff; text-align: center; flex-shrink: 0; } +.questionnaire__hero { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); padding: 32px 20px 24px; color: #fff; text-align: center; flex-shrink: 0; } .questionnaire__hero-icon { font-size: 40px; margin-bottom: 8px; } .questionnaire__hero-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; } .questionnaire__hero-sub { font-size: 13px; opacity: 0.85; } @@ -28,7 +28,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .questionnaire__body { flex: 1; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 14px; } .questionnaire__q { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); } .questionnaire__q-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } -.questionnaire__q-num { width: 22px; height: 22px; border-radius: 50%; background: #667eea; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } +.questionnaire__q-num { width: 22px; height: 22px; border-radius: 50%; background: #52c41a; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .questionnaire__q-title { font-size: 14px; font-weight: 700; color: #1a1a1a; } .questionnaire__q-required { font-size: 10px; color: #ff4d4f; margin-left: auto; } @@ -40,14 +40,14 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: /* Chip 标签选择 */ .questionnaire__chips { display: flex; gap: 8px; flex-wrap: wrap; } .questionnaire__chip { font-size: 13px; padding: 8px 16px; border-radius: 20px; font-weight: 600; cursor: pointer; border: 1.5px solid #e0e0e0; color: #666; background: #fff; transition: all .2s; } -.questionnaire__chip:hover { border-color: #91b8ff; background: #f5f9ff; } -.questionnaire__chip--active { border-color: #667eea; background: #f0f2ff; color: #667eea; } +.questionnaire__chip:hover { border-color: #b7eb8f; background: #f6ffed; } +.questionnaire__chip--active { border-color: #52c41a; background: #f6ffed; color: #52c41a; } .questionnaire__chip--active::before { content: '✓ '; font-size: 11px; } /* 提交按钮 */ .questionnaire__footer { padding: 16px 16px 24px; flex-shrink: 0; } -.questionnaire__submit { width: 100%; height: 48px; border-radius: 24px; border: none; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer; background: #d0d5e0; transition: all .25s; } -.questionnaire__submit--ready { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 6px 20px rgba(102,126,234,0.3); } +.questionnaire__submit { width: 100%; height: 48px; border-radius: 24px; border: none; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer; background: #d9f7be; transition: all .25s; } +.questionnaire__submit--ready { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); box-shadow: 0 6px 20px rgba(82,196,26,0.3); } .questionnaire__submit--ready:active { transform: scale(0.97); } /* ===== 地区选择底部 Sheet(省-市级联) ===== */ @@ -58,13 +58,13 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .region-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; } .region-sheet__cancel { font-size: 15px; color: #999; cursor: pointer; } .region-sheet__title { font-size: 16px; font-weight: 700; color: #1a1a1a; } -.region-sheet__submit { font-size: 15px; color: #667eea; font-weight: 600; cursor: pointer; } +.region-sheet__submit { font-size: 15px; color: #52c41a; font-weight: 600; cursor: pointer; } .region-sheet__list { padding: 6px 0; max-height: 360px; overflow-y: auto; } .region-sheet__list::-webkit-scrollbar { display: none; } .region-sheet__item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 15px; color: #333; cursor: pointer; } -.region-sheet__item.active { color: #667eea; font-weight: 600; background: #f0f2ff; } +.region-sheet__item.active { color: #52c41a; font-weight: 600; background: #f6ffed; } .region-sheet__check { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #d0d0d0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } -.region-sheet__item.active .region-sheet__check { background: #667eea; border-color: #667eea; } +.region-sheet__item.active .region-sheet__check { background: #52c41a; border-color: #52c41a; } .region-sheet__check svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; fill: none; display: none; } .region-sheet__item.active .region-sheet__check svg { display: block; } @@ -72,11 +72,11 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .region-sheet__view { display: none; } .region-sheet__view.active { display: block; } .region-sheet__back { display: flex; align-items: center; gap: 6px; padding: 10px 18px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f0f0; } -.region-sheet__back-arrow { font-size: 18px; line-height: 1; color: #667eea; } +.region-sheet__back-arrow { font-size: 18px; line-height: 1; color: #52c41a; } .region-sheet__back-label { color: #999; } .region-sheet__back-province { color: #1a1a1a; font-weight: 700; margin-left: auto; } .region-sheet__item--parent .region-sheet__sub { font-size: 13px; color: #bbb; font-weight: 600; display: flex; align-items: center; } -.region-sheet__item--parent.active .region-sheet__sub { color: #667eea; } +.region-sheet__item--parent.active .region-sheet__sub { color: #52c41a; } /* ===== 自定义规避食材底部 Sheet ===== */ .custom-avoid-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.45); z-index: 300; display: none; } @@ -86,15 +86,15 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .custom-avoid-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; } .custom-avoid-sheet__cancel { font-size: 15px; color: #999; cursor: pointer; } .custom-avoid-sheet__title { font-size: 16px; font-weight: 700; color: #1a1a1a; } -.custom-avoid-sheet__submit { font-size: 15px; color: #667eea; font-weight: 600; cursor: pointer; } +.custom-avoid-sheet__submit { font-size: 15px; color: #52c41a; font-weight: 600; cursor: pointer; } .custom-avoid-sheet__body { padding: 16px 18px; } .custom-avoid-sheet__input { width: 100%; height: 44px; border: 1.5px solid #e0e0e0; border-radius: 10px; padding: 0 14px; font-size: 15px; outline: none; transition: border-color .2s; font-family: inherit; } -.custom-avoid-sheet__input:focus { border-color: #667eea; } +.custom-avoid-sheet__input:focus { border-color: #52c41a; } .custom-avoid-sheet__hint { font-size: 11px; color: #bbb; margin-top: 8px; } .custom-avoid-sheet__quick-label { font-size: 12px; color: #999; font-weight: 600; margin: 16px 0 8px; } .custom-avoid-sheet__quick { display: flex; flex-wrap: wrap; gap: 8px; } .custom-avoid-sheet__quick-tag { font-size: 12px; padding: 5px 12px; border-radius: 16px; border: 1px solid #e0e0e0; color: #666; background: #fafafa; cursor: pointer; transition: all .2s; } -.custom-avoid-sheet__quick-tag:hover { border-color: #91b8ff; background: #f5f9ff; } +.custom-avoid-sheet__quick-tag:hover { border-color: #b7eb8f; background: #f6ffed; } .custom-avoid-sheet__quick-tag--added { border-color: #ffa39e; background: #fff1f0; color: #cf1322; } .custom-avoid-sheet__quick-tag--added::after { content: ' ✓'; } @@ -104,7 +104,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items: .questionnaire__custom-tag:hover { background: #ffe9e7; } .questionnaire__custom-tag::after { content: '✕'; font-size: 10px; opacity: 0.7; } .questionnaire__chip--add { border-style: dashed !important; color: #bbb !important; border-color: #d0d0d0 !important; background: #fafafa !important; } -.questionnaire__chip--add:hover { border-color: #667eea !important; color: #667eea !important; background: #f5f9ff !important; } +.questionnaire__chip--add:hover { border-color: #52c41a !important; color: #52c41a !important; background: #f6ffed !important; } .questionnaire__chip--add::before { content: '+ ' !important; } /* 底部 Sheet 滑入动画 */ @@ -175,7 +175,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
3 - 规避食材(过敏 / 不喜欢) + 饮食禁忌 选填