From 765bc0facc800a32003309bba7978e5f8e4cb934 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Thu, 9 Apr 2026 12:18:03 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=85=8D=E6=96=B9=E5=8D=A1=E7=89=87QR?= =?UTF-8?q?=E6=81=A2=E5=A4=8Dabsolute=E5=AE=9A=E4=BD=8D+padding-right?= =?UTF-8?q?=E9=81=BF=E8=AE=A9=EF=BC=8C=E9=A2=84=E8=A7=88=E5=9B=BE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配方卡片: - QR恢复absolute(top:36px right:36px),不用float避免文字环绕 - card-content加padding-right:70px给QR留空间 - 文字不会被QR挤压 预览图: - QR+品牌名放在右上角area里(absolute定位) - 品牌名文字显示在QR图片下方 - 内容区padding-right:60px避让QR 返回配方: - openRecipe参数用String比较修复类型不匹配 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/RecipeDetailOverlay.vue | 20 +++++---- frontend/src/views/MyDiary.vue | 45 ++++++++++++------- frontend/src/views/RecipeSearch.vue | 2 +- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 9ca9926..0584d54 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -55,12 +55,12 @@ class="card-brand-bg" :style="{ backgroundImage: `url('${brand.brand_bg}')` }" /> + +
+ +
{{ brand.brand_name }}
+
- -
- -
{{ brand.brand_name }}
-
{{ cardLang === 'en' ? 'doTERRA · Gifts of the Earth' : 'doTERRA · 来自大地的礼物' }}
@@ -1122,6 +1122,7 @@ async function saveRecipe() { .card-content { position: relative; z-index: 2; + padding-right: 70px; /* leave room for QR */ } /* Brand overlays */ @@ -1138,14 +1139,15 @@ async function saveRecipe() { pointer-events: none; } -.card-qr-float { - float: right; +.card-qr-wrapper { + position: absolute; + top: 36px; + right: 36px; display: flex; flex-direction: column; align-items: center; gap: 3px; - margin-left: 12px; - margin-bottom: 8px; + z-index: 3; } .card-qr { diff --git a/frontend/src/views/MyDiary.vue b/frontend/src/views/MyDiary.vue index ef1ad36..28ec645 100644 --- a/frontend/src/views/MyDiary.vue +++ b/frontend/src/views/MyDiary.vue @@ -170,24 +170,28 @@
- - - + +
+ +
{{ brandName }}
+
+
doTERRA · 来自大地的礼物
配方名称
薰衣草 · 乳香 · 茶树
-
配方总成本   ¥12.50
+
+ 配方总成本 + ¥12.50 +
制作日期:{{ new Date().toLocaleDateString('zh-CN') }}
- -
{{ brandName }}
@@ -1064,17 +1068,31 @@ async function applyBusiness() { .card-preview-content { position: relative; z-index: 1; - padding-right: 50px; /* leave room for QR */ + padding-right: 60px; /* leave room for QR area */ } -.card-preview-qr { +.card-preview-qr-area { position: absolute; top: 16px; right: 16px; + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + z-index: 2; + max-width: 50px; +} +.card-preview-qr { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; - z-index: 2; +} +.card-preview-qr-text { + font-size: 6px; + color: var(--text-light); + line-height: 1.2; + word-break: break-all; + max-width: 50px; } .card-preview-cost { position: relative; @@ -1109,14 +1127,7 @@ async function applyBusiness() { color: var(--text-light); letter-spacing: 0.5px; } -.card-preview-brand { - position: relative; - z-index: 1; - margin-top: 4px; - font-size: 8px; - color: var(--text-light); - white-space: pre-line; -} +/* brand name now inside .card-preview-qr-text */ .hint-text { font-size: 13px; diff --git a/frontend/src/views/RecipeSearch.vue b/frontend/src/views/RecipeSearch.vue index 585148f..a6de34a 100644 --- a/frontend/src/views/RecipeSearch.vue +++ b/frontend/src/views/RecipeSearch.vue @@ -174,7 +174,7 @@ onMounted(async () => { if (openRecipeId) { router.replace({ path: '/', query: {} }) const tryOpen = () => { - const idx = recipeStore.recipes.findIndex(r => r._id === openRecipeId) + const idx = recipeStore.recipes.findIndex(r => String(r._id) === String(openRecipeId)) if (idx >= 0) { openDetail(idx) return true