用户工具

站点工具


在线工具:元器件:元器件多站查询

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
在线工具:元器件:元器件多站查询 [2026/10/11 21:58] – ↷ 页面名由在线工具:元器件:元器件datasheet-eda库-购买多站查询改为在线工具:元器件:元器件多站查询 hwwiki在线工具:元器件:元器件多站查询 [2026/10/11 22:03] (当前版本) – hwwiki
行 1: 行 1:
-<html> +<html><style>/* 作用域限定在 .msq 内,避免污染 DokuWiki 主题 */.msq {--primary: #1a6ee0;--primary-dark: #1258b8;--bg: #ffffff;--card: #ffffff;--border: #e2e8f0;--text: #1e293b;--text-2: #64748b;font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC","Microsoft YaHei", sans-serif;background: var(--bg);color: var(--text);display: flex;justify-content: center;padding: 12px 8px;box-sizing: border-box;}.msq * { box-sizing: border-box; margin: 0; padding: 0; }.msq .app { width: fit-content; max-width: 100%; margin: 0 auto; }.msq .logo { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }.msq .logo h1 { font-size: 17px; font-weight: 700; margin: 0; border: none; padding: 0; }.msq .logo .sub { font-size: 12px; color: var(--text-2); font-weight: 400; margin-left: 6px; }/* ===== 顶部标签栏 ===== */.msq .tabs {display: flex;gap: 4px;border-bottom: 1px solid var(--border);margin-bottom: 12px;}.msq .tab {display: inline-flex;align-items: center;gap: 7px;padding: 9px 16px;font-size: 14px;font-weight: 600;color: var(--text-2);background: transparent;border: none;border-bottom: 2px solid transparent;margin-bottom: -1px;cursor: pointer;transition: color .15s, border-color .15s;white-space: nowrap;font-family: inherit;}.msq .tab svg { flex: 0 0 auto; }.msq .tab svg * { stroke: currentColor; }.msq .tab:hover { color: var(--primary); }.msq .tab.active { color: var(--primary); border-bottom-color: var(--primary); }.msq .tab .badge {font-size: 11px;font-weight: 500;padding: 1px 7px;border-radius: 999px;background: var(--border);color: var(--text-2);}.msq .tab.active .badge { background: rgba(26,110,224,.12); color: var(--primary); }.msq .panel { display: none; }.msq .panel.active { display: block; }.msq .card {background: var(--card);border: 1px solid var(--border);border-radius: 10px;padding: 16px;box-shadow: 0 1px 3px rgba(0,0,0,.05);margin-bottom: 12px;}.msq .row { display: flex; gap: 10px; flex-wrap: wrap; }.msq .field { flex: 1 1 0; min-width: 0; }.msq .field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }.msq input[type="text"] {width: 100%;padding: 9px 11px;border: 1px solid var(--border);border-radius: 8px;font-size: 14px;outline: none;transition: border-color .15s, box-shadow .15s;background: #fff;color: var(--text);font-family: inherit;}.msq input[type="text"]:focus {border-color: var(--primary);box-shadow: 0 0 0 3px rgba(26,110,224,.12);}.msq .btn {padding: 9px 22px;background: var(--primary);color: #fff;border: none;border-radius: 8px;font-size: 14px;font-weight: 600;cursor: pointer;align-self: flex-end;transition: background .15s;font-family: inherit;}.msq .btn:hover { background: var(--primary-dark); }.msq .xsearch .xs-title { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }.msq .xsearch .xs-title b { color: var(--text); }.msq .xsearch .xs-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }.msq .xs-btn {font-size: 12px; padding: 4px 12px; border-radius: 6px;border: 1px solid var(--primary); background: #fff; color: var(--primary);cursor: pointer; transition: all .15s; font-family: inherit;}.msq .xs-btn:hover { background: var(--primary); color: #fff; }.msq .xs-btn.ghost { border-color: var(--border); color: var(--text-2); }.msq .xs-btn.ghost:hover { border-color: var(--text-2); background: var(--border); color: var(--text); }.msq .xs-count { font-size: 11px; color: var(--text-2); }.msq .xsearch .xs-hint { font-size: 11px; color: #b45309; margin-top: 6px; display: none; max-width: 460px; line-height: 1.5; }.msq .xsearch .xs-hint.show { display: block; }.msq .xsearch .xs-group { font-size: 11px; color: var(--text-2); margin: 10px 0 6px; }.msq .xsearch .xs-group:first-of-type { margin-top: 4px; }/* 统一网格布局:5 列,窄屏 2 列 */.msq .chips {display: grid;grid-template-columns: repeat(5, minmax(0, 1fr));gap: 6px;width: 660px;max-width: 100%;}@media (max-width: 680px) {.msq .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); width: auto; }}.msq .chip {font-size: 12px;padding: 5px 13px;border-radius: 999px;border: 1px solid var(--border);color: var(--text);background: #fff;transition: border-color .15s;display: inline-flex;align-items: center;justify-content: center;gap: 6px;white-space: nowrap;overflow: hidden;}.msq .chip a { color: inherit; text-decoration: none; }.msq .chip a:hover { color: var(--primary); }.msq .chip:hover { border-color: var(--primary); }.msq .chip input[type="checkbox"] { margin: 0; accent-color: var(--primary); cursor: pointer; }.msq .chip.off { opacity: .55; }.msq .chip.off a { color: var(--text-2); }</style><div class="msq" id="msq-root"><div class="app"><div class="logo"><svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M4 7h16M4 12h16M4 17h10" stroke="#1a6ee0" stroke-width="1.8" stroke-linecap="round"/></svg><h1>元器件多站查询<span class="sub">Datasheet / EDA库 / 购买 一键多站检索</span></h1></div><div class="tabs" role="tablist"><button class="tab active" id="msq-tab-ds" role="tab" aria-selected="true"><svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M6 2h9l5 5v15H6z" stroke-width="1.8" stroke-linejoin="round"/><path d="M15 2v5h5" stroke-width="1.8" stroke-linejoin="round"/><path d="M9 12h6M9 15.5h6M9 19h3" stroke-width="1.6" stroke-linecap="round"/></svg>Datasheet 查询<span class="badge" id="msq-badge-ds">18 站</span></button><button class="tab" id="msq-tab-eda" role="tab" aria-selected="false"><svg width="15" height="15" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="7" height="7" rx="1.2" stroke-width="1.8"/><rect x="14" y="3" width="7" height="7" rx="1.2" stroke-width="1.8"/><rect x="3" y="14" width="7" height="7" rx="1.2" stroke-width="1.8"/><path d="M17.5 14v7M14 17.5h7" stroke-width="1.8" stroke-linecap="round"/></svg>EDA 库查询<span class="badge" id="msq-badge-eda">8 站</span></button><button class="tab" id="msq-tab-buy" role="tab" aria-selected="false"><svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M3 4h2l2.4 12.2a1.5 1.5 0 0 0 1.5 1.2H18a1.5 1.5 0 0 0 1.5-1.2L21 8H6"stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9.5" cy="20" r="1.4" stroke-width="1.6"/><circle cx="17.5" cy="20" r="1.4" stroke-width="1.6"/></svg>购买查询<span class="badge" id="msq-badge-buy">26 站</span></button></div><div class="panel active" id="msq-panel-ds" role="tabpanel"><div class="card"><div class="row"><div class="field"><label for="msq-ds-m">厂商(可选)</label><input type="text" id="msq-ds-m" placeholder="如 ST、TI、Murata" autocomplete="off"></div><div class="field"><label for="msq-ds-p">型号 *</label><input type="text" id="msq-ds-p" placeholder="如 STM32F103C8T6" autocomplete="off"></div><button class="btn" id="msq-ds-go">搜索</button></div></div><div id="msq-ds-results"></div></div><div class="panel" id="msq-panel-eda" role="tabpanel"><div class="card"><div class="row"><div class="field"><label for="msq-eda-p">型号 / 关键字 *</label><input type="text" id="msq-eda-p" placeholder="如 STM32F103C8T6、0603、AMS1117" autocomplete="off"></div><button class="btn" id="msq-eda-go">搜索</button></div></div><div id="msq-eda-results"></div></div><div class="panel" id="msq-panel-buy" role="tabpanel"><div class="card"><div class="row"><div class="field"><label for="msq-buy-p">型号 / 关键字 *</label><input type="text" id="msq-buy-p" placeholder="如 STM32F103C8T6、0603、AMS1117" autocomplete="off"></div><button class="btn" id="msq-buy-go">搜索</button></div></div><div id="msq-buy-results"></div></div></div></div><script>(function () { 
-<style> +if (window.__multiSearchWidgetLoaded) return; 
-:root { +window.__multiSearchWidgetLoaded = true;
---primary: #1a6ee0; +
---primary-dark: #1258b8; +
---bg: #ffffff; +
---card: #ffffff; +
---border: #e2e8f0; +
---text: #1e293b; +
---text-2: #64748b; +
-} +
-* { box-sizing: border-box; margin: 0; padding: 0; } +
-.datasheet-widget { +
-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", +
-"Microsoft YaHei", sans-serif; +
-background: var(--bg); +
-color: var(--text); +
-min-height: 100vh; +
-display: flex; +
-justify-content: center; +
-padding: 12px 8px; +
-} +
-.app { width: fit-content; max-width: 100%; margin: 0 auto; } +
-.logo { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; } +
-.logo h1 { font-size: 17px; font-weight: 700; } +
-.logo .sub { font-size: 12px; color: var(--text-2); font-weight: 400; margin-left: 6px; } +
-.card { +
-background: var(--card); +
-border: 1px solid var(--border); +
-border-radius: 10px; +
-padding: 16px; +
-box-shadow: 0 1px 3px rgba(0,0,0,.05); +
-margin-bottom: 12px; +
-} +
-.row { display: flex; gap: 10px; flex-wrap: wrap; } +
-.field { flex: 1 1 0; min-width: 0; } +
-.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; } +
-input[type="text"] { +
-width: 100%; +
-padding: 9px 11px; +
-border: 1px solid var(--border); +
-border-radius: 8px; +
-font-size: 14px; +
-outline: none; +
-transition: border-color .15s, box-shadow .15s; +
-background: #fff; +
-} +
-input[type="text"]:focus { +
-border-color: var(--primary); +
-box-shadow: 0 0 0 3px rgba(26,110,224,.12); +
-} +
-.btn { +
-padding: 9px 22px; +
-background: var(--primary); +
-color: #fff; +
-border: none; +
-border-radius: 8px; +
-font-size: 14px; +
-font-weight: 600; +
-cursor: pointer; +
-align-self: flex-end; +
-transition: background .15s; +
-} +
-.btn:hover { background: var(--primary-dark); } +
-.placeholder { text-align: center; color: var(--text-2); font-size: 13px; padding: 24px 0; } +
-.xsearch .xs-title { font-size: 12px; color: var(--text-2); margin-bottom: 8px; } +
-.xsearch .xs-title b { color: var(--text); } +
-.xsearch .xs-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } +
-.xs-btn { +
-font-size: 12px; padding: 4px 12px; border-radius: 6px; +
-border: 1px solid var(--primary); background: #fff; color: var(--primary); +
-cursor: pointer; transition: all .15s; +
-} +
-.xs-btn:hover { background: var(--primary); color: #fff; } +
-.xs-btn.ghost { border-color: var(--border); color: var(--text-2); } +
-.xs-btn.ghost:hover { border-color: var(--text-2); background: var(--border); color: var(--text); } +
-.xs-count { font-size: 11px; color: var(--text-2); } +
-.xsearch .xs-hint { font-size: 11px; color: #b45309; margin-top: 6px; display: none; max-width: 460px; line-height: 1.5; } +
-.xsearch .xs-hint.show { display: block; } +
-.xsearch .xs-group { font-size: 11px; color: var(--text-2); margin: 10px 0 6px; } +
-.xsearch .xs-group:first-of-type { margin-top: 4px; } +
-.chips { display: flex; flex-wrap: wrap; gap: 6px; } +
-.chip { +
-font-size: 12px; +
-padding: 5px 13px; +
-border-radius: 999px; +
-border: 1px solid var(--border); +
-color: var(--text); +
-background: #fff; +
-transition: border-color .15s; +
-display: inline-flex; +
-align-items: center; +
-gap: 6px; +
-} +
-.chip a { color: inherit; text-decoration: none; } +
-.chip a:hover { color: var(--primary); } +
-.chip:hover { border-color: var(--primary); } +
-.chip input[type="checkbox"] { margin: 0; accent-color: var(--primary); cursor: pointer; } +
-.chip.off { opacity: .55; } +
-.chip.off a { color: var(--text-2); } +
-</style> +
-<div class="datasheet-widget"> +
-<div class="app"> +
-<div class="logo"> +
-<svg width="22" height="22" viewBox="0 0 24 24" fill="none"> +
-<path d="M6 2h9l5 5v15H6z" stroke="#1a6ee0" stroke-width="1.8" stroke-linejoin="round"/> +
-<path d="M15 2v5h5" stroke="#1a6ee0" stroke-width="1.8" stroke-linejoin="round"/> +
-<path d="M9 12h6M9 15.5h6M9 19h3" stroke="#1a6ee0" stroke-width="1.6" stroke-linecap="round"/> +
-</svg> +
-<h1>Datasheet 多站查询<span class="sub">商城 / 专业站 / 搜索引擎</span></h1> +
-</div> +
-<div class="card"> +
-<div class="row"> +
-<div class="field"> +
-<label for="m">厂商(可选)</label> +
-<input type="text" id="m" placeholder="如 ST、TI、Murata" autocomplete="off"> +
-</div> +
-<div class="field"> +
-<label for="p">型号 *</label> +
-<input type="text" id="p" placeholder="如 STM32F103C8T6" autocomplete="off"> +
-</div> +
-<button class="btn" id="go">搜索</button> +
-</div> +
-</div> +
-<div id="results"></div> +
-</div> +
-<script> +
-(function () { +
-// 哨兵:脚本只初始化一次(DokuWiki 等环境可能把内容渲染两份导致脚本执行两次) +
-if (window.__datasheetWidgetLoaded) return; +
-window.__datasheetWidgetLoaded = true;+
 var $ = function (id) { return document.getElementById(id); }; var $ = function (id) { return document.getElementById(id); };
 var params = new URLSearchParams(location.search); var params = new URLSearchParams(location.search);
-var mEl = $("m"), pEl = $("p"), goEl = $("go"); 
-var resultsEl = $("results"); 
-if (params.get("m")) mEl.value = params.get("m"); 
-if (params.get("p")) pEl.value = params.get("p"); 
 function qs(s) { return encodeURIComponent(s); } function qs(s) { return encodeURIComponent(s); }
-// ===== 站点列表(URL 模板均已实测验证)===== +// 每类站点的勾选状态(各面板独立) 
-// 默认勾选仅 def:true 的站点;引擎类查询词:厂商 + 型号 + pdf +var SAVED = { ds: null, eda: null, buy: null }; 
-function engineQ(m, p) { return (m ? m + " " : "") + p + " pdf"; } +// ========================================================= 
-var SITES = [ +// 通用面板构建 
-// ---- 商城 ---- +// ========================================================= 
-{ g: "商城", name: "立创商城", def: true, home: "https://www.szlcsc.com/", +function buildSearch(cfg) { 
-u: function (m, p) { return "https://so.szlcsc.com/global.html?k=" + qs(p); } }, +var p = cfg.getP().trim(); 
-{ g: "商城", name: "得捷 DigiKey", home: "https://www.digikey.cn/", +var m = cfg.getM ? cfg.getM().trim() : "";
-u: function (m, p) { return "https://www.digikey.cn/zh/products/result?keywords=" + qs(p); } }, +
-{ g: "商城", name: "Mouser", home: "https://www.mouser.cn/", +
-u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } }, +
-{ g: "商城", name: "element14", home: "https://cn.element14.com/", +
-u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p); } }, +
-{ g: "商城", name: "华秋", home: "https://www.hqchip.com/", +
-u: function (m, p) { return "https://www.hqchip.com/search?keyword=" + qs(p); } }, +
-// ---- 专业查询网站 ---- +
-{ g: "专业查询网站", name: "半导小芯", def: true, home: "https://www.semiee.com/", +
-u: function (m, p) { return "https://www.semiee.com/search?searchModel=" + qs(p); } }, +
-{ g: "专业查询网站", name: "AllDatasheet", home: "https://www.alldatasheet.com/", +
-u: function (m, p) { return "https://www.alldatasheet.com/view.jsp?Searchword=" + qs(p); } }, +
-{ g: "专业查询网站", name: "Octopart", home: "https://octopart.com/", +
-u: function (m, p) { return "https://octopart.com/zh/search?currency=CNY&specs=0&full_query=" + qs(p) + "+&q=" + qs(p) + "&nq=" + qs(p) + "&s=1&query_type=MPN"; } }, +
-{ g: "专业查询网站", name: "芯查查", home: "https://www.xcc.com/", +
-u: function (m, p) { return "https://www.xcc.com/chip/material/search?title=" + qs(p); } }, +
-{ g: "专业查询网站", name: "icspec", home: "https://www.icspec.com/", +
-u: function (m, p) { return "https://www.icspec.com/search/" + qs(p); } }, +
-{ g: "专业查询网站", name: "SamacSys", def: true, home: "https://www.componentsearchengine.com/", +
-u: function (m, p) { return "https://www.componentsearchengine.com/search?term=" + qs(p); } }, +
-// ---- 搜索引擎 ---- +
-{ g: "搜索引擎", name: "必应搜索", def: true, home: "https://cn.bing.com/", +
-u: function (m, p) { return "https://cn.bing.com/search?q=" + qs(engineQ(m, p)); } }, +
-{ g: "搜索引擎", name: "百度搜索", home: "https://www.baidu.com/", +
-u: function (m, p) { return "https://www.baidu.com/s?wd=" + qs(engineQ(m, p)); } }, +
-{ g: "搜索引擎", name: "Google 搜索", home: "https://www.google.com/", +
-u: function (m, p) { return "https://www.google.com/search?q=" + qs(engineQ(m, p)); } }, +
-// ---- 其他 ---- +
-{ g: "其他", name: "datasheets.com", home: "https://www.datasheets.com/", +
-u: function (m, p) { return "https://www.datasheets.com/search?q=" + qs(p); } }, +
-{ g: "其他", name: "DatasheetArchive", home: "https://www.datasheetarchive.com/", +
-u: function (m, p) { return "https://www.datasheetarchive.com/?q=" + qs(p); } }, +
-{ g: "其他", name: "datasheets360", home: "https://www.datasheets360.com/", +
-u: function (m, p) { return "https://www.datasheets360.com/search/results?query=" + qs(p); } }, +
-{ g: "其他", name: "Datasheet4U", home: "https://datasheet4u.com/", +
-u: function (m, p) { return "https://datasheet4u.com/share_search.php?sWord=" + qs(p); } } +
-]; +
-function buildPanel() { +
-var m = mEl.value.trim(), p = pEl.value.trim();+
 var card = document.createElement("div"); var card = document.createElement("div");
 card.className = "card xsearch"; card.className = "card xsearch";
 +// 标题
 var title = document.createElement("div"); var title = document.createElement("div");
 title.className = "xs-title"; title.className = "xs-title";
 if (p) { if (p) {
 var b = document.createElement("b"); var b = document.createElement("b");
-b.textContent = (m ? m + " " : "") + p;+b.textContent = cfg.label(m, p);
 title.appendChild(document.createTextNode("已生成 ")); title.appendChild(document.createTextNode("已生成 "));
 title.appendChild(b); title.appendChild(b);
-title.appendChild(document.createTextNode(" 的查询链接,勾选后一键打开:"));+title.appendChild(document.createTextNode(" 的" + cfg.kind + "查询链接,勾选后一键打开:"));
 } else { } else {
-title.appendChild(document.createTextNode("勾选站点,输入型号后点击「搜索」一键打开所选网站:"));+title.appendChild(document.createTextNode(cfg.emptyTip));
 } }
 card.appendChild(title); card.appendChild(title);
-// 工具栏:全选开关 + 已选计数+// 工具栏
 var toolbar = document.createElement("div"); var toolbar = document.createElement("div");
 toolbar.className = "xs-toolbar"; toolbar.className = "xs-toolbar";
行 211: 行 41:
 var hint = document.createElement("div"); var hint = document.createElement("div");
 hint.className = "xs-hint"; hint.className = "xs-hint";
 +if (!SAVED[cfg.key]) SAVED[cfg.key] = cfg.sites.map(function (s) { return s.def === true; });
 +var savedChecks = SAVED[cfg.key];
 var boxes = []; var boxes = [];
-var lastGroup = null, chips = null, groupCount = 0; +var lastGroup = null, chips = null; 
-SITES.forEach(function (s, idx) {+cfg.sites.forEach(function (s, idx) {
 if (s.g !== lastGroup) { if (s.g !== lastGroup) {
 lastGroup = s.g; lastGroup = s.g;
行 223: 行 55:
 chips.className = "chips"; chips.className = "chips";
 card.appendChild(chips); card.appendChild(chips);
-groupCount = 0; 
 } }
 var span = document.createElement("span"); var span = document.createElement("span");
行 233: 行 64:
 var a = document.createElement("a"); var a = document.createElement("a");
 a.textContent = s.name; a.textContent = s.name;
-// 有型号 → 搜索页;无型号 → 站点首页 
 a.href = p ? s.u(m, p) : (s.home || ""); a.href = p ? s.u(m, p) : (s.home || "");
 a.target = "_blank"; a.target = "_blank";
行 241: 行 71:
 boxes.push(cb); boxes.push(cb);
 chips.appendChild(span); chips.appendChild(span);
-// 每行固定 5 个站点:组内每满 5 个插入强制换行 spacer 
-groupCount++; 
-if (groupCount % 5 === 0) { 
-var br = document.createElement("div"); 
-br.style.cssText = "flex-basis:100%;height:0"; 
-chips.appendChild(br); 
-} 
 }); });
 card.appendChild(hint); card.appendChild(hint);
行 262: 行 85:
 updateCount(); updateCount();
 }); });
-// 打开逻辑暴露给「搜索」按钮(点击即打开所选网站) +updateCount(); 
-currentOpen = function () {+// 打开所选站点 
 +cfg.open = function () {
 hint.className = "xs-hint"; hint.className = "xs-hint";
-if (!pEl.value.trim()) {+if (!cfg.getP().trim()) {
 hint.textContent = "请先输入型号,再搜索。"; hint.textContent = "请先输入型号,再搜索。";
 hint.className = "xs-hint show"; hint.className = "xs-hint show";
-pEl.focus();+cfg.getPEl().focus();
 return; return;
 } }
行 286: 行 110:
 } }
 }; };
-updateCount(); 
 return card; return card;
 } }
-// 勾选状态跨刷新保留(仅 def:true 的站点默认勾选) +// ========================================================= 
-var savedChecks = SITES.map(function (s) { return s.def === true; }); +// 站点列表 
-var currentOpen = null;+// ========================================================= 
 +function engineQ(m, p) { return (m ? m + " " : "") + p + " pdf"; } 
 +var DS_SITES = [ 
 +// ---- 商城 ---- 
 +{ g: "商城", name: "立创商城", def: true, home: "https://www.szlcsc.com/", 
 +u: function (m, p) { return "https://so.szlcsc.com/global.html?k=" + qs(p); } }, 
 +{ g: "商城", name: "得捷 DigiKey", home: "https://www.digikey.cn/", 
 +u: function (m, p) { return "https://www.digikey.cn/zh/products/result?keywords=" + qs(p); } }, 
 +{ g: "商城", name: "Mouser", home: "https://www.mouser.cn/", 
 +u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } }, 
 +{ g: "商城", name: "element14", home: "https://cn.element14.com/", 
 +u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p); } }, 
 +{ g: "商城", name: "华秋", home: "https://www.hqchip.com/", 
 +u: function (m, p) { return "https://www.hqchip.com/search?keyword=" + qs(p); } }, 
 +// ---- 专业查询网站 ---- 
 +{ g: "专业查询网站", name: "半导小芯", def: true, home: "https://www.semiee.com/", 
 +u: function (m, p) { return "https://www.semiee.com/search?searchModel=" + qs(p); } }, 
 +{ g: "专业查询网站", name: "AllDatasheet", home: "https://www.alldatasheet.com/", 
 +u: function (m, p) { return "https://www.alldatasheet.com/view.jsp?Searchword=" + qs(p); } }, 
 +{ g: "专业查询网站", name: "Octopart", home: "https://octopart.com/", 
 +u: function (m, p) { return "https://octopart.com/zh/search?currency=CNY&specs=0&full_query=" + qs(p) + "+&q=" + qs(p) + "&nq=" + qs(p) + "&s=1&query_type=MPN"; } }, 
 +{ g: "专业查询网站", name: "芯查查", home: "https://www.xcc.com/", 
 +u: function (m, p) { return "https://www.xcc.com/chip/material/search?title=" + qs(p); } }, 
 +{ g: "专业查询网站", name: "icspec", home: "https://www.icspec.com/", 
 +u: function (m, p) { return "https://www.icspec.com/search/" + qs(p); } }, 
 +{ g: "专业查询网站", name: "SamacSys", def: true, home: "https://www.componentsearchengine.com/", 
 +u: function (m, p) { return "https://www.componentsearchengine.com/search?term=" + qs(p); } }, 
 +// ---- 搜索引擎 ---- 
 +{ g: "搜索引擎", name: "必应搜索", def: true, home: "https://cn.bing.com/", 
 +u: function (m, p) { return "https://cn.bing.com/search?q=" + qs(engineQ(m, p)); } }, 
 +{ g: "搜索引擎", name: "百度搜索", home: "https://www.baidu.com/", 
 +u: function (m, p) { return "https://www.baidu.com/s?wd=" + qs(engineQ(m, p)); } }, 
 +{ g: "搜索引擎", name: "Google 搜索", home: "https://www.google.com/", 
 +u: function (m, p) { return "https://www.google.com/search?q=" + qs(engineQ(m, p)); } }, 
 +// ---- 其他 ---- 
 +{ g: "其他", name: "datasheets.com", home: "https://www.datasheets.com/", 
 +u: function (m, p) { return "https://www.datasheets.com/search?q=" + qs(p); } }, 
 +{ g: "其他", name: "DatasheetArchive", home: "https://www.datasheetarchive.com/", 
 +u: function (m, p) { return "https://www.datasheetarchive.com/?q=" + qs(p); } }, 
 +{ g: "其他", name: "datasheets360", home: "https://www.datasheets360.com/", 
 +u: function (m, p) { return "https://www.datasheets360.com/search/results?query=" + qs(p); } }, 
 +{ g: "其他", name: "Datasheet4U", home: "https://datasheet4u.com/", 
 +u: function (m, p) { return "https://datasheet4u.com/share_search.php?sWord=" + qs(p); } } 
 +]; 
 +// 来源:hwwiki《如何查找元器件EDA库》附件 edasearch.zip / EDASearch.bat 
 +var EDA_SITES = [ 
 +// ---- 网上商城 ---- 
 +{ g: "网上商城", name: "得捷 DigiKey", def: true, home: "https://www.digikey.cn/", 
 +u: function (m, p) { return "https://www.digikey.cn/zh/products/result?KeyWords=" + qs(p) + "&WT.z_header=search_go"; } }, 
 +{ g: "网上商城", name: "ARROW", home: "https://www.arrow.com/zh-cn", 
 +u: function (m, p) { return "https://www.arrow.com/zh/search-result.html?keyword=" + qs(p) + "&currPage=1"; } }, 
 +{ g: "网上商城", name: "贸泽 Mouser", home: "https://www.mouser.cn/", 
 +u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } }, 
 +{ g: "网上商城", name: "element14", home: "https://cn.element14.com/", 
 +u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p) + "&gs=true"; } }, 
 +// ---- 专门的库网站 ---- 
 +{ g: "专门的库网站", name: "samacsys", def: true, home: "https://componentsearchengine.com/", 
 +u: function (m, p) { return "https://componentsearchengine.com/search?term=" + qs(p); } }, 
 +{ g: "专门的库网站", name: "Ultra Librarian", home: "https://www.ultralibrarian.com/", 
 +u: function (m, p) { return "https://app.ultralibrarian.com/search?queryText=" + qs(p); } }, 
 +{ g: "专门的库网站", name: "SnapMagic", home: "https://www.snapeda.com/", 
 +u: function (m, p) { return "https://www.snapeda.com/search/?q=" + qs(p); } }, 
 +{ g: "专门的库网站", name: "国创基础资源库", def: true, home: "https://www.bocangku.cn/", 
 +u: function (m, p) { return "https://www.bocangku.cn/component/search?keyWords=" + qs(p) + "&"; } } 
 +]; 
 +var BUY_SITES = [ 
 +// ---- 国内商城 ---- 
 +{ g: "国内商城", name: "立创商城", def: true, home: "https://www.szlcsc.com/", 
 +u: function (m, p) { return "https://so.szlcsc.com/global.html?k=" + qs(p); } }, 
 +{ g: "国内商城", name: "华秋商城", home: "https://www.hqchip.com/", 
 +u: function (m, p) { return "https://www.hqchip.com/search?keyword=" + qs(p); } }, 
 +{ g: "国内商城", name: "云汉芯城", home: "https://www.ickey.cn/", 
 +u: function (m, p) { return "https://search.ickey.cn/?keyword=" + qs(p); } }, 
 +{ g: "国内商城", name: "唯样科技", home: "https://www.oneyac.com/", 
 +u: function (m, p) { return "https://www.oneyac.com/search.html?keyword=" + qs(p); } }, 
 +{ g: "国内商城", name: "大联芯城", home: "https://www.dlchip.net/", 
 +u: function (m, p) { return "https://www.dlchip.net/so/" + qs(p); } }, 
 +{ g: "国内商城", name: "iCEasy商城", home: "https://www.iceasy.com/", 
 +u: function (m, p) { return "https://www.iceasy.com/search?keyword=" + qs(p); } }, 
 +{ g: "国内商城", name: "力源芯城", home: "https://www.icbase.com/", 
 +u: function (m, p) { return "https://www.icbase.com/ProResult.aspx?w=" + qs(p); } }, 
 +{ g: "国内商城", name: "芯智云城", home: "https://www.superic.com/", 
 +u: function (m, p) { return "https://www.superic.com/so/?keyword=" + qs(p); } }, 
 +{ g: "国内商城", name: "芯片超人", home: "https://www.icsuperman.com/", 
 +u: function (m, p) { return "https://dl.icsuperman.com/?key=" + qs(p); } }, 
 +{ g: "国内商城", name: "硬之城", home: "https://www.yzcx.com/", 
 +u: function (m, p) { return "https://www.yzcx.com/search?key=" + qs(p) + "&sp=2"; } }, 
 +{ g: "国内商城", name: "猎芯网", home: "https://www.ichunt.com/", 
 +u: function (m, p) { return "https://www.ichunt.com/s/?k=" + qs(p); } }, 
 +{ g: "国内商城", name: "淘宝", home: "https://www.taobao.com/", 
 +u: function (m, p) { return "https://s.taobao.com/search?q=" + qs(p); } }, 
 +{ g: "国内商城", name: "1688", home: "https://www.1688.com/", 
 +u: function (m, p) { return "https://s.1688.com/selloffer/offer_search.htm?keywords=" + qs(p); } }, 
 +// ---- 国外商城 ---- 
 +{ g: "国外商城", name: "得捷 DigiKey", def: true, home: "https://www.digikey.cn/", 
 +u: function (m, p) { return "https://www.digikey.cn/zh/products/result?keywords=" + qs(p); } }, 
 +{ g: "国外商城", name: "贸泽 Mouser", home: "https://www.mouser.cn/", 
 +u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } }, 
 +{ g: "国外商城", name: "ARROW", home: "https://www.arrow.com/zh-cn", 
 +u: function (m, p) { return "https://www.arrow.com/zh-cn/products/search?q=" + qs(p) + "&r=true"; } }, 
 +{ g: "国外商城", name: "element14", home: "https://cn.element14.com/", 
 +u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p); } }, 
 +{ g: "国外商城", name: "LCSC 全球站", home: "https://www.lcsc.com/", 
 +u: function (m, p) { return "https://www.lcsc.com/search?q=" + qs(p); } }, 
 +{ g: "国外商城", name: "Avnet 安富利", home: "https://www.avnet.com/", 
 +u: function (m, p) { return "https://www.avnet.com/apac/products/c/search?search=" + qs(p) + "&page=1&limit=20&orderby=&orderbydirection=asc"; } }, 
 +{ g: "国外商城", name: "RS 欧时", home: "https://www.rsonline.cn/", 
 +u: function (m, p) { return "https://www.rsonline.cn/web/c/?searchTerm=" + qs(p); } }, 
 +{ g: "国外商城", name: "Rochester 罗彻斯特", home: "https://www.rocelec.cn/", 
 +u: function (m, p) { return "https://www.rocelec.cn/search?searchType=part&q=" + qs(p); } }, 
 +// ---- 聚合比价 ---- 
 +{ g: "聚合比价", name: "Octopart", def: true, home: "https://octopart.com/", 
 +u: function (m, p) { return "https://octopart.com/zh/search?currency=CNY&specs=0&full_query=" + qs(p) + "+&q=" + qs(p) + "&nq=" + qs(p) + "&s=1&query_type=MPN"; } }, 
 +{ g: "聚合比价", name: "Findchips", home: "https://www.findchips.com/", 
 +u: function (m, p) { return "https://www.findchips.com/search/" + qs(p); } }, 
 +{ g: "聚合比价", name: "芯查查", home: "https://www.xcc.com/", 
 +u: function (m, p) { return "https://www.xcc.com/chip/material/search?title=" + qs(p); } } 
 +]; 
 +// ========================================================= 
 +// 三个面板实例 
 +// ========================================================= 
 +function makeWidget(o) { 
 +var el = { 
 +pEl: $("msq-" + o.id + "-p"), 
 +goEl: $("msq-" + o.id + "-go"), 
 +resultsEl: $("msq-" + o.id + "-results"), 
 +mEl: o.hasM ? $("msq-" + o.id + "-m") : null 
 +}; 
 +if (el.mEl && params.get("m")) el.mEl.value = params.get("m"); 
 +if (params.get("p")) el.pEl.value = params.get("p"); 
 +var cfg = { 
 +key: o.key, 
 +sites: o.sites, 
 +kind: o.kind, 
 +emptyTip: o.emptyTip, 
 +getPEl: function () { return el.pEl; }, 
 +getP: function () { return el.pEl.value; }, 
 +getM: el.mEl ? function () { return el.mEl.value; } : null, 
 +label: function (m, p) { return el.mEl ? ((m ? m + " " : "") + p) : p; }, 
 +open: null 
 +};
 function render() { function render() {
-resultsEl.innerHTML = ""; +el.resultsEl.innerHTML = ""; 
-resultsEl.appendChild(buildPanel());+el.resultsEl.appendChild(buildSearch(cfg));
 } }
-// 输入实时刷新链接(保留勾选状态) +var timer = null; 
-var t = null; +var inputs = el.mEl ? [el.mEl, el.pEl] : [el.pEl]; 
-[mEl, pEl].forEach(function (el) { +inputs.forEach(function (i) { 
-el.addEventListener("input", function () { +i.addEventListener("input", function () { 
-if (t) clearTimeout(t); +if (timer) clearTimeout(timer); 
-t = setTimeout(render, 250);+timer = setTimeout(render, 250);
 }); });
 }); });
-// 「搜索」= 打开所选的全部网站(点击即开,无需先生成) 
-// opening 防重入:同一时刻只允许一轮打开(防事件重复绑定导致每站开两次) 
 var opening = false; var opening = false;
 function search() { function search() {
行 311: 行 272:
 opening = true; opening = true;
 setTimeout(function () { opening = false; }, 500); setTimeout(function () { opening = false; }, 500);
-if (t) { clearTimeout(t); t = null; }+if (timer) { clearTimeout(timer); timer = null; }
 render(); render();
-if (currentOpen) currentOpen();+if (cfg.open) cfg.open();
 } }
-goEl.addEventListener("click", search); +el.goEl.addEventListener("click", search); 
-[mEl, pEl].forEach(function (el) { +inputs.forEach(function (i) { 
-el.addEventListener("keydown", function (ev) { +i.addEventListener("keydown", function (ev) { if (ev.key === "Enter") search(); });
-if (ev.key === "Enter") search();+
 }); });
-}); 
-// 面板初始即显示(无论是否带 URL 参数) 
 render(); render();
-})(); +return el; 
-</script> +} 
-</div> +var dsEl = makeWidget({ 
-</html> +id: "ds", key: "ds", sites: DS_SITES, hasM: true, kind: "Datasheet", 
 +emptyTip: "勾选站点,输入型号后点击「搜索」一键打开所选网站:" 
 +}); 
 +var edaEl = makeWidget({ 
 +id: "eda", key: "eda", sites: EDA_SITES, hasM: false, kind: "EDA 库", 
 +emptyTip: "勾选站点,输入型号后点击「搜索」一键打开所选商城 / 库网站:" 
 +}); 
 +var buyEl = makeWidget({ 
 +id: "buy", key: "buy", sites: BUY_SITES, hasM: false, kind: "购买", 
 +emptyTip: "勾选站点,输入型号后点击「搜索」一键打开所选商城:" 
 +}); 
 +// ========================================================= 
 +// 标签切换 
 +// DokuWiki 嵌入场景下不改动 location.hash(避免跳转/重载) 
 +// ========================================================= 
 +var KEYS = ["ds", "eda", "buy"]; 
 +var tabs = {}, panels = {}, focusEls = { ds: dsEl.pEl, eda: edaEl.pEl, buy: buyEl.pEl }; 
 +KEYS.forEach(function (k) { 
 +tabs[k] = $("msq-tab-" + k); 
 +panels[k] = $("msq-panel-" + k); 
 +tabs[k].addEventListener("click", function () { activate(k); }); 
 +}); 
 +function activate(key, focusInput) { 
 +if (KEYS.indexOf(key) < 0) key = "ds"; 
 +KEYS.forEach(function (k) { 
 +var on = k === key; 
 +tabs[k].classList.toggle("active", on); 
 +panels[k].classList.toggle("active", on); 
 +tabs[k].setAttribute("aria-selected", on ? "true" : "false"); 
 +}); 
 +if (focusInput) focusEls[key].focus(); 
 +} 
 +// 初始标签:?tab=eda|buy 
 +var initial = params.get("tab"); 
 +activate(KEYS.indexOf(initial) >= 0 ? initial : "ds"); 
 +// 站点数角标 
 +$("msq-badge-ds").textContent = DS_SITES.length + " 站"; 
 +$("msq-badge-eda").textContent = EDA_SITES.length + " 站"; 
 +$("msq-badge-buy").textContent = BUY_SITES.length + " 站"; 
 +})();</script></html>
在线工具/元器件/元器件多站查询.txt · 最后更改: 2026/10/11 22:03 由 hwwiki