From 3912e2d12281222d478d6e881f44f300bdada703 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Thu, 9 Apr 2026 16:28:34 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=B7=E6=A0=BC=E5=AD=97=E5=8F=B7?= =?UTF-8?q?=E9=9A=8F=E5=90=8D=E7=A7=B0=E7=BC=A9=E6=94=BE=E3=80=81=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E8=A1=A8=E8=A1=A5=E5=85=A8=E3=80=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86=E5=85=A8=E5=AE=BD=E3=80=81=E4=B8=8B=E6=9E=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 价格字号: - 用 clamp() 跟精油名同步缩放 - 不再硬编码 13px/11px 翻译表 (useOilTranslation): - 补充: 舒缓→Deep Blue, 保卫→On Guard, 乐活→DigestZen 等 - oilEn() 支持模糊匹配: 去掉/添加"复方""呵护"后缀再试 编辑弹窗: - form-input 加 width:100% + box-sizing:border-box - 去掉 max-width:400px 限制(已在上一次提交) 下架: - 需要重启后端才能生效(OilIn model 变更需重启 uvicorn) Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/composables/useOilTranslation.js | 23 +++++++++++--- frontend/src/views/OilReference.vue | 31 ++++++++++++++----- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/frontend/src/composables/useOilTranslation.js b/frontend/src/composables/useOilTranslation.js index 0cdcaea..8a12960 100644 --- a/frontend/src/composables/useOilTranslation.js +++ b/frontend/src/composables/useOilTranslation.js @@ -14,14 +14,27 @@ const OIL_EN = { '柠檬草': 'Lemongrass', '杜松浆果': 'Juniper Berry', '甜橙': 'Wild Orange', '香茅': 'Citronella', '薄荷': 'Peppermint', '扁柏': 'Arborvitae', '古巴香脂': 'Copaiba', '椰子油': 'Coconut Oil', - '芳香调理': 'AromaTouch', '保卫复方': 'On Guard', - '乐活复方': 'Balance', '舒缓复方': 'Past Tense', - '净化复方': 'Purify', '呼吸复方': 'Breathe', - '舒压复方': 'Adaptiv', '多特瑞': 'doTERRA', + '芳香调理': 'AromaTouch', '保卫复方': 'On Guard', '保卫': 'On Guard', + '乐活复方': 'Balance', '乐活': 'DigestZen', + '舒缓复方': 'Past Tense', '舒缓': 'Deep Blue', + '净化复方': 'Purify', '净化清新': 'Purify', + '呼吸复方': 'Breathe', '顺畅呼吸': 'Breathe', + '舒压复方': 'Adaptiv', '安定情绪': 'Balance', + '安宁神气': 'Serenity', '多特瑞': 'doTERRA', + '野橘': 'Wild Orange', '柑橘清新': 'Citrus Bliss', + '新瑞活力': 'MetaPWR', '元气': 'Zendocrine', + '温柔呵护': 'ClaryCalm', '西洋蓍草': 'Yarrow|Pom', + '西班牙牛至': 'Oregano', } export function oilEn(name) { - return OIL_EN[name] || '' + if (OIL_EN[name]) return OIL_EN[name] + // Try without common suffixes + const base = name.replace(/复方$|呵护$/, '') + if (base !== name && OIL_EN[base]) return OIL_EN[base] + // Try adding suffixes + if (OIL_EN[name + '复方']) return OIL_EN[name + '复方'] + return '' } export function recipeNameEn(name) { diff --git a/frontend/src/views/OilReference.vue b/frontend/src/views/OilReference.vue index e5ec392..bda5bff 100644 --- a/frontend/src/views/OilReference.vue +++ b/frontend/src/views/OilReference.vue @@ -134,16 +134,12 @@
@@ -1045,10 +1041,12 @@ async function saveCardImage(name) { .form-input { flex: 1; + width: 100%; min-width: 100px; padding: 8px 12px; border: 1.5px solid var(--border, #e0d4c0); border-radius: 8px; + box-sizing: border-box; font-size: 13px; font-family: inherit; outline: none; @@ -1218,6 +1216,23 @@ async function saveCardImage(name) { color: var(--text-light); white-space: nowrap; } +.oil-price-line { + font-size: clamp(10px, 2.2vw, 13px); + color: var(--sage-dark); + font-weight: 600; + white-space: nowrap; +} +.oil-price-unit { + font-size: clamp(8px, 1.6vw, 10px); + font-weight: 400; + color: var(--text-light); +} +.oil-retail-line { + font-size: clamp(8px, 1.6vw, 11px); + color: var(--text-light); + text-decoration: line-through; + white-space: nowrap; +} .oil-chip-actions { position: absolute;