|
|
|
@ -132,6 +132,9 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let 筛选; |
|
|
|
|
|
|
|
|
|
let cate_exclude = ['主页', '求片/留言']; |
|
|
|
|
if(jkdata.hidecate && jkdata.categories){ |
|
|
|
|
cate_exclude = cate_exclude.concat(jkdata.categories); |
|
|
|
|
} |
|
|
|
|
const Color = getItem("主题颜色", "#6dc9ff"); |
|
|
|
|
let classCache = batchTest?undefined:storage0.getMyVar('SrcJu_dianbo$classCache'); |
|
|
|
|
if (classCache) { |
|
|
|
@ -144,7 +147,9 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let home = JSON.parse(getHtml(classurl, headers)); |
|
|
|
|
let typelist = home['class'] || []; |
|
|
|
|
typelist.forEach(v=>{ |
|
|
|
|
分类.push(v.type_name + '$' + v.type_id); |
|
|
|
|
if(cate_exclude.indexOf(v.type_name) == -1){ |
|
|
|
|
分类.push(v.type_name + '$' + v.type_id); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(home['filters']){ |
|
|
|
|
筛选 = home['filters']; |
|
|
|
@ -159,7 +164,9 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let home = JSON.parse(drpy.home()); |
|
|
|
|
let typelist = home['class'] || []; |
|
|
|
|
typelist.forEach(v=>{ |
|
|
|
|
分类.push(v.type_name + '$' + v.type_id); |
|
|
|
|
if(cate_exclude.indexOf(v.type_name) == -1){ |
|
|
|
|
分类.push(v.type_name + '$' + v.type_id); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(home['filters']){ |
|
|
|
|
筛选 = home['filters']; |
|
|
|
@ -262,17 +269,22 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (api_type == "XBPQ") { |
|
|
|
|
let types = []; |
|
|
|
|
if (extdata["分类"].indexOf('$') > -1) { |
|
|
|
|
分类 = extdata["分类"].split('#'); |
|
|
|
|
types = extdata["分类"].split('#'); |
|
|
|
|
} else if (extdata["分类"].indexOf('&') > -1 && extdata["分类值"]) { |
|
|
|
|
let typenames = extdata["分类"].split('&'); |
|
|
|
|
let typeids = extdata["分类值"].split('&'); |
|
|
|
|
for (let i in typeids) { |
|
|
|
|
if (cate_exclude.indexOf(typenames[i]) == -1) { |
|
|
|
|
分类.push(typenames[i] + '$' + typeids[i]); |
|
|
|
|
} |
|
|
|
|
types.push(typenames[i] + '$' + typeids[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
types.forEach(it=>{ |
|
|
|
|
if(cate_exclude.indexOf(it.split('$')[0]) == -1){ |
|
|
|
|
分类.push(it); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
筛选 = extdata["筛选"]; |
|
|
|
|
} else { |
|
|
|
|
let gethtml = getHtml(classurl, headers); |
|
|
|
@ -280,13 +292,17 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let typehtml = JSON.parse(gethtml); |
|
|
|
|
let typelist = typehtml.data.list || typehtml.data.typelist; |
|
|
|
|
typelist.map((it) => { |
|
|
|
|
分类.push(it.type_name + '$' + it.type_id); |
|
|
|
|
if(cate_exclude.indexOf(it.type_name) == -1){ |
|
|
|
|
分类.push(it.type_name + '$' + it.type_id); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else if (/app|v2/.test(api_type)) { |
|
|
|
|
let typehtml = JSON.parse(gethtml); |
|
|
|
|
let typelist = typehtml.list || typehtml.data; |
|
|
|
|
typelist.forEach(it => { |
|
|
|
|
分类.push(it.type_name + '$' + it.type_id); |
|
|
|
|
if(cate_exclude.indexOf(it.type_name) == -1){ |
|
|
|
|
分类.push(it.type_name + '$' + it.type_id); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(api_type=="app"){ |
|
|
|
|
try{ |
|
|
|
@ -321,9 +337,16 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let typelist = pdfa(gethtml, 'class&&ty'); |
|
|
|
|
if (jkdata.categories) { |
|
|
|
|
for (var i = 0; i < typelist.length; i++) { |
|
|
|
|
if (jkdata.categories.indexOf(String(xpath(typelist[i], `//ty/text()`)).trim()) == -1) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
if(jkdata.hidecate){//隐藏设置的分类
|
|
|
|
|
if (cate_exclude.indexOf(String(xpath(typelist[i], `//ty/text()`)).trim()) > -1) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
} |
|
|
|
|
}else{//仅显示设置的分类
|
|
|
|
|
if (jkdata.categories.indexOf(String(xpath(typelist[i], `//ty/text()`)).trim()) == -1) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -335,9 +358,16 @@ function getYiData(jkdata, batchTest) { |
|
|
|
|
let typelist = typehtml["class"] || []; |
|
|
|
|
if (jkdata.categories) { |
|
|
|
|
for (var i = 0; i < typelist.length; i++) { |
|
|
|
|
if (jkdata.categories.indexOf(typelist[i].type_name) == -1 && typelist[i].type_pid!=0) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
if(jkdata.hidecate){//隐藏设置的分类
|
|
|
|
|
if (cate_exclude.indexOf(typelist[i].type_name) > -1) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
} |
|
|
|
|
}else{//仅显示设置的分类
|
|
|
|
|
if (jkdata.categories.indexOf(typelist[i].type_name) == -1 && typelist[i].type_pid!=0) { |
|
|
|
|
typelist.splice(i, 1); |
|
|
|
|
i = i - 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|