实现了AI助手
This commit is contained in:
@@ -0,0 +1 @@
|
||||
[{"name":"技嘉Z390M GAMING主板1151支持8代9代 I9 9900K 技嘉Z390M GAMING","brand":"技嘉","model":"Z390M GAMING","price":427,"description":"技嘉Z390M GAMING主板,支持Intel 8代和9代处理器,兼容I9 9900K。","imageUrl":"https://img10.360buyimg.com/n7/jfs/t20260424/280862/19/21900/86848/68099c8cF661274d4/61c1bab2541e2ed1.png","stock":14,"typeName":"主板","specifications":"{\"chipset\":\"Intel Z390\",\"socket\":\"LGA1151\",\"compatibleCPUs\":\"Intel 8th/9th Gen (e.g., i9 9900K)\"}"},{"name":"研域A610M1迷你ITX工控主板12/13/14代LGA1700针双网口6串口工业台式机CPU套装电脑mini小主板PCIE x16 H610芯片 双网6串I210AT网卡A610M1","brand":"研域","model":"A610M1","price":849,"description":"研域A610M1迷你ITX工控主板,H610芯片组,支持Intel 12/13/14代LGA1700处理器,双网口6串口,PCIE x16。","imageUrl":"https://img12.360buyimg.com/n7/jfs/t1/272903/10/18528/145710/67f73f3eF7963dbb7/9c3944277e3a3884.jpg","stock":10,"typeName":"主板","specifications":"{\"chipset\":\"Intel H610\",\"socket\":\"LGA1700\",\"formFactor\":\"Mini-ITX\",\"compatibleCPUs\":\"Intel 12th/13th/14th Gen\",\"features\":\"Dual LAN (I210AT), 6 COM ports, PCIe x16\"}"},{"name":"微星微星MSI充新微星B450M PRO-VDH MORTAR 主板AM4替A3... 微星B450M MORTAR MAX迫击","brand":"微星","model":"B450M MORTAR MAX","price":478.62,"description":"微星B450M MORTAR MAX迫击炮主板,AM4接口,可替代B450M PRO-VDH MORTAR。","imageUrl":"https://img11.360buyimg.com/n7/jfs/t1/120656/3/46019/183868/66f84b30Fdd3d3cd6/a3eee3f6fa7659db.jpg","stock":14,"typeName":"主板","specifications":"{\"chipset\":\"AMD B450\",\"socket\":\"AM4\",\"formFactor\":\"Micro-ATX\"}"},{"name":"升技B760ITX D4电脑主板支持12/13/14代处理器,装甲散热,支持三屏输出 M.2 B760ITX D4 雪山白","brand":"升技","model":"B760ITX D4 雪山白","price":479,"description":"升技B760ITX D4雪山白电脑主板,支持Intel 12/13/14代处理器,具备装甲散热和三屏输出,含M.2接口。","imageUrl":"https://img10.360buyimg.com/n7/jfs/t1/6856/38/28446/102266/6539ce43Fe8362ecf/370d8875f2fc8fc8.jpg","stock":10,"typeName":"主板","specifications":"{\"chipset\":\"Intel B760\",\"socket\":\"LGA1700\",\"formFactor\":\"Mini-ITX\",\"memoryType\":\"DDR4\",\"compatibleCPUs\":\"Intel 12th/13th/14th Gen\",\"features\":\"Armor散热, Three-screen output, M.2\"}"},{"name":"GIGABYTE技嘉B560M AORUS ELITE/PRO拆机主板 支持处理器10-11代CPU 电脑 技嘉B560M AORUS PRO AX","brand":"技嘉","model":"B560M AORUS PRO AX","price":469,"description":"技嘉B560M AORUS PRO AX拆机主板,支持Intel 10-11代CPU。","imageUrl":"https://img14.360buyimg.com/n7/jfs/t1/246338/22/15148/129034/66dea4a5F979c55d3/0043e2e6afd87f25.png","stock":30,"typeName":"主板","specifications":"{\"chipset\":\"Intel B560\",\"socket\":\"LGA1200\",\"compatibleCPUs\":\"Intel 10th/11th Gen\"}"}]
|
||||
+23
-18
@@ -1,34 +1,39 @@
|
||||
let result = [];
|
||||
let richResult = []
|
||||
$0.querySelectorAll("li").forEach((ele, index) => {
|
||||
Array.from($0.querySelectorAll("li"))
|
||||
.filter(ele =>
|
||||
!(ele.querySelector(".p-promo-flag") && ele.querySelector(".p-promo-flag").textContent.includes("广告")))
|
||||
.forEach((ele, index) => {
|
||||
let price = parseFloat(ele.querySelector("strong").textContent.trim().slice(1));
|
||||
let title = ele.querySelector(".p-name").textContent.trim();
|
||||
let img = ele.querySelector("img").src;
|
||||
result.push([index, title, price]);
|
||||
richResult.push({
|
||||
index,
|
||||
title: title,
|
||||
price: price,
|
||||
img: img
|
||||
index,
|
||||
title: title,
|
||||
price: price,
|
||||
img: img
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
console.log(JSON.stringify(result));
|
||||
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
|
||||
|
||||
let data = []
|
||||
|
||||
let res = data.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
brand: item.brand,
|
||||
model: item.model,
|
||||
price: item.price,
|
||||
description: item.description,
|
||||
imageUrl: richResult.find(item_ => item_.index == item.index).img,
|
||||
stock: Math.random() * 50 | 0 + 10,
|
||||
typeName: item.typeName,
|
||||
specifications: item.specifications
|
||||
};
|
||||
return {
|
||||
name: item.name,
|
||||
brand: item.brand,
|
||||
model: item.model,
|
||||
price: item.price,
|
||||
description: item.description,
|
||||
imageUrl: richResult.find(item_ => item_.index == item.index).img,
|
||||
stock: Math.random() * 50 | 0 + 10,
|
||||
typeName: item.typeName,
|
||||
specifications: typeof item.specifications == "string" ? item.specifications : JSON.stringify(item.specifications)
|
||||
};
|
||||
}).filter(item => item.imageUrl).filter(item => item.typeName == "主板")
|
||||
|
||||
console.log(JSON.stringify(res));
|
||||
|
||||
Reference in New Issue
Block a user