chore: 模版更新

This commit is contained in:
xiongxiaoyang
2023-10-14 10:16:41 +08:00
parent 2062123edd
commit 2275b85752
8 changed files with 190 additions and 156 deletions

View File

@ -61,6 +61,11 @@
width: 130px;
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -128,18 +133,16 @@
var sortBy = getQueryVariable("sortBy");
var keyword = getQueryVariable("keyword");
if(keyword != false){
if (keyword != false) {
$("#title").val(decodeURI(keyword));
}else{
} else {
keyword = "";
}
search(1, 20);
search(1,20);
function search(curr,limit) {
function search(curr, limit) {
var searchData = {};
@ -149,21 +152,21 @@
keyword = $("#title").val();
if(catId != false){
if (catId != false) {
searchData.catId = catId;
}
if(bookStatus != false){
if (bookStatus != false) {
searchData.bookStatus = bookStatus;
}
if(sortBy != false){
if (sortBy != false) {
searchData.sort = sortBy;
}else if(!keyword){
} else if (!keyword) {
sortBy = "last_index_update_time";
}
if(keyword){
if (keyword) {
searchData.keyword = keyword;
}
@ -184,31 +187,31 @@
book.bookDesc = book.bookDesc.substring(0,end);
}*/
if(book.bookDesc){
book.bookDesc = book.bookDesc.replace(/<[^>]+>/g,"").replace(/\s+/g,"").replace(/&nbsp;/g,"");
if (book.bookDesc) {
book.bookDesc = book.bookDesc.replace(/<[^>]+>/g, "").replace(/\s+/g, "").replace(/&nbsp;/g, "");
}
bookListHtml += ("<div class=\"layui-row\" style=\"margin-bottom:10px;padding:10px;background: #f2f2f2\">\n" +
" <a href=\"/book/"+book.id+".html\">\n" +
" <a href=\"/book/" + book.id + ".html\">\n" +
" <div class=\"layui-col-xs6 layui-col-sm3 layui-col-md2 layui-col-lg2\" style=\"text-align: center\">\n" +
" <img style='width: 130px;height: 180px' align=\"center\"\n" +
" src=\""+book.picUrl+"\"/>\n" +
" src=\"" + book.picUrl + "\"/>\n" +
"\n" +
" </div>\n" +
" </a>\n" +
" <div style=\"padding: 10px\" class=\"layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8\">\n" +
" <a href=\"/book/"+book.id+".html\">\n" +
" <div class=\"line-limit-length\" style=\";color: #000;font-size: 15px\">"+book.bookName+"</div>\n" +
" <a href=\"/book/" + book.id + ".html\">\n" +
" <div class=\"line-limit-length\" style=\";color: #000;font-size: 15px\">" + book.bookName + "</div>\n" +
" </a>\n" +
" <div style=\";color: #4c6978;float: right;\"><i style=\"color: red\"></i></div>\n" +
" <a href=\"/book/book_ranking.html?keyword="+encodeURI(book.authorName)+"\">\n" +
" <div style=\";color: #a6a6a6;\" class=\"line-limit-length\">作者:"+book.authorName+"</div>\n" +
" <a href=\"/book/book_ranking.html?keyword=" + encodeURI(book.authorName) + "\">\n" +
" <div style=\";color: #a6a6a6;\" class=\"line-limit-length\">作者:" + book.authorName + "</div>\n" +
" </a>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">类别:"+book.catName+"</div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">状态:"+(book.bookStatus==0?'连载':'完结')+"</div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">更新:<i style='color: red'>"+book.lastIndexUpdateTime.substr(0,11)+"</i>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">类别:" + book.catName + "</div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">状态:" + (book.bookStatus == 0 ? '连载' : '完结') + "</div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">更新:<i style='color: red'>" + book.lastIndexUpdateTime.substr(0, 11) + "</i>\n" +
" </div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">简介:"+(book.bookDesc?(book.bookDesc.length>15?(book.bookDesc.substr(0,15)+"..."):book.bookDesc):book.bookDesc)+"</div>\n" +
" <div style=\"margin-top: 5px;color: #a6a6a6;\">简介:" + (book.bookDesc ? (book.bookDesc.length > 15 ? (book.bookDesc.substr(0, 15) + "...") : book.bookDesc) : book.bookDesc) + "</div>\n" +
"\n" +
"\n" +
" </div>\n" +
@ -304,8 +307,6 @@
<script>
function toMyCollect() {
var token = localStorage.getItem("token");
if (token) {