This commit is contained in:
张成
2025-12-03 22:37:45 +08:00
parent 7699facccd
commit 5ab2b2bb98
6 changed files with 58 additions and 8 deletions

View File

@@ -13,7 +13,7 @@
}
.listNavLogo {
width: 60px;
width: 34px;
height: 34px;
}

View File

@@ -283,6 +283,7 @@ const HomeNavbar = (props: IProps) => {
src={img.ICON_LOGO}
className="listNavLogo"
onClick={handleLogoClick}
mode="scaleToFill"
/>
<View className="listNavLine" />
<View className="listNavContent">
@@ -312,7 +313,7 @@ const HomeNavbar = (props: IProps) => {
<View className="navContent">
{/* logo */}
<Image
src={inputLeftIcon || img.ICON_LIST_INPUT_LOGO}
src={inputLeftIcon || img.ICON_LOGO}
className="logo"
onClick={handleInputLeftIconClick}
/>

View File

@@ -39,6 +39,13 @@ const RadarChart: React.FC = forwardRef((props, ref) => {
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--) {
const r = (radius / levels) * 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();
// 标签

View File

@@ -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}`,
};
});

View File

@@ -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; // 时间字符串

View File

@@ -1,3 +1,30 @@
<svg width="58" height="26" viewBox="0 0 58 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.354376 14.418V11.5176C0.354376 4.85547 4.53797 0.583984 11.2352 0.583984C13.8895 0.583984 16.3505 1.28711 18.1434 2.42969C19.9013 3.51953 21.0263 5.01367 21.0263 6.54297C21.0263 8.16016 19.8837 9.28516 18.2489 9.28516C17.5458 9.28516 16.9657 9.07422 16.4559 8.72266C15.0321 7.77344 13.9071 6.38477 11.7802 6.38477C8.7743 6.38477 7.29774 8.21289 7.29774 11.8867V14.4004C7.29774 18.0215 8.7743 19.9375 11.6044 19.9375C13.7138 19.9375 15.1376 18.707 15.1376 16.9316V16.4395H14.0653C12.3251 16.4395 11.3759 15.5957 11.3759 14.0664C11.3759 12.5371 12.3075 11.7461 14.0653 11.7461H17.8798C20.5165 11.7461 21.6591 12.8535 21.6591 15.3672V16.3164C21.6591 21.8887 17.5809 25.5273 11.3055 25.5273C4.41492 25.5273 0.354376 21.3613 0.354376 14.418ZM24.4648 14.4004V11.7988C24.4648 4.78516 28.4902 0.583984 35.4688 0.583984C42.4473 0.583984 46.4551 4.80273 46.4551 11.7988V14.4004C46.4551 21.3613 42.4473 25.5273 35.4688 25.5273C28.4902 25.5273 24.4648 21.3438 24.4648 14.4004ZM31.4082 11.7461V14.3828C31.4082 17.916 32.9023 19.9551 35.4688 19.9551C38.0352 19.9551 39.5117 17.916 39.5117 14.3828V11.7461C39.5117 8.21289 38.0352 6.15625 35.4688 6.15625C32.9023 6.15625 31.4082 8.21289 31.4082 11.7461ZM50.4562 14.9453L49.9464 3.67773C49.8585 1.72656 51.3527 0.126953 53.4796 0.126953C55.6066 0.126953 57.1359 1.72656 57.0304 3.67773L56.4679 14.9453C56.3624 16.6504 55.0792 17.7754 53.462 17.7754C51.8097 17.7754 50.5265 16.5801 50.4562 14.9453ZM49.9816 22.2578C49.9816 20.3418 51.5636 19.1641 53.4972 19.1641C55.4132 19.1641 56.9777 20.3418 56.9777 22.2578C56.9777 24.1914 55.4132 25.3691 53.4972 25.3691C51.5636 25.3691 49.9816 24.1914 49.9816 22.2578Z" fill="black"/>
<svg width="60" height="52" viewBox="0 0 60 52" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="12.7949" y="12.7949" width="34" height="34" rx="17" fill="white"/>
<g filter="url(#filter0_f_4837_38304)">
<circle cx="29.7949" cy="29.7949" r="14" fill="url(#paint0_radial_4837_38304)"/>
</g>
<g filter="url(#filter1_f_4837_38304)">
<circle cx="29.7949" cy="29.7949" r="14" fill="url(#paint1_radial_4837_38304)"/>
</g>
<defs>
<filter id="filter0_f_4837_38304" x="5.14984e-05" y="5.14984e-05" width="59.5897" height="59.5897" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="0.358974" result="effect1_foregroundBlur_4837_38304"/>
</filter>
<filter id="filter1_f_4837_38304" x="9.33338" y="9.33338" width="40.9231" height="40.9231" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="3.23077" result="effect1_foregroundBlur_4837_38304"/>
</filter>
<radialGradient id="paint0_radial_4837_38304" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(35.0898 43.7949) rotate(-124.571) scale(34.0043 41.0908)">
<stop offset="0.201973" stop-color="#00FF95"/>
<stop offset="0.495087" stop-color="#00FF95" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint1_radial_4837_38304" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(43.7949 34.1026) rotate(173.418) scale(28.1858 24.889)">
<stop offset="0.626122" stop-color="#00B7FF" stop-opacity="0"/>
<stop offset="0.759014" stop-color="#00B7FF" stop-opacity="0.680004"/>
<stop offset="0.901989" stop-color="#097EFE"/>
</radialGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB