feat: 套装成本扣除配件价值后再分摊
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Has been cancelled

芳香调理-香薰机¥375,家庭医生-香薰机+木盒¥475,全精油-香薰机+竹木架¥575

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 00:06:59 +00:00
parent 9fe6eeaf29
commit a3d3e21085
2 changed files with 7 additions and 3 deletions

View File

@@ -37,9 +37,9 @@ export function useKitCost() {
}
if (totalBottlePrice === 0) return {}
// Proportional allocation — kit accessories treated as freebies,
// so oil cost = min(kit price, sum of bottle prices)
const effectivePrice = Math.min(kit.price, totalBottlePrice)
// Proportional allocation — subtract accessory value, then cap at bottle price sum
const oilBudget = kit.price - (kit.accessoryValue || 0)
const effectivePrice = Math.min(oilBudget, totalBottlePrice)
const perDrop = {}
for (const name of resolved) {
const meta = oils.oilsMeta[name]