From 115f270ed1b3ee327d2853a0e82c2ede386c4482 Mon Sep 17 00:00:00 2001 From: kron Date: Mon, 17 Nov 2025 15:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/canvas.js | 10 +++++----- src/pages/first-try.vue | 2 +- src/pages/point-book-detail.vue | 16 +++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index e677b99..407cd81 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -85,7 +85,7 @@ const drawRoundImage = async ( } }; -function drawRingCircle(ctx, x, y, text, diameter = 12) { +function drawRingCircle(ctx, x, y, text, diameter = 9) { const fillColor = "#ff4444"; const borderColor = "#ffffff"; const borderWidth = 1; @@ -114,7 +114,7 @@ function drawRingCircle(ctx, x, y, text, diameter = 12) { ctx.strokeStyle = borderColor; ctx.stroke(); - const fontSize = 9; + const fontSize = 7; ctx.save(); ctx.translate(cx, cy); ctx.textAlign = "center"; @@ -328,7 +328,7 @@ export const generateShareImage = async (canvasId, data) => { renderText(ctx, arrowData.tenRings, 15, "#000", 262, 133); renderText(ctx, "平均环数", 13, "#999", 25, 175); - renderText(ctx, "总换数", 13, "#999", 145, 175); + renderText(ctx, "总环数", 13, "#999", 145, 175); renderText( ctx, Number(arrowData.averageRing.toFixed(2)), @@ -356,8 +356,8 @@ export const generateShareImage = async (canvasId, data) => { arrowData.list .filter((arrow) => arrow?.x && arrow?.y) .forEach((arrow, index) => { - const px = 375 * 0.08 + 375 * 0.84 * arrow.x; - const py = 250 + 375 * 0.84 * arrow.y; + const px = 375 * 0.08 + (375 * 0.84 + 20) * arrow.x; + const py = 250 + (375 * 0.84 + 20) * arrow.y; drawRingCircle(ctx, px, py, index + 1); }); } diff --git a/src/pages/first-try.vue b/src/pages/first-try.vue index 61bc1e5..35a056b 100644 --- a/src/pages/first-try.vue +++ b/src/pages/first-try.vue @@ -212,7 +212,7 @@ const onClose = () => { v-if="step === 0" /> { const goBack = () => { const pages = getCurrentPages(); - if (pages.length > 1) { - const currentPage = pages[pages.length - 2]; - uni.navigateBack({ - delta: currentPage.route === "pages/point-book" ? 1 : 2, - }); - } else { - uni.redirectTo({ - url: "/pages/index", - }); - } + const lastPage = pages[pages.length - 2]; + uni.navigateBack({ + delta: lastPage.route === "pages/point-book-edit" ? 2 : 1, + }); }; const ringRates = computed(() => { @@ -94,7 +88,7 @@ const shareImage = async () => { onLoad(async (options) => { if (options.id) { - const result = await getPointBookDetailAPI(options.id || 243); + const result = await getPointBookDetailAPI(options.id || 247); record.value = result; const arrowData = record.value.groups && record.value.groups[0]