feat: 新增产品表单(ml/g/颗)+配方卡片显示产品容量
All checks were successful
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 5s
PR Preview / deploy-preview (pull_request) Successful in 13s
Test / e2e-test (push) Successful in 50s

- 精油价目新增分两个tab:新增精油(标准容量) / 新增其他产品(ml/g/颗)
- saveOil支持unit参数
- 配方卡片:含产品的配方直接显示产品用量+单位(如30g)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 16:30:46 +00:00
parent 42993d47ee
commit 30bb69f52c
3 changed files with 65 additions and 11 deletions

View File

@@ -56,13 +56,10 @@ const volumeLabel = computed(() => {
if (ml <= 2) return '单次'
return `${Math.round(ml)}ml`
}
// Non-coconut: check if has portion product, extract volume from note
const hasPortion = ings.some(i => oilsStore.isPortionUnit(i.oil))
if (hasPortion) {
const note = props.recipe.note || ''
const m = note.match(/(\d+)\s*(ml|毫升|克|g)/i)
if (m) return `${m[1]}${m[2].toLowerCase()}`
return '调配'
// Non-coconut: find portion product and show its amount + unit
const portionIng = ings.find(i => oilsStore.isPortionUnit(i.oil))
if (portionIng) {
return `${portionIng.drops}${oilsStore.unitLabel(portionIng.oil)}`
}
return ''
})