diff --git a/src/components/HomeNavbar/index.scss b/src/components/HomeNavbar/index.scss index fc6f910..2d1ef39 100644 --- a/src/components/HomeNavbar/index.scss +++ b/src/components/HomeNavbar/index.scss @@ -13,7 +13,7 @@ } .listNavLogo { - width: 60px; + width: 34px; height: 34px; } diff --git a/src/components/HomeNavbar/index.tsx b/src/components/HomeNavbar/index.tsx index 314436f..d8569cd 100644 --- a/src/components/HomeNavbar/index.tsx +++ b/src/components/HomeNavbar/index.tsx @@ -283,6 +283,7 @@ const HomeNavbar = (props: IProps) => { src={img.ICON_LOGO} className="listNavLogo" onClick={handleLogoClick} + mode="scaleToFill" /> @@ -312,7 +313,7 @@ const HomeNavbar = (props: IProps) => { {/* logo */} diff --git a/src/components/Radar/index.tsx b/src/components/Radar/index.tsx index 88aa701..4237510 100644 --- a/src/components/Radar/index.tsx +++ b/src/components/Radar/index.tsx @@ -38,6 +38,13 @@ const RadarChart: React.FC = forwardRef((props, ref) => { canvas.width = res[0].width * dpr; canvas.height = res[0].height * dpr; ctx.scale(dpr, dpr); + + // 启用抗锯齿,消除锯齿 + ctx.imageSmoothingEnabled = true; + ctx.imageSmoothingQuality = 'high'; + // 设置线条端点样式为圆形,减少锯齿 + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; // === 绘制圆形网格 === for (let i = levels; i >= 1; i--) { @@ -51,7 +58,19 @@ const RadarChart: React.FC = forwardRef((props, ref) => { ctx.fillStyle = "#CAFCF0"; ctx.fill(); } - ctx.strokeStyle = "#bbb"; + // 根据层级设置不同的线条颜色,中间圆圈使用更浅的颜色 + if (i === 1) { + // 最内圈使用最浅的颜色 + ctx.strokeStyle = "#E5E5E5"; + } else if (i <= 3) { + // 中间圆圈使用较浅的颜色 + ctx.strokeStyle = "#E0E0E0"; + } else { + // 外圈使用稍深但仍然较浅的颜色 + ctx.strokeStyle = "#D5D5D5"; + } + // 设置线条宽度为1px,确保清晰 + ctx.lineWidth = 1; ctx.stroke(); } @@ -65,7 +84,9 @@ const RadarChart: React.FC = forwardRef((props, ref) => { ctx.beginPath(); ctx.moveTo(center.x, center.y); ctx.lineTo(x, y); - ctx.strokeStyle = "#bbb"; + // 坐标轴线条也使用较浅的颜色,与圆圈保持一致 + ctx.strokeStyle = "#E0E0E0"; + ctx.lineWidth = 1; ctx.stroke(); // 标签 diff --git a/src/other_pages/ntrp-evaluate/index.tsx b/src/other_pages/ntrp-evaluate/index.tsx index a445893..97140ec 100644 --- a/src/other_pages/ntrp-evaluate/index.tsx +++ b/src/other_pages/ntrp-evaluate/index.tsx @@ -631,11 +631,10 @@ function Result() { } useShareAppMessage(async (res) => { - // const url = await genCardImage(); console.log(res, "res"); return { title: "来测一测你的NTRP等级吧", - // imageUrl: url, + imageUrl: result?.level_img || undefined, path: `/other_pages/ntrp-evaluate/index?stage=${StageType.INTRO}`, }; }); diff --git a/src/services/evaluateService.ts b/src/services/evaluateService.ts index a3e207d..dab032d 100644 --- a/src/services/evaluateService.ts +++ b/src/services/evaluateService.ts @@ -55,6 +55,7 @@ export interface TestResultData { is_coverage: boolean; old_ntrp_level: string; level_description: string; + level_img?: string; // 等级图片URL radar_data: RadarData; answers: Answer[]; } @@ -81,6 +82,7 @@ interface TestResult { total_score: number; ntrp_level: string; level_description: string; + level_img?: string; // 等级图片URL radar_data: RadarData; test_duration: number; // 单位秒 create_time: string; // 时间字符串 diff --git a/src/static/logo.svg b/src/static/logo.svg index 63be4ce..f6fc4a2 100644 --- a/src/static/logo.svg +++ b/src/static/logo.svg @@ -1,3 +1,30 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +