diff --git a/pages/avatar/index.vue b/pages/avatar/index.vue index 82250f3..1a989d2 100644 --- a/pages/avatar/index.vue +++ b/pages/avatar/index.vue @@ -676,7 +676,7 @@ onShareAppMessage(async () => { title: "新春祝福", path: `/pages/index/index?shareToken=${shareToken}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; } uni.showLoading({ title: "分享中...", mask: true }); diff --git a/pages/fortune/index.vue b/pages/fortune/index.vue index b893a85..9e6227a 100644 --- a/pages/fortune/index.vue +++ b/pages/fortune/index.vue @@ -167,7 +167,7 @@ onShareAppMessage(async () => { title: "马年运势我已经抽过了,你的会是什么?", path: `${cardId.value ? `/pages/fortune/detail?shareToken=${shareToken}` : `/pages/fortune/index?shareToken=${shareToken}`}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; }); diff --git a/pages/index/index.vue b/pages/index/index.vue index 21afe68..28fb3d4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -178,7 +178,7 @@ onShareAppMessage(async () => { title: "新年好运已送达 🎊|祝福卡·头像·壁纸", path: `/pages/index/index?shareToken=${shareToken}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; }); diff --git a/pages/make/index.vue b/pages/make/index.vue index df0feee..481bffd 100644 --- a/pages/make/index.vue +++ b/pages/make/index.vue @@ -66,7 +66,7 @@ fontFamily: selectedFont.family, fontSize: fontSize + 'rpx', lineHeight: fontSize * 1.5 + 'rpx', - fontWeight: 'bold', + fontWeight: fontWeight, }" >{{ (targetName || "") + "\n " + (blessingText.content || "") @@ -85,10 +85,14 @@ > - {{ - signatureName - }} - {{ signatureName }} + 送上祝福 @@ -288,6 +292,27 @@ /> + + + 字体粗细 + + + 常规 + + + 加粗 + + + + 祝福语宽窄 { title: "新春祝福", path: "/pages/index/index?shareToken=" + shareToken, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; } // 1. 确保有 cardId (如果内容有变动,最好是新建) @@ -977,7 +1003,7 @@ onShareAppMessage(async (options) => { title: "我刚做了一张祝福卡片,送给你", path: "/pages/detail/index?shareToken=" + shareToken, imageUrl: - "https://file.lihailezzc.com/resource/13ec1134e6614feadeeaaa9ef21ea96e.png", + "https://file.lihailezzc.com/resource/b703cf78a970a65490d52213e4d7bf33.png", }; } else { const shareToken = await getShareToken("card_generate_index", ""); @@ -985,7 +1011,7 @@ onShareAppMessage(async (options) => { title: "新春祝福", path: `/pages/index/index?shareToken=${shareToken}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; } }); @@ -1192,6 +1218,7 @@ const saveByCanvas = async (save = true) => { maxWidth: r2p(bubbleMaxWidth.value), // 预览中 bubble-text 的宽度 canvasWidth: W, fontSize: r2p(fontSize.value), + fontWeight: fontWeight.value, lineHeight: r2p(fontSize.value * 1.6), // 预览中是 1.6 padding: r2p(40 + 30), // 内部 padding 40 + 容器 padding 30 backgroundColor: "transparent", @@ -1209,6 +1236,7 @@ const saveByCanvas = async (save = true) => { username: signatureName.value, desc: "送上祝福", textColor: signatureColor.value, + fontWeight: fontWeight.value, avatarSize: r2p(64), padding: r2p(15), fontSizeName: r2p(24), @@ -1280,13 +1308,14 @@ function drawBubbleText(ctx, options) { backgroundColor = "rgba(255,255,255,0.9)", textColor = "#fff", fontSize = 32, + fontWeight = "normal", fontFamily = "PingFang SC", canvasWidth, // 新增:画布宽度,用于居中计算 } = options; if (!text) return; ctx.fillStyle = textColor; - ctx.font = `bold ${fontSize}px '${fontFamily}'`; + ctx.font = `${fontWeight === "bold" ? "bold " : ""}${fontSize}px '${fontFamily}'`; ctx.textAlign = "left"; ctx.textBaseline = "top"; @@ -1348,15 +1377,16 @@ function drawUserBubble(ctx, options) { fontSizeDesc = 20, bubbleColor = "rgba(255,255,255,0.18)", textColor = "#000000", + fontWeight = "normal", } = options; // 设置字体 ctx.textBaseline = "top"; - ctx.font = `${fontSizeName}px 'PingFang SC'`; + ctx.font = `${fontWeight === "bold" ? "bold " : ""}${fontSizeName}px 'PingFang SC'`; // 测量文字宽度 const nameWidth = ctx.measureText(username).width; - ctx.font = `${fontSizeDesc}px 'PingFang SC'`; + ctx.font = `${fontWeight === "bold" ? "bold " : ""}${fontSizeDesc}px 'PingFang SC'`; const descWidth = ctx.measureText(desc).width; // 计算气泡宽度和高度 @@ -1407,11 +1437,11 @@ function drawUserBubble(ctx, options) { const textStartY = drawY + (bubbleHeight - totalTextHeight) / 2; ctx.fillStyle = textColor; - ctx.font = `${fontSizeName}px 'PingFang SC'`; + ctx.font = `${fontWeight === "bold" ? "bold " : ""}${fontSizeName}px 'PingFang SC'`; ctx.fillText(username, textX, textStartY); - ctx.font = `${fontSizeDesc}px 'PingFang SC'`; - ctx.globalAlpha = 0.6; + ctx.font = `${fontWeight === "bold" ? "bold " : ""}${fontSizeDesc}px 'PingFang SC'`; + ctx.globalAlpha = 0.8; ctx.fillText(desc, textX, textStartY + fontSizeName + 4); ctx.globalAlpha = 1; } @@ -1942,6 +1972,30 @@ function drawRoundRect(ctx, x, y, w, h, r, color) { text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2); } +.weight-options { + display: flex; + gap: 20rpx; + flex: 1; +} +.weight-btn { + flex: 1; + height: 70rpx; + background: #f5f5f5; + border-radius: 12rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 26rpx; + color: #333; + border: 2rpx solid transparent; + transition: all 0.2s; +} +.weight-btn.active { + background: #fff5f5; + color: #ff3b30; + border-color: #ff3b30; +} + /* 按钮区 */ .main-actions { display: flex; diff --git a/pages/mine/greeting.vue b/pages/mine/greeting.vue index 365d152..730b4e3 100644 --- a/pages/mine/greeting.vue +++ b/pages/mine/greeting.vue @@ -134,7 +134,7 @@ onShareAppMessage(async (options) => { title: "我刚做了一张祝福卡片,送给你", path: "/pages/detail/index?shareToken=" + shareToken, imageUrl: - "https://file.lihailezzc.com/resource/13ec1134e6614feadeeaaa9ef21ea96e.png", + "https://file.lihailezzc.com/resource/b703cf78a970a65490d52213e4d7bf33.png", }; } else { const shareToken = await getShareToken("greeting_page", ""); @@ -142,7 +142,7 @@ onShareAppMessage(async (options) => { title: "新春祝福", path: `/pages/index/index?shareToken=${shareToken}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; } }); diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 0f3c4e7..13953dd 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -172,7 +172,7 @@ onShareAppMessage(() => { title: "新年好运已送达 🎊|祝福卡·头像·壁纸", path: "/pages/index/index", imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; }); diff --git a/pages/wallpaper/index.vue b/pages/wallpaper/index.vue index f52cd85..bc9cd14 100644 --- a/pages/wallpaper/index.vue +++ b/pages/wallpaper/index.vue @@ -120,7 +120,7 @@ onShareAppMessage(async (options) => { title: "新春祝福", path: `/pages/index/index?shareToken=${shareToken}`, imageUrl: - "https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png", + "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", }; } });