From f72de38fb7a1d92b87cb143f263944b33b7c2682 Mon Sep 17 00:00:00 2001 From: Jacky Ser Date: Mon, 10 Aug 2026 23:51:42 +0800 Subject: [PATCH] Use rated voltage options in selector --- app/page.tsx | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 8150daf..bf78894 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -160,6 +160,12 @@ const SELECTOR_PRODUCTS = CATALOG_PRODUCTS.filter((product) => }; }); +const RATED_VOLTAGES = [...new Set( + SELECTOR_PRODUCTS + .map((product) => product.ratedVoltage) + .filter((voltage): voltage is number => voltage !== null), +)].sort((a, b) => a - b); + const DEFAULT_REQUIREMENTS: Requirements = { application: "", category: "全部舵机", @@ -183,8 +189,7 @@ function getMatches(requirements: Requirements) { const categoryOk = requirements.category === "全部舵机" || requirements.category === product.category; const torqueOk = product.torque >= requirements.torque; - const voltageOk = - requirements.voltage >= product.voltageMin && requirements.voltage <= product.voltageMax; + const voltageOk = requirements.voltage === product.ratedVoltage; const weightOk = requirements.weightLimit === 0 || product.weight === null || product.weight <= requirements.weightLimit; const gearOk = requirements.gear === "不限" || requirements.gear === product.gear; @@ -211,7 +216,7 @@ function getMatches(requirements: Requirements) { if (voltageOk) { score += 22; - reasons.push(`${requirements.voltage}V供电兼容`); + reasons.push(`${requirements.voltage}V额定电压匹配`); } else { score -= 90; } @@ -413,7 +418,7 @@ export default function Home() {

第二步 · 核心参数

输入舵机的关键技术要求

-

已覆盖243款舵机:0.09–920 kgf·cm、0.8–30V;不确定的项目可选“不限”。

+

已覆盖243款舵机:0.09–920 kgf·cm,并按官方目录额定电压精确筛选。

@@ -650,7 +648,7 @@ export default function Home() {

{top.product.category} · {top.product.size || "尺寸待复核"}

- +