From 642ccece7a7fccc2966b0f3d881a713809cc1508 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Wed, 29 Mar 2023 16:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJuMan.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJuMan.js | 89 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/SrcJuMan.js b/SrcJuMan.js index a1c9ea69..8f3d0bf5 100644 --- a/SrcJuMan.js +++ b/SrcJuMan.js @@ -1,39 +1,66 @@ //巨漫,接口型空壳小程序,接口分为主页源和搜索源 +let cfgfile = "hiker://files/rules/Src/JuMan/config.json"; +let JuMancfg=fetch(cfgfile); +if(JuMancfg != ""){ + eval("var JMconfig=" + JuMancfg+ ";"); +}else{ + var JMconfig= {}; +} + +let sourcefile = "hiker://files/rules/Src/JuMan/jiekou.json"; +let sourcedata = fetch(sourcefile); +if(sourcedata != ""){ + eval("var datalist=" + sourcedata+ ";"); +}else{ + var datalist = []; +} + //一级 function yiji() { Version(); - + let sourcename = JMconfig['source']; + let sourcedata = datalist.length>0?datalist.filter(it=>{ + return it.name==sourcename&&it.type=="source"; + }):[]; let d = []; - d.push({ - title: "源", - url: "", - pic_url: "", - col_type: 'icon_5' - }) - d.push({ - title: "更新", - url: "", - pic_url: "", - col_type: 'icon_5' - }) - d.push({ - title: "分类", - url: "", - pic_url: "", - col_type: 'icon_5' - }) - d.push({ - title: "排行", - url: "", - pic_url: "", - col_type: 'icon_5' - }) - d.push({ - title: "书架", - url: "", - pic_url: "", - col_type: 'icon_5' - }) + if(sourcedata.length==0){ + d.push({ + title: "请先配置一个主页源", + url: "hiker://empty", + col_type: "text_center_1", + }) + }else{ + d.push({ + title: "管理", + url: "", + pic_url: "", + col_type: 'icon_5' + }) + d.push({ + title: "更新", + url: "", + pic_url: "", + col_type: 'icon_5' + }) + d.push({ + title: "分类", + url: "", + pic_url: "", + col_type: 'icon_5' + }) + d.push({ + title: "排行", + url: "", + pic_url: "", + col_type: 'icon_5' + }) + d.push({ + title: "书架", + url: "", + pic_url: "", + col_type: 'icon_5' + }) + } setResult(d); /*