-
💧
-
稀释比例
-
不同年龄段的稀释指南
+
-
-
⚠️
-
使用禁忌
-
安全使用精油的注意事项
+
@@ -673,27 +677,20 @@ async function toggleOilActive() {
const meta = getMeta(name)
const newActive = meta?.isActive === false ? 1 : 0
try {
- const res = await api('/api/oils', {
- method: 'POST',
- body: JSON.stringify({
- name,
- bottle_price: meta?.bottlePrice || 0,
- drop_count: meta?.dropCount || 1,
- retail_price: meta?.retailPrice,
- is_active: newActive,
- }),
+ await api.post('/api/oils', {
+ name,
+ bottle_price: meta?.bottlePrice || 0,
+ drop_count: meta?.dropCount || 1,
+ retail_price: meta?.retailPrice || null,
+ en_name: meta?.enName || null,
+ is_active: newActive,
})
- if (!res.ok) {
- const err = await res.json().catch(() => ({}))
- ui.showToast('操作失败: ' + (err.detail || res.status))
- return
- }
await oils.loadOils()
cardVersion.value++
ui.showToast(newActive ? '已重新上架' : '已下架')
editingOilName.value = null
} catch (e) {
- ui.showToast('操作失败: ' + (e.message || ''))
+ ui.showToast('操作失败: ' + (e.message || e))
}
}
@@ -1206,33 +1203,39 @@ async function saveCardImage(name) {
background: #fff5f5 !important;
}
.oil-name-line {
- font-size: clamp(10px, 2.5vw, 14px);
+ font-size: 14px;
font-weight: 500;
color: var(--text-dark);
white-space: nowrap;
}
.oil-en-line {
- font-size: clamp(8px, 1.8vw, 10px);
+ font-size: 10px;
color: var(--text-light);
white-space: nowrap;
}
.oil-price-line {
- font-size: clamp(10px, 2.2vw, 13px);
+ font-size: 13px;
color: var(--sage-dark);
font-weight: 600;
white-space: nowrap;
}
.oil-price-unit {
- font-size: clamp(8px, 1.6vw, 10px);
+ font-size: 10px;
font-weight: 400;
color: var(--text-light);
}
.oil-retail-line {
- font-size: clamp(8px, 1.6vw, 11px);
+ font-size: 11px;
color: var(--text-light);
text-decoration: line-through;
white-space: nowrap;
}
+@media (max-width: 480px) {
+ .oil-name-line { font-size: 12px; }
+ .oil-en-line { font-size: 9px; }
+ .oil-price-line { font-size: 11px; }
+ .oil-retail-line { font-size: 9px; }
+}
.oil-chip-actions {
position: absolute;