feat: Header重排、共享配方到公共库、待审核配方、权限优化 #17
Reference in New Issue
Block a user
Delete Branch "fix/ui-polish-round2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
改动
Header
配方共享
管理配方
🤖 Generated with Claude Code
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
- 新增 composables/useSaveImage.js - saveImageFromUrl: data URL → 手机分享/桌面下载 - captureAndSave: DOM元素 → html2canvas → 保存 - saveCanvasImage: canvas → 保存 - RecipeDetailOverlay: saveImage 改用 saveImageFromUrl - OilReference: saveModalImage 改用 captureAndSave - 手机端调用 navigator.share({files}) 弹出系统分享面板 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
navigator.share 在部分手机浏览器不可用时,改为弹出全屏图片 让用户长按保存到相册。三层 fallback: 1. navigator.share({files}) → 系统分享面板 2. 图片弹窗 → 长按保存(手机通用) 3. 下载链接(桌面) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
完全复制 RecipeDetailOverlay 的模式: 1. import html2canvas at top level (not dynamic) 2. ref 存预生成的 imageUrl (dilutionImageUrl, contraImageUrl, oilCardImageUrl) 3. generateImageFromRef: html2canvas截图→dataUrl存入ref 参数: backgroundColor=null, scale=3, useCORS=true, allowTaint=false 4. saveGeneratedImage: 如果没截图先生成,然后调 saveImageFromUrl 5. saveImageFromUrl: navigator.share({files}) → 系统分享面板 跟 RecipeDetailOverlay.saveImage 每一步都一样。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
根因: PUT /api/recipes/{id} 传了 version 字段导致 409 冲突 (version 不匹配时后端拒绝),但修改 en_name 不需要 version 检查 修复: - 保存 recipe en_name 时不传 version(后端只在 version 存在时才检查) - 保存后 loadRecipes + loadOils 刷新数据 - 下次打开配方卡片读到最新的 en_name - 精油价目页也同步更新(loadOils 刷新 oilsMeta.enName) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
核心设计: oils.en_name (DB) 是唯一数据源 读取链路 (全部统一): - 精油价目: getEnglishName → oilsMeta.enName → oilEn() - 配方卡片: getCardOilName → oilsMeta.enName → oilEn() - 翻译编辑器: openTranslationEditor → oilsMeta.enName 写入链路 (全部写同一个字段): - 精油价目编辑: saveEditOil → oilsStore.saveOil → oils.en_name → loadOils - 配方卡翻译: applyTranslation → oilsStore.saveOil → oils.en_name → loadOils - 配方名翻译: applyTranslation → PUT /api/recipes/{id} → recipes.en_name → loadRecipes 保存后: - await Promise.all([loadOils(), loadRecipes()]) 刷新所有数据 - 下次任何地方渲染都读到最新值 - customOilNameEn 只在编辑器打开期间有效,关闭后丢弃 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🚀 Preview: https://pr-17.oil.oci.euphon.net
DB is a copy of production.
🗑️ Preview torn down.