fix: 字号恢复正常大小、下架改用api.post、翻译编辑器预填充
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Failing after 1m26s

精油价目:
- 字号恢复固定大小(14/10/13/11px),手机端@media缩小
- 不再用clamp()(之前太小)
- 下架改用 api.post 替代 api() raw fetch,更可靠
- 稀释比例/使用禁忌卡片: emoji和标题合并为一行(flex row)

翻译同步:
- 打开翻译编辑器时预填充: 读取 oilsMeta.enName → oilEn() → 填入输入框
- 用户看到当前英文名,修改后保存到 oils.en_name
- 精油价目页 getEnglishName 读同一字段,自动同步

翻译表:
- 补充 舒缓→Deep Blue 等常用精油英文名
- oilEn() 支持去掉/添加"复方"后缀匹配

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 16:38:04 +00:00
parent 3912e2d122
commit 73a041d9c8
2 changed files with 44 additions and 29 deletions

View File

@@ -103,7 +103,7 @@
<button
v-if="cardLang === 'en' && authStore.canManage"
class="action-btn"
@click="showTranslationEditor = true"
@click="openTranslationEditor"
> 修改翻译</button>
<button
v-if="showBrandHint"
@@ -595,6 +595,18 @@ function copyText() {
})
}
function openTranslationEditor() {
// Pre-populate with existing English names from DB/translation table
const map = {}
for (const ing of cardIngredients.value) {
const existing = oilsStore.oilsMeta[ing.oil]?.enName || oilEn(ing.oil)
if (existing) map[ing.oil] = existing
}
customOilNameEn.value = map
customRecipeNameEn.value = recipe.value.en_name || recipeNameEn(recipe.value.name)
showTranslationEditor.value = true
}
async function applyTranslation() {
showTranslationEditor.value = false
let saved = 0