UI: 容量按钮缩小、自定义默认空、保存验证、比例提示加"时,"
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 17s
Test / e2e-test (push) Failing after 56s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 16:32:31 +00:00
parent 4beae71072
commit d38582167b
2 changed files with 9 additions and 4 deletions

View File

@@ -165,7 +165,7 @@
<select v-model.number="dilutionRatio" class="editor-select" style="width:60px">
<option v-for="n in [3,4,5,6,7,8,9,10,12,15,20]" :key="n" :value="n">{{ n }}</option>
</select>
<span class="ratio-hint">纯精油总数约为 {{ editorSuggestedEo }} 现在为 {{ editorEoDrops }} </span>
<span class="ratio-hint">纯精油总数约为 {{ editorSuggestedEo }} 现在为 {{ editorEoDrops }} </span>
</div>
</div>

View File

@@ -253,7 +253,7 @@
<select v-model.number="formDilution" class="select-sm">
<option v-for="n in [3,4,5,6,7,8,9,10,12,15,20]" :key="n" :value="n">{{ n }}</option>
</select>
<span class="ratio-hint">纯精油总数约为 {{ suggestedEoDrops }} 现在为 {{ eoTotalDrops }} </span>
<span class="ratio-hint">纯精油总数约为 {{ suggestedEoDrops }} 现在为 {{ eoTotalDrops }} </span>
</div>
</div>
@@ -433,7 +433,7 @@ const newIngSearch = ref('')
const newIngDrops = ref(1)
const newIngDropdownOpen = ref(false)
const formVolume = ref('30')
const formCustomVolume = ref(100)
const formCustomVolume = ref(null)
const formCustomUnit = ref('drops')
const formDilution = ref(6)
@@ -764,6 +764,7 @@ function resetForm() {
newIngSearch.value = ''
newIngDrops.value = 1
formVolume.value = '30'
formCustomVolume.value = null
formDilution.value = 6
}
@@ -933,6 +934,10 @@ function toggleFormTag(tag) {
}
async function saveCurrentRecipe() {
if (formVolume.value === 'custom' && !formCustomVolume.value) {
ui.showToast('请输入自定义容量')
return
}
const eoIngs = formIngredients.value.filter(i => i.oil && i.oil !== '椰子油' && i.drops > 0)
if (!formName.value.trim()) {
ui.showToast('请输入配方名称')
@@ -1706,7 +1711,7 @@ watch(() => recipeStore.recipes, () => {
.action-btn-primary:hover { opacity: 0.9; }
.action-btn-sm { padding: 5px 12px; font-size: 12px; }
.volume-controls { display: flex; gap: 6px; margin-bottom: 8px; }
.volume-btn { flex: 1; padding: 6px 0; border: 1.5px solid #d4cfc7; border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; font-family: inherit; color: #6b6375; text-align: center; }
.volume-btn { flex: 1; padding: 4px 0; border: 1px solid #d4cfc7; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; font-family: inherit; color: #6b6375; text-align: center; }
.volume-btn.active { background: #e8f5e9; border-color: #7ec6a4; color: #2e7d5a; font-weight: 600; }
.volume-btn:hover { border-color: #7ec6a4; }
.custom-volume-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }