fix: 价格字号随名称缩放、翻译表补全、编辑框全宽、下架修复
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Has been cancelled

价格字号:
- 用 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) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 16:28:34 +00:00
parent 4826c00e27
commit 3912e2d122
2 changed files with 41 additions and 13 deletions

View File

@@ -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) {

View File

@@ -134,16 +134,12 @@
</div>
<div style="text-align:right;flex-shrink:0">
<template v-if="viewMode === 'bottle'">
<div style="font-size:13px;color:var(--sage-dark);font-weight:600">
¥{{ (getMeta(name)?.bottlePrice || 0).toFixed(0) }}<span style="font-size:10px;font-weight:400;color:var(--text-light)">/</span>
</div>
<div v-if="getMeta(name)?.retailPrice" style="font-size:11px;color:var(--text-light);text-decoration:line-through">¥{{ getMeta(name).retailPrice }}/</div>
<div class="oil-price-line">¥{{ (getMeta(name)?.bottlePrice || 0).toFixed(0) }}<span class="oil-price-unit">/</span></div>
<div v-if="getMeta(name)?.retailPrice" class="oil-retail-line">¥{{ getMeta(name).retailPrice }}/</div>
</template>
<template v-else>
<div style="font-size:13px;color:var(--sage-dark);font-weight:600">
¥{{ oils.pricePerDrop(name).toFixed(2) }}{{ name === '植物空胶囊' ? '/颗' : '/滴' }}
</div>
<div v-if="getMeta(name)?.retailPrice && getMeta(name)?.dropCount" style="font-size:11px;color:var(--text-light);text-decoration:line-through">
<div class="oil-price-line">¥{{ oils.pricePerDrop(name).toFixed(2) }}<span class="oil-price-unit">{{ name === '植物空胶囊' ? '/颗' : '/滴' }}</span></div>
<div v-if="getMeta(name)?.retailPrice && getMeta(name)?.dropCount" class="oil-retail-line">
¥{{ (getMeta(name).retailPrice / getMeta(name).dropCount).toFixed(2) }}{{ name === '植物空胶囊' ? '/' : '/' }}
</div>
</template>
@@ -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;