fix: 配方卡片QR恢复absolute定位+padding-right避让,预览图修正
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Failing after 1m27s

配方卡片:
- 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) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 12:18:03 +00:00
parent 2417ea2525
commit 765bc0facc
3 changed files with 40 additions and 27 deletions

View File

@@ -55,12 +55,12 @@
class="card-brand-bg"
:style="{ backgroundImage: `url('${brand.brand_bg}')` }"
/>
<!-- QR: absolute positioned in export-card, top-right corner of content area -->
<div v-if="brand.qr_code" class="card-qr-wrapper">
<img :src="brand.qr_code" class="card-qr" crossorigin="anonymous" />
<div v-if="brand.brand_name" class="card-qr-name">{{ brand.brand_name }}</div>
</div>
<div class="card-content">
<!-- QR floated right, aligns with brand text top -->
<div v-if="brand.qr_code" class="card-qr-float">
<img :src="brand.qr_code" class="card-qr" crossorigin="anonymous" />
<div v-if="brand.brand_name" class="card-qr-name">{{ brand.brand_name }}</div>
</div>
<div class="card-brand-text">
{{ cardLang === 'en' ? 'doTERRA · Gifts of the Earth' : 'doTERRA · 来自大地的礼物' }}
</div>
@@ -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 {