feat: 配方卡片加入上传个人二维码功能 #5

Merged
hera merged 23 commits from feature/qr-upload-hint into main 2026-04-08 22:09:30 +00:00
Showing only changes of commit cc79ae1211 - Show all commits

View File

@@ -635,13 +635,13 @@ async function saveToDiary() {
const name = await showPrompt('保存为我的配方,名称:', recipe.value.name)
if (!name) return
try {
await api.post('/api/diary', {
await recipesStore.saveRecipe({
name,
source_recipe_id: recipe.value._id || null,
ingredients: recipe.value.ingredients.map(i => ({ oil: i.oil, drops: i.drops })),
note: recipe.value.note || '',
ingredients: recipe.value.ingredients.map(i => ({ oil_name: i.oil, drops: i.drops })),
tags: recipe.value.tags || [],
})
ui.showToast('已保存到「我的配方日记」')
ui.showToast('已保存到「我的配方」')
} catch (e) {
ui.showToast('保存失败: ' + (e?.message || '未知错误'))
}