From 1c094ed14bf0d657eaa1f02e7c5df163f1d0e30c Mon Sep 17 00:00:00 2001
From: zzc <1761997216@qq.com>
Date: Thu, 22 Jan 2026 08:55:00 +0800
Subject: [PATCH] fix: card content position
---
pages/make/index.vue | 46 +++++++++++++++++++++++++++++++++-----------
1 file changed, 35 insertions(+), 11 deletions(-)
diff --git a/pages/make/index.vue b/pages/make/index.vue
index 47b0d6c..0fcda02 100644
--- a/pages/make/index.vue
+++ b/pages/make/index.vue
@@ -12,12 +12,16 @@
新春快乐
2026 YEAR OF THE HORSE
-
+
{{
targetName + "\n " + blessingText
}}
-
+
{{ signatureName }}
@@ -163,12 +167,29 @@
-
-
- 替换背景
-
-
-
+
+
+
+ 祝福语位置 (上下)
+ (bubbleOffsetY = e.detail.value)"
+ activeColor="#ff3b30"
+ />
+
+
+ 署名位置 (左右)
+ (userOffsetX = e.detail.value)"
+ activeColor="#ff3b30"
+ />
@@ -222,6 +243,9 @@ const selectedColor = ref("#ffffff");
const greetingLib = ref([]);
const greetingIndex = ref(0);
+const bubbleOffsetY = ref(0);
+const userOffsetX = ref(0);
+
onLoad((options) => {
cardId.value = "69674f307307beac4519025f";
// createCard();
@@ -337,7 +361,7 @@ const selectGreeting = (text) => {
const tools = [
{ type: "template", text: "模板", icon: "▦" },
{ type: "text", text: "文字", icon: "文" },
- // { type: "image", text: "图片/背景", icon: "图" },
+ { type: "position", text: "位置", icon: "图" },
// { type: "avatar", text: "头像挂饰", icon: "饰" },
];
const activeTool = ref("template");
@@ -438,7 +462,7 @@ const saveByCanvas = async (save = true) => {
drawBubbleText(ctx, {
text: targetName.value + "\n " + blessingText.value,
x: 70,
- y: 260,
+ y: 260 + bubbleOffsetY.value,
maxWidth: 400,
fontSize: 32,
lineHeight: 46,
@@ -447,7 +471,7 @@ const saveByCanvas = async (save = true) => {
});
drawUserBubble(ctx, {
- x: 40,
+ x: 40 + userOffsetX.value,
y: H - 120,
avatarPath: avatarPath,
username: signatureName.value,