feat: 新功能改进 #20
@@ -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))
|
||||
)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user