-
-
-
-
@@ -151,69 +151,69 @@
});
-
+
function convertValue() {
- const typeSelect = document.getElementById("typeSelect");
- const valueInput = document.getElementById("valueInput");
- const serialInput = document.getElementById("serialInput");
- const outputElement = document.getElementById("output");
- const valueType = typeSelect.value;
- let inputValue = valueInput.value;
- const serialValue = serialInput.value;
- const errors = [];
+ const typeSelect = document.getElementById("typeSelect");
+ const valueInput = document.getElementById("valueInput");
+ const serialInput = document.getElementById("serialInput");
+ const outputElement = document.getElementById("output");
+ const valueType = typeSelect.value;
+ let inputValue = valueInput.value;
+ const serialValue = serialInput.value;
+ const errors = [];
- try {
- if (valueType === "choose") {
- errors.push("请选择IC类型");
- }
- if (!isNumeric(inputValue) || (inputValue.length > 4 && /[a-zA-Z]/.test(inputValue))) {
- errors.push("系列号错误");
+ try {
+ if (valueType === "choose") {
+ errors.push("请选择IC类型");
+ }
+ if (!isNumeric(inputValue) || (inputValue.length > 4 && /[a-zA-Z]/.test(inputValue))) {
+ errors.push("系列号错误");
+ }
+
+ if (!isNumeric(serialValue) || serialValue.length !== 3) {
+ errors.push("流水号错误");
+ }
+
+ if (errors.length > 0) {
+ throw new Error(errors.join(","));
+ }
+
+ let convertedValue;
+
+ if (valueType === "control-ic") {
+ convertedValue = "1100" + formatInputValue(inputValue) + serialValue;
+ } else if (valueType === "memory-ic") {
+ convertedValue = "1101" + formatInputValue(inputValue) + serialValue;
+ } else if (valueType === "power-ic") {
+ convertedValue = "1102" + formatInputValue(inputValue) + serialValue;
+ } else if (valueType === "connector-ic") {
+ convertedValue = "1103" + formatInputValue(inputValue) + serialValue;
+ } else if (valueType === "other-ic") {
+ convertedValue = "1109" + formatInputValue(inputValue) + serialValue;
+ }
+
+ outputElement.textContent = "转换结果:" + convertedValue;
+ } catch (error) {
+ outputElement.textContent = "错误:" + error.message;
+ }
}
- if (!isNumeric(serialValue) || serialValue.length !== 3) {
- errors.push("流水号错误");
+ function formatInputValue(inputValue) {
+ if (inputValue.length > 4) {
+ inputValue = inputValue.substring(0, 4);
+ } else {
+ while (inputValue.length < 4) {
+ inputValue = "0" + inputValue;
+ }
+ }
+ return inputValue;
}
- if (errors.length > 0) {
- throw new Error(errors.join(","));
+ function isNumeric(value) {
+ return /^\d+$/.test(value);
}
- let convertedValue;
-
- if (valueType === "control-ic") {
- convertedValue = "1100" + formatInputValue(inputValue) + serialValue;
- } else if (valueType === "memory-ic") {
- convertedValue = "1101" + formatInputValue(inputValue) + serialValue;
- } else if (valueType === "power-ic") {
- convertedValue = "1102" + formatInputValue(inputValue) + serialValue;
- } else if (valueType === "connector-ic") {
- convertedValue = "1103" + formatInputValue(inputValue) + serialValue;
- } else if (valueType === "other-ic") {
- convertedValue = "1109" + formatInputValue(inputValue) + serialValue;
- }
-
- outputElement.textContent = "转换结果:" + convertedValue;
- } catch (error) {
- outputElement.textContent = "错误:" + error.message;
- }
-}
-
-function formatInputValue(inputValue) {
- if (inputValue.length > 4) {
- inputValue = inputValue.substring(0, 4);
- } else {
- while (inputValue.length < 4) {
- inputValue = "0" + inputValue;
- }
- }
- return inputValue;
-}
-
-function isNumeric(value) {
- return /^\d+$/.test(value);
-}
-
diff --git a/ele/resistance.html b/ele/resistance.html
new file mode 100755
index 0000000..cc68275
--- /dev/null
+++ b/ele/resistance.html
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+
BPI编码转换工具
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/images/logos/ele.jpg b/images/logos/ele.jpg
new file mode 100644
index 0000000..8b1801e
Binary files /dev/null and b/images/logos/ele.jpg differ
diff --git a/images/logos/screw.jpg b/images/logos/screw.jpg
new file mode 100644
index 0000000..e9c6ce1
Binary files /dev/null and b/images/logos/screw.jpg differ
diff --git a/images/logos/shield.png b/images/logos/shield.png
new file mode 100644
index 0000000..a35aece
Binary files /dev/null and b/images/logos/shield.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..5c90729
--- /dev/null
+++ b/index.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
BPI编码转换工具
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Banana Pi 物料生成系统
+
+
+
+
+
+

+
电子类
+
+
+
包括IC,电阻,电容,二极管,三极管,MOS管,电感晶振等等
+
+
+
+
+
+
+
+
+
+

+
塑料类
+
+
+
+
+
+
+
+
+
+

+
机构杂类
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resistance.html b/resistance.html
deleted file mode 100755
index 45825c8..0000000
--- a/resistance.html
+++ /dev/null
@@ -1,269 +0,0 @@
-
-
-
-
-
-
-
-
BPI编码转换工具
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/style/css/style.css b/style/css/style.css
index 6045cec..abb6dc0 100755
--- a/style/css/style.css
+++ b/style/css/style.css
@@ -120,3 +120,38 @@ footer.page-footer {
+
+
+.box {
+ border: 1px solid #ccc; /* 添加包含层的边框样式 */
+ padding: 20px; /* 添加包含层的内边距 */
+ width: 80%; /* 设置包含层的宽度为父容器的80% */
+ margin: 0 auto; /* 水平居中 */
+ border-radius: 10px; /* 设置圆角大小 */
+ box-shadow: 2px 8px 20px rgba(0, 0, 0, 0.2);
+}
+
+.card-container {
+ display: flex;
+}
+
+.card {
+ border-radius: 10px; /* 设置圆角大小 */
+ flex: 1;
+ margin-right: 20px;
+ padding:20px;
+}
+
+.card:last-child {
+ margin-right: 0;
+}
+
+.label1 {
+ font-size: 15px;
+ color:#e63d3d
+}
+
+
+.form-group {
+ padding-left:20px;
+}