novel-plus/templates/dark/html/mobile/book/soft_book_search.html
2020-12-26 22:16:58 +08:00

294 lines
11 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title th:text="${application.seoConfig.page['soft-search.title']}"></title>
<meta name="keywords" th:content="${application.seoConfig.page['soft-search.keyword']}">
<meta name="description"
th:content="${application.seoConfig.page['soft-search.description']}">
<div th:include="common/css :: css"></div>
</div>
<style type="text/css">
.line-limit-length {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.indexP p a {
color: #4c6978;
}
.Readarea {
font-size: 18px;
line-height: 35px;
padding: 10px;
color: #333;
}
div, p {
wrap-work: break-word;
word-break: break-all;
word-wrap: break-word;
word-break: normal;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-ms-box-sizing: border-box;
}
.indexDiv a {
margin-left: 20px;
}
img {
width: 147px;
height: 197px;
}
</style>
</head>
<body>
<input type="hidden" id="limit" th:value="${limit}"/>
<input type="hidden" id="curr" th:value="${curr}"/>
<input type="hidden" id="total" th:value="${total}"/>
<input type="hidden" id="ids" th:value="${ids}"/>
<input type="hidden" id="keyword" th:value="${keyword}"/>
<input type="hidden" id="softTag" th:value="${softTag}"/>
<input type="hidden" id="sortBy" th:value="${sortBy}"/>
<input type="hidden" id="sort" th:value="${sort}"/>
<input type="hidden" id="bookStatus" th:value="${bookStatus}"/>
<input type="hidden" id="softCat" th:value="${softCat}"/>
<ul class="layui-nav" lay-filter="" style="padding:0 20px;text-align: center">
<li id="menunew" class="layui-nav-item"><a href="/book/searchSoftBook.html">最新</a></li>
<li id="menu21" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=21">魔幻</a></li>
<li id="menu22" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=22">玄幻</a></li>
<li id="menu23" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=23">古风</a></li>
<li id="menu24" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=24">科幻</a></li>
<li id="menu25" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=25">校园</a></li>
<li id="menu26" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=26">都市</a></li>
<li id="menu27" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=27">游戏</a></li>
<li id="menu28" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=28">同人</a></li>
<li id="menu29" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=29">悬疑</a></li>
<li id="menu0" class="layui-nav-item"><a href="/book/searchSoftBook.html?softCat=0">动漫</a></li>
<li id="menucomplete" class="layui-nav-item"><a>完本</a>
<dl class="layui-nav-child"> <!-- 二级菜单 -->
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成">全部</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=21">魔幻</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=22">玄幻</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=23">古风</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=24">科幻</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=25">校园</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=26">都市</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=27">游戏</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=28">同人</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=29">悬疑</a></dd>
<dd><a href="/book/searchSoftBook.html?bookStatus=已完成&softCat=0">动漫</a></dd>
</dl>
</li>
<li id="menuhot" class="layui-nav-item"><a>排行</a>
<dl class="layui-nav-child"> <!-- 二级菜单 -->
<dd><a href="/book/searchSoftBook.html?sortBy=score">全部</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=21">魔幻</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=22">玄幻</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=23">古风</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=24">科幻</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=25">校园</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=26">都市</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=27">游戏</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=28">同人</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=29">悬疑</a></dd>
<dd><a href="/book/searchSoftBook.html?sortBy=score&softCat=0">动漫</a></dd>
</dl>
</li>
</ul>
<div class="layui-container">
<div class="layui-row">
<div class="layui-col-xs10 layui-col-sm10 layui-col-md11 layui-col-lg11" style="padding-top:1%">
<input id="title" type="text" name="title" required lay-verify="required" placeholder="请输入书名·作者"
autocomplete="off"
class="layui-input" th:value="${keyword}">
</div>
<div class="layui-col-xs1" style="padding: 1%">
<button onclick="searchBooks()" class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
</div>
</div>
</div>
<div th:each="book : ${books}" class="layui-row" style="margin-bottom:10px;padding:10px;background: #f2f2f2">
<a th:href="'/book/'+ ${book.id} + '.html'">
<div class="layui-col-xs6 layui-col-sm3 layui-col-md2 layui-col-lg2" style="text-align: center"
th:switch="${application.noLazy}">
<img th:case="'1'" align="center"
th:attr="data-src=${book.picUrl}"/>
<img th:case="*" align="center"
class="lazyload" th:attr="data-src=${book.picUrl}"/>
</div>
</a>
<div style="padding: 20px" class="layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8">
<a th:href="'/book/'+ ${book.id} + '.html'">
<div class="line-limit-length" style=";color: #4c6978;font-weight: bold;font-size: 15px"
th:text="${book.bookName}"></div>
</a>
<div style=";color: #4c6978;float: right;"><i style="color: red" th:text="${book.score} + '分'"></i></div>
<a th:href="'/book/searchSoftBook.html?keyword='+ ${book.author}">
<div style=";color: #4c6978;" class="line-limit-length" th:text="'作者'+ ${book.author}"></div>
</a>
<div style="margin-top: 5px;color: #4c6978;" th:text="'类别'+ ${book.cateName}"></div>
<div style="margin-top: 5px;color: #4c6978;" th:text="'状态'+ ${book.bookStatus}"></div>
<div style="margin-top: 5px;color: #4c6978;">更新:<i th:text="${#dates.format(book.updateTime, 'yy-MM-dd')}"></i>
</div>
<div class="layui-collapse" style="margin-top: 5px;">
<div class="layui-colla-item">
<h2 style="color: #4c6978;" class="layui-colla-title">简介:</h2>
<div style="color: #4c6978;" class="layui-colla-content" th:utext="${book.bookDesc}">
</div>
</div>
</div>
</div>
</div>
<div id="books" style="text-align: center"></div>
<div th:replace="common/soft_footer :: footer">
</div>
<a name="buttom"></a>
</body>
<div th:replace="common/js :: js"></div>
<script src="/js/lazyload.js"></script>
<script>
lazyload();
layui.use('laypage', function () {
var laypage = layui.laypage;
//执行一个laypage实例
laypage.render({
elem: 'books' //注意,这里的 test1 是 ID不用加 # 号
, count: $("#total").val() //数据总数,从服务端得到,
, curr: $("#curr").val()
, limit: $("#limit").val()
, jump: function (obj, first) {
//obj包含了当前分页的所有参数比如
console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
console.log(obj.limit); //得到每页显示的条数
//首次不执行
if (!first) {
searchByAllCondition(obj.curr, obj.limit);
} else {
}
}
});
});
function searchByAllCondition(curr, limit, newKeyword) {
var toUrl = "/book/searchSoftBook.html?curr=" + curr + "&limit=" + limit;
var ids = $("#ids").val();
if (ids) {
toUrl += ("&historyBookIds=" + ids);
}
var keyword = $("#keyword").val();
if (newKeyword) {
toUrl += encodeURI("&keyword=" + newKeyword);
} else if (keyword) {
toUrl += encodeURI("&keyword=" + keyword);
}
var bookStatus = $("#bookStatus").val();
if (bookStatus) {
toUrl += ("&bookStatus=" + bookStatus);
}
var softCat = $("#softCat").val();
if (softCat) {
toUrl += ("&softCat=" + softCat);
}
var softTag = $("#softTag").val();
if (softTag) {
toUrl += ("&softTag=" + softTag);
}
var sortBy = $("#sortBy").val();
if (sortBy) {
toUrl += ("&sortBy=" + sortBy);
}
var sort = $("#sort").val();
if (sort) {
toUrl += ("&sort=" + sort);
}
window.location.href = toUrl;
}
function searchBooks() {
var keywords = $("#title").val();
$("#keyword").val("");
searchByAllCondition(1, 20, keywords);
}
</script>
<script>
(function () {
var sortCat = $("#softCat").val();
var sortBy = $("#sortBy").val();
if (sortBy == 'score') {
$("#menuhot").addClass("layui-this");
} else if ($("#bookStatus").val()) {
$("#menucomplete").addClass("layui-this");
} else if (sortCat) {
$("#menu" + sortCat).addClass("layui-this");
} else {
$("#menunew").addClass("layui-this");
}
})();
function toMyCollect() {
var token = localStorage.getItem("token");
if (token) {
window.location.href = "/book/search?token=" + token;
} else {
window.location.href = "/user/login.html";
}
}
</script>
</html>