feat: Header重排、共享配方到公共库、待审核配方、权限优化 #17
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user