From 9f072e48f893df5bff3660377e86e81290f38073 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Mon, 13 Apr 2026 14:57:21 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20ml=E4=BA=A7=E5=93=81=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=80=82=E9=85=8D=20=E2=80=94=20=E7=BC=96=E8=BE=91=E5=99=A8/?= =?UTF-8?q?=E4=BB=B7=E7=9B=AE/=E8=AF=A6=E6=83=85=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=98=BE=E7=A4=BAml=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 编辑器: 表头改为"成分/用量/单价",每行显示对应单位(滴/ml) - 精油价目: ml产品显示"总容量Xml"和"每ml价格",精油保持"每滴" - 知识卡片/配方详情: 单位跟随产品类型 - 精油的"每ml价格"行对ml产品隐藏(已是ml单位) Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/RecipeDetailOverlay.vue | 13 ++++++++++--- frontend/src/views/OilReference.vue | 15 ++++++++------- frontend/src/views/RecipeManager.vue | 13 ++++++++++--- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 3958584..fdb3803 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -170,7 +170,7 @@
- + @@ -180,8 +180,13 @@ - - + + @@ -1703,6 +1708,8 @@ async function saveRecipe() { .editor-drops:focus { border-color: var(--sage, #7a9e7e); } +.drops-with-unit { display: flex; align-items: center; gap: 2px; } +.unit-hint { font-size: 11px; color: #b0aab5; white-space: nowrap; } .ing-ppd { font-size: 12px; diff --git a/frontend/src/views/OilReference.vue b/frontend/src/views/OilReference.vue index f221778..fb681bc 100644 --- a/frontend/src/views/OilReference.vue +++ b/frontend/src/views/OilReference.vue @@ -146,9 +146,9 @@
¥{{ getMeta(name).retailPrice }}/瓶
@@ -172,7 +172,7 @@
¥ {{ (getMeta(activeCardName).bottlePrice || 0).toFixed(2) }} - · ¥ {{ oils.pricePerDrop(activeCardName).toFixed(4) }}/滴 + · ¥ {{ oils.pricePerDrop(activeCardName).toFixed(4) }}/{{ oils.unitLabel(activeCardName) }}
@@ -231,18 +231,18 @@ {{ getMeta(selectedOilName)?.bottlePrice != null ? ('¥ ' + getMeta(selectedOilName).bottlePrice.toFixed(2)) : '--' }}
- 总滴数 - {{ getMeta(selectedOilName)?.dropCount || '--' }} + {{ oils.isMlUnit(selectedOilName) ? '总容量' : '总滴数' }} + {{ getMeta(selectedOilName)?.dropCount || '--' }}{{ oils.isMlUnit(selectedOilName) ? 'ml' : '' }}
- 每滴价格 + 每{{ oils.unitLabel(selectedOilName) }}价格 {{ oils.pricePerDrop(selectedOilName) ? ('¥ ' + oils.pricePerDrop(selectedOilName).toFixed(4)) : '--' }}
零售价 ¥ {{ getMeta(selectedOilName).retailPrice.toFixed(2) }}
-
+
每ml价格 {{ oils.pricePerDrop(selectedOilName) ? ('¥ ' + (oils.pricePerDrop(selectedOilName) * DROPS_PER_ML).toFixed(2)) : '--' }}
@@ -474,6 +474,7 @@ for (const [ml, drops] of Object.entries(VOLUME_OPTIONS)) { function volumeLabel(dropCount, name) { if (dropCount === 160) return '160颗' + if (oils.isMlUnit(name)) return dropCount + 'ml' return DROPS_TO_VOLUME[dropCount] || (dropCount + '滴') } diff --git a/frontend/src/views/RecipeManager.vue b/frontend/src/views/RecipeManager.vue index d72ff49..5808480 100644 --- a/frontend/src/views/RecipeManager.vue +++ b/frontend/src/views/RecipeManager.vue @@ -271,7 +271,7 @@
精油滴数单价/滴小计
成分用量单价小计
{{ ing.oil ? oilsStore.fmtPrice(oilsStore.pricePerDrop(ing.oil)) : '-' }} +
+ + {{ oilsStore.unitLabel(ing.oil) }} +
+
{{ ing.oil ? oilsStore.fmtPrice(oilsStore.pricePerDrop(ing.oil)) : '-' }}/{{ oilsStore.unitLabel(ing.oil) }} {{ ing.oil ? oilsStore.fmtPrice(oilsStore.pricePerDrop(ing.oil) * (ing.drops || 0)) : '-' }}
- + @@ -296,8 +296,13 @@ - - + + @@ -2081,6 +2086,8 @@ watch(() => recipeStore.recipes, () => { .editor-table td { padding: 6px 4px; border-bottom: 1px solid #f5f5f5; } .editor-drops { width: 65px; padding: 6px 8px; border: 1.5px solid #d4cfc7; border-radius: 8px; font-size: 13px; text-align: center; outline: none; font-family: inherit; } .editor-drops:focus { border-color: #7ec6a4; } +.drops-with-unit { display: flex; align-items: center; gap: 2px; } +.unit-hint { font-size: 11px; color: #b0aab5; white-space: nowrap; } .editor-input { padding: 8px 10px; border: 1.5px solid #d4cfc7; border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; width: 100%; box-sizing: border-box; } .editor-input:focus { border-color: #7ec6a4; } .editor-textarea { width: 100%; padding: 8px 10px; border: 1.5px solid #d4cfc7; border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; resize: vertical; box-sizing: border-box; }
精油滴数单价/滴小计
成分用量单价小计
{{ ing.oil ? oils.fmtPrice(oils.pricePerDrop(ing.oil)) : '-' }} +
+ + {{ oils.unitLabel(ing.oil) }} +
+
{{ ing.oil ? oils.fmtPrice(oils.pricePerDrop(ing.oil)) : '-' }}/{{ oils.unitLabel(ing.oil) }} {{ ing.oil && ing.drops ? oils.fmtPrice(oils.pricePerDrop(ing.oil) * ing.drops) : '-' }}