From eccbf99d91b3487f0fbf09d73b0e441f2da2ffb9 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 7 Apr 2023 19:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJuPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJuPublic.js | 52 -------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/SrcJuPublic.js b/SrcJuPublic.js index dc3b3520..caf119cc 100644 --- a/SrcJuPublic.js +++ b/SrcJuPublic.js @@ -88,55 +88,3 @@ function getYiData(type,od) { } setResult(d); } - -let bookfile = "hiker://files/rules/Src/Ju/book.json"; -let bookdata = fetch(bookfile); -if(bookdata != ""){ - try{ - eval("var booklist=" + bookdata+ ";"); - }catch(e){ - var booklist = []; - } -}else{ - var booklist = []; -} -//操作书架 -function bookCase (data,x) { - let book = booklist.filter(it => { - return it.name==data.name && it.stype==data.stype; - }) - if(!x){ - let sm; - if (book.length > 0) { - let index = booklist.indexOf(book[0]); - booklist.splice(index, 1); - sm = "书架更新成功"; - }else{ - sm = "加入书架成功"; - updateItem('bookCase', { - title: "更新书架" - }); - } - booklist.push(data); - writeFile(bookfile, JSON.stringify(booklist)); - return "toast://"+data.name+" "+sm; - }else if(x=="select"){ - if (book.length > 0) { - return 1; - } else { - return 0; - } - }else if(x=="delete"){ - if (book.length > 0) { - let sm = "已从书架删除"; - let index = booklist.indexOf(book[0]); - booklist.splice(index, 1); - updateItem('bookCase', { - title: "加入书架" - }); - writeFile(bookfile, JSON.stringify(booklist)); - return "toast://"+data.name+" "+sm; - } - } - return "toast://异常操作"; -} \ No newline at end of file