@ -0,0 +1 @@
|
|||||||
|
{"flag": 0, "errorList": ["\u6240\u9009\u5185\u5b58\u5bb9\u91cf\u5927\u4e8e\u4e3b\u677f\u652f\u6301\u7684\u6700\u5927\u5185\u5b58\u5bb9\u91cf", "\u6240\u9009\u5185\u5b58\u6570\u91cf\u5927\u4e8e\u6240\u9009\u4e3b\u677f\u4e0a\u7684\u63d2\u69fd\u6570\u91cf", "\u6240\u9009\u4e3b\u677f\u677f\u578b\u5927\u4e8e\u6240\u9009\u673a\u7bb1\u80fd\u5bb9\u7eb3\u7684\u6700\u5927\u4e3b\u677f\u5927\u5c0f", "\u6240\u9009\u6c34\u51b7\u5c3a\u5bf8\u5927\u4e8e\u6240\u9009\u673a\u7bb1\u652f\u6301\u7684\u6700\u5927\u5c3a\u5bf8", "\u6240\u9009\u673a\u7bb1\u65e0\u6cd5\u5bb9\u7eb3\u6240\u9009\u7535\u6e90"]}
|
@ -0,0 +1 @@
|
|||||||
|
{"l1":"https:\/\/item.jd.com\/100006391078.html","l2":"https:\/\/item.jd.com\/100003809901.html","l3":"https:\/\/item.jd.com\/100009115115.html","l4":"https:\/\/item.jd.com\/100012759442.html","l5":"https:\/\/item.jd.com\/100005926991.html","l6":"https:\/\/item.jd.com\/675971.html","l7":"https:\/\/item.jd.com\/100011674030.html","l8":"https:\/\/item.jd.com\/6828141.html","l9":"https:\/\/item.jd.com\/100007000176.html"}
|
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"l1": "https://item.jd.com/100006391078.html", // CPU
|
||||||
|
"l2": "https://item.jd.com/100003809901.html", // 主板
|
||||||
|
"l3": "https://item.jd.com/100009115115.html", // 显卡
|
||||||
|
"l4": "https://item.jd.com/100005116786.html", // 内存
|
||||||
|
"l5": "https://item.jd.com/100005926991.html", // 固态硬盘
|
||||||
|
"l6": "https://item.jd.com/675971.html", // 机械硬盘
|
||||||
|
"l7": "https://item.jd.com/100011674030.html", // CPU散热器
|
||||||
|
"l8": "https://item.jd.com/6828141.html", // 电源
|
||||||
|
"l9": "https://item.jd.com/100002404996.html" // 机箱
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
{"version":"primary","Q1":["5000","7000"],"Q2":"1","Q3":"1","Q4":"4","Q5":"1"}
|
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
$data = json_encode($_POST);
|
||||||
|
// 将检测问卷内容读取到文件中
|
||||||
|
file_put_contents('../code/Compatibility_Checking/questionnaire.json', $data);
|
||||||
|
|
||||||
|
//运行python脚本算法
|
||||||
|
exec("E:/02_Program_files/anaconda3/envs/web/python.exe ../code/Compatibility_Checking/doCheck.py 2>../code/Compatibility_Checking/check_error.txt", $out);
|
||||||
|
|
||||||
|
// 从文件中读取数据到PHP变量
|
||||||
|
if ($out[0] === "OK") {
|
||||||
|
$result = file_get_contents('../code/Compatibility_Checking/check_result.json');
|
||||||
|
echo $result;
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
$data = json_encode($_POST);
|
||||||
|
|
||||||
|
// 将问卷内容读取到文件中
|
||||||
|
file_put_contents('../code/Recommend_Code/questionAnswers.json' , $data);
|
||||||
|
|
||||||
|
//运行python脚本算法
|
||||||
|
exec("E:/02_Program_files/anaconda3/envs/web/python.exe ../code/Recommend_Code/recommend.py 2>../code/Recommend_Code/recommend_error.txt", $out);
|
||||||
|
|
||||||
|
// 从文件中读取数据到PHP变量
|
||||||
|
if ($out[0]==="OK"){
|
||||||
|
$result = file_get_contents('../code/Recommend_Code/recommend_result.json');
|
||||||
|
echo $result;
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
function checking() {
|
||||||
|
console.log("enter checking!!!");
|
||||||
|
let parts=new Array("CPU链接","主板链接","显卡链接", "内存链接", "固态硬盘链接", "机械硬盘链接", "CPU散热器链接", "电源链接", "机箱链接");
|
||||||
|
let undone = new Array();
|
||||||
|
let count = 0;
|
||||||
|
let checkdict = {
|
||||||
|
"l1" : "", // CPU链接
|
||||||
|
"l2" : "", // 主板链接
|
||||||
|
"l3" : "", // 显卡链接
|
||||||
|
"l4" : "", // 内存链接
|
||||||
|
"l5" : "", // 固态硬盘链接
|
||||||
|
"l6" : "", // 机械硬盘链接
|
||||||
|
"l7" : "", // CPU散热器链接
|
||||||
|
"l8" : "", // 电源链接
|
||||||
|
"l9" : "" // 机箱链接
|
||||||
|
}
|
||||||
|
for (let i=0;i<8;i++)
|
||||||
|
{
|
||||||
|
let inputid = "u"+(35+i*10)+"_input";
|
||||||
|
let temp = document.getElementById(inputid).value;
|
||||||
|
if (temp === "")
|
||||||
|
{
|
||||||
|
undone[count] = i;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
checkdict["l"+(i+1)] = temp;
|
||||||
|
}
|
||||||
|
checkdict["l9"] = document.getElementById('u116_input').value;
|
||||||
|
if (checkdict["l9"] === "")
|
||||||
|
{
|
||||||
|
undone[count] = 8;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
let missparts = "";
|
||||||
|
if (count>0)
|
||||||
|
{
|
||||||
|
for (let j=0;j<count;j++)
|
||||||
|
missparts += parts[undone[j]]+" ";
|
||||||
|
alert(missparts+"没有填写,请先填写完");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (confirm("已填写完,是否确认提交?")===true)
|
||||||
|
{
|
||||||
|
console.log(checkdict);
|
||||||
|
$.ajax({
|
||||||
|
type : "post",
|
||||||
|
url : "controllers/checkController.php",
|
||||||
|
data : checkdict,
|
||||||
|
dataType : 'json',
|
||||||
|
success : function (result){
|
||||||
|
if (result['flag'] === 1)
|
||||||
|
window.location.href = "checksuc.html";
|
||||||
|
else{
|
||||||
|
window.sessionStorage.setItem("checkResult", JSON.stringify(result));
|
||||||
|
window.location.href = "checkfail.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
function showError() {
|
||||||
|
console.log("enter show_error !!");
|
||||||
|
let recResult_string = window.sessionStorage.getItem("recommendResult")
|
||||||
|
let recResult = JSON.parse(recResult_string);
|
||||||
|
let errorInfo = "";
|
||||||
|
for (const error of recResult["errorList"])
|
||||||
|
errorInfo += `<p><span style="text-decoration:none;">${error}</span></p>`;
|
||||||
|
document.getElementById("u21_text").innerHTML = errorInfo;
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
function foo() {
|
||||||
|
console.log("enter foo(result1) !!");
|
||||||
|
const result_string = window.sessionStorage.getItem("recommendResult")
|
||||||
|
const result = JSON.parse(result_string);
|
||||||
|
// const result = {
|
||||||
|
// "type": 0,
|
||||||
|
// "flag": 0,
|
||||||
|
// "count": 1,
|
||||||
|
// "result": [{
|
||||||
|
// "CPU": ["AMDR9 3900X", "https://item.jd.com/100006391096.html", 2979],
|
||||||
|
// "motherboard": ["微星MPG X570 GAMING EDGE WIFI", "https://item.jd.com/100003809901.html", 1499],
|
||||||
|
// "memory": ["G.SKILLF4-3200C14D-16GTZR", "https://item.jd.com/4353372.html", 1149],
|
||||||
|
// "SSD": ["西部数据WDS500G1X0E", "https://item.jd.com/100009210509.html", 1049],
|
||||||
|
// "GPU": ["七彩虹iGame GeForce RTX 3060 Ti Ultra W OC", "https://item.jd.com/100016516560.html", 3599],
|
||||||
|
// "case": ["先马黑洞", "https://item.jd.com/1842778.html", 299],
|
||||||
|
// "powerSupply": ["长城G6 GW-ATX650BL", "https://item.jd.com/7299684.html", 599],
|
||||||
|
// "CPURadiator": ["酷冷至尊RL-SB24-20PK-R1", "https://item.jd.com/4567820.html", 369],
|
||||||
|
// "HDD": ["西部数据WD1003FZEX", "https://item.jd.com/1018295.html", 529],
|
||||||
|
// "totalPrice": 12071,
|
||||||
|
// "hash": "10247302252"
|
||||||
|
// }]
|
||||||
|
// }
|
||||||
|
var recList1 = result["result"][0];
|
||||||
|
var parts = ["CPU","motherboard", "GPU", "memory", "SSD", "HDD", "powerSupply", "CPURadiator", "case"];
|
||||||
|
|
||||||
|
//第一套
|
||||||
|
for (let a=0;a<9;a++){
|
||||||
|
let start = 45+a*3;
|
||||||
|
let name = recList1[parts[a]][0];
|
||||||
|
let url = recList1[parts[a]][1];
|
||||||
|
let price = recList1[parts[a]][2];
|
||||||
|
if (name==="noneed"){
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = '----';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = `<a href="${url}" style="text-decoration: none;" target="_blank">${name}</a>`;
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("u73_text").innerHTML = recList1["totalPrice"];
|
||||||
|
let download_1 = $('#u41_text a').eq(0)[0];
|
||||||
|
download_1.href = "recommendLists/Recommend_"+recList1['hash']+".txt";
|
||||||
|
download_1.download = "Recommend_1.txt";
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
function foo() {
|
||||||
|
console.log("enter foo !!");
|
||||||
|
const result_string = window.sessionStorage.getItem("recommendResult")
|
||||||
|
const result = JSON.parse(result_string);
|
||||||
|
var recList1 = result["result"][0];
|
||||||
|
var recList2 = result["result"][1];
|
||||||
|
var recList3 = result["result"][2];
|
||||||
|
var parts = ["CPU","motherboard", "GPU", "memory", "SSD", "HDD", "powerSupply", "CPURadiator", "case"];
|
||||||
|
|
||||||
|
//第一套
|
||||||
|
for (let a=0;a<9;a++){
|
||||||
|
let start = 662+a*3;
|
||||||
|
let name = recList1[parts[a]][0];
|
||||||
|
let url = recList1[parts[a]][1];
|
||||||
|
let price = recList1[parts[a]][2];
|
||||||
|
if (name==="noneed"){
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = '----';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = `<a href="${url}" style="text-decoration: none;" target="_blank">${name}</a>`;
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("u690_text").innerHTML = recList1["totalPrice"];
|
||||||
|
let download_1 = $('#u656_text a').eq(0)[0];
|
||||||
|
download_1.href = "recommendLists/Recommend_"+recList1['hash']+".txt";
|
||||||
|
download_1.download = "Recommend_1.txt";
|
||||||
|
//第二套:
|
||||||
|
for (let b=0;b<9;b++){
|
||||||
|
let start = 697+b*3;
|
||||||
|
let name = recList2[parts[b]][0];
|
||||||
|
let url = recList2[parts[b]][1];
|
||||||
|
let price = recList2[parts[b]][2];
|
||||||
|
if (name==="noneed"){
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = '----';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = `<a href="${url}" style="text-decoration: none;" target="_blank">${name}</a>`;
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("u725_text").innerHTML = recList2["totalPrice"];
|
||||||
|
let download_2 = $('#u691_text a').eq(0)[0];
|
||||||
|
download_2.href = "recommendLists/Recommend_"+recList2['hash']+".txt";
|
||||||
|
download_2.download = "Recommend_2.txt";
|
||||||
|
//第三套:
|
||||||
|
for (let c=0;c<9;c++){
|
||||||
|
let start = 729+c*3;
|
||||||
|
let name = recList3[parts[c]][0];
|
||||||
|
let url = recList3[parts[c]][1];
|
||||||
|
let price = recList3[parts[c]][2];
|
||||||
|
if (name==="noneed"){
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = '----';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById(`u${start}_text`).innerHTML = `<a href="${url}" style="text-decoration: none;" target="_blank">${name}</a>`;
|
||||||
|
document.getElementById(`u${start+1}_text`).innerHTML = price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("u757_text").innerHTML = recList3["totalPrice"];
|
||||||
|
let download_3 = $('#u692_text a').eq(0)[0];
|
||||||
|
download_3.href = "recommendLists/Recommend_"+recList3['hash']+".txt";
|
||||||
|
download_3.download = "Recommend_3.txt";
|
||||||
|
}
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |