fix: 配方卡片品牌样式与 initial commit 保持一致
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 1m16s

- 背景图改用 div+background-image,opacity 从 0.06 恢复为 0.12
- 二维码位置改回 top:36px/right:24px,尺寸 54×54,加圆角和阴影
- 二维码下方新增品牌名称小字(7px)
- Logo 位置改回 bottom:60px,尺寸 height:60px,opacity 0.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-08 07:42:40 +00:00
committed by Hera Zhao
parent 4761253d73
commit de74ffe638

View File

@@ -39,18 +39,19 @@
<!-- Card image (rendered by html2canvas) --> <!-- Card image (rendered by html2canvas) -->
<div v-show="!cardImageUrl" ref="cardRef" class="export-card"> <div v-show="!cardImageUrl" ref="cardRef" class="export-card">
<!-- Brand overlay layers --> <!-- Brand overlay layers -->
<img <div
v-if="brand.brand_bg" v-if="brand.brand_bg"
:src="brand.brand_bg"
class="card-brand-bg" class="card-brand-bg"
crossorigin="anonymous" :style="{ backgroundImage: `url('${brand.brand_bg}')` }"
/> />
<div v-if="brand.qr_code" class="card-qr-wrapper">
<img <img
v-if="brand.qr_code"
:src="brand.qr_code" :src="brand.qr_code"
class="card-qr" class="card-qr"
crossorigin="anonymous" crossorigin="anonymous"
/> />
<div v-if="brand.brand_name" class="card-qr-name">{{ brand.brand_name }}</div>
</div>
<img <img
v-if="brand.brand_logo" v-if="brand.brand_logo"
:src="brand.brand_logo" :src="brand.brand_logo"
@@ -997,32 +998,52 @@ async function saveRecipe() {
inset: 0; inset: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; background-size: cover;
opacity: 0.06; background-position: center;
background-repeat: no-repeat;
opacity: 0.12;
z-index: 0; z-index: 0;
pointer-events: none; pointer-events: none;
} }
.card-qr { .card-qr-wrapper {
position: absolute; position: absolute;
top: 16px; top: 36px;
right: 16px; right: 24px;
width: 64px; display: flex;
height: 64px; flex-direction: column;
object-fit: contain; align-items: center;
z-index: 3; gap: 3px;
opacity: 0.85; z-index: 2;
}
.card-qr {
width: 54px;
height: 54px;
object-fit: cover;
border-radius: 6px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.card-qr-name {
font-size: 7px;
color: var(--text-light, #8a7a6a);
text-align: center;
line-height: 1.3;
max-width: 68px;
white-space: pre-line;
} }
.card-logo { .card-logo {
position: absolute; position: absolute;
bottom: 16px; bottom: 60px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
height: 28px; height: 60px;
object-fit: contain; object-fit: contain;
z-index: 3; z-index: 1;
opacity: 0.3; opacity: 0.2;
pointer-events: none;
} }
.card-brand-text { .card-brand-text {