用户工具

站点工具


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

差别

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

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
在线工具:元器件:datasheet多站查询 [2026/10/09 08:42] – 移除 - 外部编辑 (Unknown date) 127.0.0.1在线工具:元器件:datasheet多站查询 [2026/10/09 08:47] (当前版本) – hwwiki
行 1: 行 1:
 +<html>
 +<style>
 +:root {
 +--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: 24px 12px;
 +}
 +.app { width: 100%; max-width: 560px; }
 +.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; }
 +.field { flex: 1; }
 +.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; }
 +.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); cursor: default; }
 +</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" style="flex:0.9">
 +<label for="m">厂商(可选)</label>
 +<input type="text" id="m" placeholder="如 ST、TI、Murata" autocomplete="off">
 +</div>
 +<div class="field" style="flex:1.2">
 +<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 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); }
 +// ===== 站点列表(URL 模板均已实测验证)=====
 +// 默认勾选仅 def:true 的站点;引擎类查询词:厂商 + 型号 + pdf
 +function engineQ(m, p) { return (m ? m + " " : "") + p + " pdf"; }
 +var SITES = [
 +// ---- 商城 ----
 +{ g: "商城", name: "立创商城", def: true,
 +u: function (m, p) { return "https://so.szlcsc.com/global.html?k=" + qs(p); } },
 +{ g: "商城", name: "得捷 DigiKey",
 +u: function (m, p) { return "https://www.digikey.cn/zh/products/result?keywords=" + qs(p); } },
 +{ g: "商城", name: "Mouser",
 +u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } },
 +{ g: "商城", name: "element14",
 +u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p); } },
 +{ g: "商城", name: "华秋",
 +u: function (m, p) { return "https://www.hqchip.com/search?keyword=" + qs(p); } },
 +// ---- 专业查询网站 ----
 +{ g: "专业查询网站", name: "半导小芯", def: true,
 +u: function (m, p) { return "https://www.semiee.com/search?searchModel=" + qs(p); } },
 +{ g: "专业查询网站", name: "AllDatasheet",
 +u: function (m, p) { return "https://www.alldatasheet.com/view.jsp?Searchword=" + qs(p); } },
 +{ g: "专业查询网站", name: "Octopart", def: true,
 +u: function (m, p) { return "https://octopart.com/search?q=" + qs(p); } },
 +{ g: "专业查询网站", name: "芯查查",
 +u: function (m, p) { return "https://www.xcc.com/chip/material/search?title=" + qs(p); } },
 +{ g: "专业查询网站", name: "icspec",
 +u: function (m, p) { return "https://www.icspec.com/search/" + qs(p); } },
 +// ---- 搜索引擎 ----
 +{ g: "搜索引擎", name: "必应搜索", def: true,
 +u: function (m, p) { return "https://cn.bing.com/search?q=" + qs(engineQ(m, p)); } },
 +{ g: "搜索引擎", name: "百度搜索",
 +u: function (m, p) { return "https://www.baidu.com/s?wd=" + qs(engineQ(m, p)); } },
 +{ g: "搜索引擎", name: "Google 搜索",
 +u: function (m, p) { return "https://www.google.com/search?q=" + qs(engineQ(m, p)); } },
 +// ---- 其他 ----
 +{ g: "其他", name: "datasheets.com",
 +u: function (m, p) { return "https://www.datasheets.com/search?q=" + qs(p); } },
 +{ g: "其他", name: "DatasheetArchive",
 +u: function (m, p) { return "https://www.datasheetarchive.com/?q=" + qs(p); } },
 +{ g: "其他", name: "datasheets360",
 +u: function (m, p) { return "https://www.datasheets360.com/search/results?query=" + qs(p); } },
 +{ g: "其他", name: "Datasheet4U",
 +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");
 +card.className = "card xsearch";
 +var title = document.createElement("div");
 +title.className = "xs-title";
 +if (p) {
 +var b = document.createElement("b");
 +b.textContent = (m ? m + " " : "") + p;
 +title.appendChild(document.createTextNode("已生成 "));
 +title.appendChild(b);
 +title.appendChild(document.createTextNode(" 的查询链接,勾选后一键打开:"));
 +} else {
 +title.appendChild(document.createTextNode("勾选站点,输入型号后点击「搜索」一键打开所选网站:"));
 +}
 +card.appendChild(title);
 +// 工具栏:全选开关 + 已选计数
 +var toolbar = document.createElement("div");
 +toolbar.className = "xs-toolbar";
 +var selAll = document.createElement("button");
 +selAll.type = "button";
 +selAll.className = "xs-btn ghost";
 +var countSpan = document.createElement("span");
 +countSpan.className = "xs-count";
 +toolbar.appendChild(selAll);
 +toolbar.appendChild(countSpan);
 +card.appendChild(toolbar);
 +var hint = document.createElement("div");
 +hint.className = "xs-hint";
 +var boxes = [];
 +var lastGroup = null, chips = null;
 +SITES.forEach(function (s, idx) {
 +if (s.g !== lastGroup) {
 +lastGroup = s.g;
 +var g = document.createElement("div");
 +g.className = "xs-group";
 +g.textContent = s.g;
 +card.appendChild(g);
 +chips = document.createElement("div");
 +chips.className = "chips";
 +card.appendChild(chips);
 +}
 +var span = document.createElement("span");
 +span.className = "chip" + (p ? "" : " off");
 +var cb = document.createElement("input");
 +cb.type = "checkbox";
 +cb.checked = savedChecks[idx];
 +cb.addEventListener("change", function () { savedChecks[idx] = cb.checked; updateCount(); });
 +var a = document.createElement("a");
 +a.textContent = s.name;
 +if (p) {
 +a.href = s.u(m, p);
 +a.target = "_blank";
 +a.rel = "noopener";
 +}
 +span.appendChild(cb);
 +span.appendChild(a);
 +boxes.push(cb);
 +chips.appendChild(span);
 +});
 +card.appendChild(hint);
 +function updateCount() {
 +var n = 0;
 +boxes.forEach(function (cb) { if (cb.checked) n++; });
 +countSpan.textContent = "已选 " + n + "/" + boxes.length;
 +selAll.textContent = n === boxes.length ? "全不选" : "全选";
 +return n;
 +}
 +selAll.addEventListener("click", function () {
 +var all = boxes.every(function (cb) { return cb.checked; });
 +boxes.forEach(function (cb, i) { cb.checked = !all; savedChecks[i] = cb.checked; });
 +updateCount();
 +});
 +// 打开逻辑暴露给「搜索」按钮(点击即打开所选网站)
 +currentOpen = function () {
 +hint.className = "xs-hint";
 +if (!pEl.value.trim()) {
 +hint.textContent = "请先输入型号,再搜索。";
 +hint.className = "xs-hint show";
 +pEl.focus();
 +return;
 +}
 +var blocked = 0;
 +boxes.forEach(function (cb) {
 +if (!cb.checked) return;
 +var a = cb.nextElementSibling;
 +if (!a.href) return;
 +var w = window.open(a.href, "_blank", "noopener");
 +if (!w) blocked++;
 +});
 +if (blocked > 0) {
 +hint.textContent =
 +"浏览器拦截了 " + blocked + " 个弹窗(默认只允许每次点击开 1 个)。" +
 +"请在地址栏弹窗图标中选择「始终允许来自此站点的弹出式窗口」,或逐个点击站点名打开。";
 +hint.className = "xs-hint show";
 +}
 +};
 +updateCount();
 +return card;
 +}
 +// 勾选状态跨刷新保留(仅 def:true 的站点默认勾选)
 +var savedChecks = SITES.map(function (s) { return s.def === true; });
 +var currentOpen = null;
 +function render() {
 +resultsEl.innerHTML = "";
 +resultsEl.appendChild(buildPanel());
 +}
 +// 输入实时刷新链接(保留勾选状态)
 +var t = null;
 +[mEl, pEl].forEach(function (el) {
 +el.addEventListener("input", function () {
 +if (t) clearTimeout(t);
 +t = setTimeout(render, 250);
 +});
 +});
 +// 「搜索」= 打开所选的全部网站(点击即开,无需先生成)
 +// opening 防重入:同一时刻只允许一轮打开(防事件重复绑定导致每站开两次)
 +var opening = false;
 +function search() {
 +if (opening) return;
 +opening = true;
 +setTimeout(function () { opening = false; }, 500);
 +if (t) { clearTimeout(t); t = null; }
 +render();
 +if (currentOpen) currentOpen();
 +}
 +goEl.addEventListener("click", search);
 +[mEl, pEl].forEach(function (el) {
 +el.addEventListener("keydown", function (ev) {
 +if (ev.key === "Enter") search();
 +});
 +});
 +// 面板初始即显示(无论是否带 URL 参数)
 +render();
 +})();
 +</script>
 +</div>
 +<script>
 +(function () {
 +// 哨兵:脚本只初始化一次(DokuWiki 等环境可能把内容渲染两份导致脚本执行两次)
 +if (window.__datasheetWidgetLoaded) return;
 +window.__datasheetWidgetLoaded = true;
 +var $ = function (id) { return document.getElementById(id); };
 +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); }
 +// ===== 站点列表(URL 模板均已实测验证)=====
 +// 默认勾选仅 def:true 的站点;引擎类查询词:厂商 + 型号 + pdf
 +function engineQ(m, p) { return (m ? m + " " : "") + p + " pdf"; }
 +var SITES = [
 +// ---- 商城 ----
 +{ g: "商城", name: "立创商城", def: true,
 +u: function (m, p) { return "https://so.szlcsc.com/global.html?k=" + qs(p); } },
 +{ g: "商城", name: "得捷 DigiKey",
 +u: function (m, p) { return "https://www.digikey.cn/zh/products/result?keywords=" + qs(p); } },
 +{ g: "商城", name: "Mouser",
 +u: function (m, p) { return "https://www.mouser.cn/c/?q=" + qs(p); } },
 +{ g: "商城", name: "element14",
 +u: function (m, p) { return "https://cn.element14.com/search?st=" + qs(p); } },
 +{ g: "商城", name: "华秋",
 +u: function (m, p) { return "https://www.hqchip.com/search?keyword=" + qs(p); } },
 +// ---- 专业查询网站 ----
 +{ g: "专业查询网站", name: "半导小芯", def: true,
 +u: function (m, p) { return "https://www.semiee.com/search?searchModel=" + qs(p); } },
 +{ g: "专业查询网站", name: "AllDatasheet",
 +u: function (m, p) { return "https://www.alldatasheet.com/view.jsp?Searchword=" + qs(p); } },
 +{ g: "专业查询网站", name: "Octopart", def: true,
 +u: function (m, p) { return "https://octopart.com/search?q=" + qs(p); } },
 +{ g: "专业查询网站", name: "芯查查",
 +u: function (m, p) { return "https://www.xcc.com/chip/material/search?title=" + qs(p); } },
 +{ g: "专业查询网站", name: "icspec",
 +u: function (m, p) { return "https://www.icspec.com/search/" + qs(p); } },
 +// ---- 搜索引擎 ----
 +{ g: "搜索引擎", name: "必应搜索", def: true,
 +u: function (m, p) { return "https://cn.bing.com/search?q=" + qs(engineQ(m, p)); } },
 +{ g: "搜索引擎", name: "百度搜索",
 +u: function (m, p) { return "https://www.baidu.com/s?wd=" + qs(engineQ(m, p)); } },
 +{ g: "搜索引擎", name: "Google 搜索",
 +u: function (m, p) { return "https://www.google.com/search?q=" + qs(engineQ(m, p)); } },
 +// ---- 其他 ----
 +{ g: "其他", name: "datasheets.com",
 +u: function (m, p) { return "https://www.datasheets.com/search?q=" + qs(p); } },
 +{ g: "其他", name: "DatasheetArchive",
 +u: function (m, p) { return "https://www.datasheetarchive.com/?q=" + qs(p); } },
 +{ g: "其他", name: "datasheets360",
 +u: function (m, p) { return "https://www.datasheets360.com/search/results?query=" + qs(p); } },
 +{ g: "其他", name: "Datasheet4U",
 +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");
 +card.className = "card xsearch";
 +var title = document.createElement("div");
 +title.className = "xs-title";
 +if (p) {
 +var b = document.createElement("b");
 +b.textContent = (m ? m + " " : "") + p;
 +title.appendChild(document.createTextNode("已生成 "));
 +title.appendChild(b);
 +title.appendChild(document.createTextNode(" 的查询链接,勾选后一键打开:"));
 +} else {
 +title.appendChild(document.createTextNode("勾选站点,输入型号后点击「搜索」一键打开所选网站:"));
 +}
 +card.appendChild(title);
 +// 工具栏:全选开关 + 已选计数
 +var toolbar = document.createElement("div");
 +toolbar.className = "xs-toolbar";
 +var selAll = document.createElement("button");
 +selAll.type = "button";
 +selAll.className = "xs-btn ghost";
 +var countSpan = document.createElement("span");
 +countSpan.className = "xs-count";
 +toolbar.appendChild(selAll);
 +toolbar.appendChild(countSpan);
 +card.appendChild(toolbar);
 +var hint = document.createElement("div");
 +hint.className = "xs-hint";
 +var boxes = [];
 +var lastGroup = null, chips = null;
 +SITES.forEach(function (s, idx) {
 +if (s.g !== lastGroup) {
 +lastGroup = s.g;
 +var g = document.createElement("div");
 +g.className = "xs-group";
 +g.textContent = s.g;
 +card.appendChild(g);
 +chips = document.createElement("div");
 +chips.className = "chips";
 +card.appendChild(chips);
 +}
 +var span = document.createElement("span");
 +span.className = "chip" + (p ? "" : " off");
 +var cb = document.createElement("input");
 +cb.type = "checkbox";
 +cb.checked = savedChecks[idx];
 +cb.addEventListener("change", function () { savedChecks[idx] = cb.checked; updateCount(); });
 +var a = document.createElement("a");
 +a.textContent = s.name;
 +if (p) {
 +a.href = s.u(m, p);
 +a.target = "_blank";
 +a.rel = "noopener";
 +}
 +span.appendChild(cb);
 +span.appendChild(a);
 +boxes.push(cb);
 +chips.appendChild(span);
 +});
 +card.appendChild(hint);
 +function updateCount() {
 +var n = 0;
 +boxes.forEach(function (cb) { if (cb.checked) n++; });
 +countSpan.textContent = "已选 " + n + "/" + boxes.length;
 +selAll.textContent = n === boxes.length ? "全不选" : "全选";
 +return n;
 +}
 +selAll.addEventListener("click", function () {
 +var all = boxes.every(function (cb) { return cb.checked; });
 +boxes.forEach(function (cb, i) { cb.checked = !all; savedChecks[i] = cb.checked; });
 +updateCount();
 +});
 +// 打开逻辑暴露给「搜索」按钮(点击即打开所选网站)
 +currentOpen = function () {
 +hint.className = "xs-hint";
 +if (!pEl.value.trim()) {
 +hint.textContent = "请先输入型号,再搜索。";
 +hint.className = "xs-hint show";
 +pEl.focus();
 +return;
 +}
 +var blocked = 0;
 +boxes.forEach(function (cb) {
 +if (!cb.checked) return;
 +var a = cb.nextElementSibling;
 +if (!a.href) return;
 +var w = window.open(a.href, "_blank", "noopener");
 +if (!w) blocked++;
 +});
 +if (blocked > 0) {
 +hint.textContent =
 +"浏览器拦截了 " + blocked + " 个弹窗(默认只允许每次点击开 1 个)。" +
 +"请在地址栏弹窗图标中选择「始终允许来自此站点的弹出式窗口」,或逐个点击站点名打开。";
 +hint.className = "xs-hint show";
 +}
 +};
 +updateCount();
 +return card;
 +}
 +// 勾选状态跨刷新保留(仅 def:true 的站点默认勾选)
 +var savedChecks = SITES.map(function (s) { return s.def === true; });
 +var currentOpen = null;
 +function render() {
 +resultsEl.innerHTML = "";
 +resultsEl.appendChild(buildPanel());
 +}
 +// 输入实时刷新链接(保留勾选状态)
 +var t = null;
 +[mEl, pEl].forEach(function (el) {
 +el.addEventListener("input", function () {
 +if (t) clearTimeout(t);
 +t = setTimeout(render, 250);
 +});
 +});
 +// 「搜索」= 打开所选的全部网站(点击即开,无需先生成)
 +// opening 防重入:同一时刻只允许一轮打开(防事件重复绑定导致每站开两次)
 +var opening = false;
 +function search() {
 +if (opening) return;
 +opening = true;
 +setTimeout(function () { opening = false; }, 500);
 +if (t) { clearTimeout(t); t = null; }
 +render();
 +if (currentOpen) currentOpen();
 +}
 +goEl.addEventListener("click", search);
 +[mEl, pEl].forEach(function (el) {
 +el.addEventListener("keydown", function (ev) {
 +if (ev.key === "Enter") search();
 +});
 +});
 +// 面板初始即显示(无论是否带 URL 参数)
 +render();
 +})();
 +</script>
 +</html>