feat: 新功能改进 #20

Merged
hera merged 57 commits from feat/next-improvements into main 2026-04-10 20:30:37 +00:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 65ac0b688b - Show all commits

View File

@@ -17,7 +17,7 @@
<button
v-if="canEditThisRecipe"
class="action-btn action-btn-sm"
@click="viewMode = 'editor'"
@click="goEditInManager"
>编辑</button>
<button class="detail-close-btn" @click="handleClose"></button>
</div>
@@ -739,6 +739,14 @@ function addEoRow() {
editIngredients.value.push({ oil: '', drops: 1 })
}
function goEditInManager() {
const r = recipe.value
// Store recipe id for manager to pick up
localStorage.setItem('oil_edit_recipe_id', String(r._id))
emit('close')
router.push('/manage')
}
const editPriceInfo = computed(() =>
oilsStore.fmtCostWithRetail(editIngredients.value.filter(i => i.oil))
)

View File

@@ -946,6 +946,13 @@ onMounted(async () => {
if (res.ok) reviewHistory.value = await res.json()
} catch {}
}
// Open recipe editor if redirected from card view
const editId = localStorage.getItem('oil_edit_recipe_id')
if (editId) {
localStorage.removeItem('oil_edit_recipe_id')
const recipe = recipeStore.recipes.find(r => String(r._id) === editId)
if (recipe) editRecipe(recipe)
}
})
function editDiaryRecipe(diary) {