mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-15 05:36:40 +00:00
模版更新
This commit is contained in:
@ -51,8 +51,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="my_r">
|
<div class="my_r">
|
||||||
<div id="noContentDiv">
|
<div id="noContentDiv">
|
||||||
<div class="tc" style="margin-top: 200px"><a href="/author/book_add.html" class="btn_red">创建作品</a>
|
<div class="tc" style="margin-top: 200px"><a href="/author/book_add.html" class="btn_red">创建作品</a></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="my_bookshelf" id="hasContentDiv" style="display: none">
|
<div class="my_bookshelf" id="hasContentDiv" style="display: none">
|
||||||
@ -143,13 +142,12 @@
|
|||||||
<script src="/javascript/common.js" type="text/javascript"></script>
|
<script src="/javascript/common.js" type="text/javascript"></script>
|
||||||
|
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
var searchCount = 0;
|
var coverUpdateInterval;
|
||||||
var timeout;
|
|
||||||
search(1, 5);
|
search(1, 5);
|
||||||
|
|
||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
searchCount++;
|
clearInterval(coverUpdateInterval);
|
||||||
clearTimeout(timeout);
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: "/author/listBookByPage",
|
url: "/author/listBookByPage",
|
||||||
@ -159,7 +157,25 @@
|
|||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
var bookList = data.data.list;
|
var bookList = data.data.list;
|
||||||
if (bookList.length > 0) {
|
if (bookList.length > 0) {
|
||||||
var aiPicGenerating = bookList[0].picUrl == '/images/default.gif'
|
if(curr == 1 && bookList[0].picUrl == '/images/default.gif'){
|
||||||
|
coverUpdateInterval = setInterval(function(){
|
||||||
|
$.ajax({
|
||||||
|
type: "get",
|
||||||
|
url: "/author/queryAiGenPic",
|
||||||
|
data: {'bookId': bookList[0].id},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if(data.code == 200 && data.data){
|
||||||
|
$("#cover"+bookList[0].id).attr("src", data.data);
|
||||||
|
clearInterval(coverUpdateInterval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
setTimeout(() => {
|
||||||
|
clearInterval(coverUpdateInterval);
|
||||||
|
}, 10000);
|
||||||
|
}
|
||||||
$("#hasContentDiv").css("display", "block");
|
$("#hasContentDiv").css("display", "block");
|
||||||
$("#noContentDiv").css("display", "none");
|
$("#noContentDiv").css("display", "none");
|
||||||
var bookListHtml = "";
|
var bookListHtml = "";
|
||||||
@ -171,15 +187,12 @@
|
|||||||
" </td>\n" +*/
|
" </td>\n" +*/
|
||||||
|
|
||||||
" <td style=\"position: relative\" class=\"goread\">\n" +
|
" <td style=\"position: relative\" class=\"goread\">\n" +
|
||||||
"<input class=\"opacity\" onchange=\"picChange('" + book.id + "'," + i + ")\"\n" +
|
"<input class=\"opacity\" onchange=\"picChange('" + book.id + "')\"\n" +
|
||||||
" type=\"file\" id=\"file" + i + "\" name=\"file\"\n" +
|
" type=\"file\" id=\"file" + book.id + "\" name=\"file\"\n" +
|
||||||
" title=\"点击上传图片\"\n" +
|
" title=\"点击上传图片\"\n" +
|
||||||
" style=\"z-index: 100;cursor: pointer;left: 30px; top: 0px; width: 60px; height: 80px; opacity: 0; position: absolute; \"\n" +
|
" style=\"z-index: 100;cursor: pointer;left: 30px; top: 0px; width: 60px; height: 80px; opacity: 0; position: absolute; \"\n" +
|
||||||
" />" +
|
" />" +
|
||||||
"<img width='50' height='70' src='" + book.picUrl + "'/><br/>" +
|
"<img id=\"cover" + book.id + "\" width='50' height='70' src='" + book.picUrl + "'/><br/>" + " " + book.bookName + "</td>\n" +
|
||||||
" " + book.bookName + "</td>\n" +
|
|
||||||
|
|
||||||
|
|
||||||
" <td class=\"goread\" >"
|
" <td class=\"goread\" >"
|
||||||
+ book.catName + "</td>\n" +
|
+ book.catName + "</td>\n" +
|
||||||
|
|
||||||
@ -231,12 +244,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (curr === 1 && aiPicGenerating && searchCount < 10) {
|
|
||||||
timeout = setTimeout(function () {
|
|
||||||
search(curr, limit);
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -288,19 +295,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function picChange(bookId, i) {
|
function picChange(bookId) {
|
||||||
var file = $("#file" + i).val(); //文件名称
|
var file = $("#file" + bookId).val(); //文件名称
|
||||||
if (file != "") {
|
if (file != "") {
|
||||||
if (checkPicUpload($("#file" + i)[0])) {
|
if (checkPicUpload($("#file" + bookId)[0])) {
|
||||||
|
|
||||||
$.ajaxFileUpload({
|
$.ajaxFileUpload({
|
||||||
url: "/file/picUpload", //用于文件上传的服务器端请求地址
|
url: "/file/picUpload", //用于文件上传的服务器端请求地址
|
||||||
secureuri: false, //是否需要安全协议,一般设置为false
|
secureuri: false, //是否需要安全协议,一般设置为false
|
||||||
fileElementId: "file" + i, //文件上传域的ID
|
fileElementId: "file" + bookId, //文件上传域的ID
|
||||||
dataType: "json", //返回值类型 一般设置为json
|
dataType: "json", //返回值类型 一般设置为json
|
||||||
type: "post",
|
type: "post",
|
||||||
success: function (data) { //服务器成功响应处理函数
|
success: function (data) { //服务器成功响应处理函数
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
let picUrl = data.data;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/author/updateBookPic",
|
url: "/author/updateBookPic",
|
||||||
@ -308,17 +316,13 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
$("#cover"+bookId).attr("src", picUrl);
|
||||||
location.reload();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
lock = false;
|
|
||||||
layer.alert(data.msg);
|
layer.alert(data.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
lock = false;
|
|
||||||
layer.alert('网络异常');
|
layer.alert('网络异常');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -114,9 +114,9 @@
|
|||||||
$('#txtComment').val($('#txtComment').val().substring(0, 1000));
|
$('#txtComment').val($('#txtComment').val().substring(0, 1000));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
searchComments(1, 20);
|
loadCommentList(1, 20);
|
||||||
|
|
||||||
function searchComments(curr, limit) {
|
function loadCommentList(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
@ -135,12 +135,15 @@
|
|||||||
"<div class=\"user_heads fl\" vals=\"389\">" +
|
"<div class=\"user_heads fl\" vals=\"389\">" +
|
||||||
"<img src=\""+(comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png')+"\" class=\"user_head\" alt=\"\">" +
|
"<img src=\""+(comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png')+"\" class=\"user_head\" alt=\"\">" +
|
||||||
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
|
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
|
||||||
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">"+(comment.createUserName.substr(0, 4) + "****" + comment.createUserName.substr(comment.createUserName.length - 3, 3))+"</li><li class=\"dec\">" +
|
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">"+(comment.createUserName)+"<span style='padding-left: 10px' class=\"other\">"+(comment.location ? comment.location + "读者" : '')+"</span></li><li class=\"dec\">" +
|
||||||
comment.commentContent+
|
comment.commentContent+
|
||||||
"</li><li class=\"other cf\">" +
|
"</li><li class=\"other cf\">" +
|
||||||
"<span class=\"time fl\">"+comment.createTime+"</span>" +
|
"<span class=\"time fl\">"+comment.createTime+"</span>" +
|
||||||
"<span class=\"fr\"><a href=\"javascript:void(0);\" onclick=\"javascript:BookDetail.AddAgreeTotal(77,this);\" class=\"zan\" style=\"display: none;\">赞<i class=\"num\">(0)</i></a>" +
|
"<span class=\"fr\"><a href=\"javascript:toggleCommentUnLike('"+comment.id+"')\" class=\"zan\" style=\"padding-left: 10px\">踩<i class=\"num\" id='unLikeCount"+comment.id+"'>("+comment.unLikesCount+")</i></a></span>" +
|
||||||
"</span></li>\t\t</ul>\t</div>");
|
"<span class=\"fr\"><a href=\"javascript:toggleCommentLike('"+comment.id+"')\" class=\"zan\" style=\"padding-left: 10px\">赞<i class=\"num\" id='likeCount"+comment.id+"'>("+comment.likesCount+")</i></a></span>" +
|
||||||
|
"<span class=\"fr\"><a href=\"/book/reply-"+comment.id+".html\" class=\"zan\" style=\"padding-left: 10px\">回复<i class=\"num\">("+comment.replyCount+
|
||||||
|
")</i></a></span>" +
|
||||||
|
"</li>\t\t</ul>\t</div>");
|
||||||
}
|
}
|
||||||
$("#commentPanel").html(commentListHtml);
|
$("#commentPanel").html(commentListHtml);
|
||||||
|
|
||||||
@ -185,6 +188,56 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleCommentLike(commentId) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/book/toggleCommentLike",
|
||||||
|
data: {'commentId': commentId},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
$("#likeCount"+commentId).text("("+data.data+")")
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCommentUnLike(commentId) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/book/toggleCommentUnLike",
|
||||||
|
data: {'commentId': commentId},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
$("#unLikeCount"+commentId).text("("+data.data+")")
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -22,21 +22,23 @@
|
|||||||
|
|
||||||
<div class="main box_center cf mb50">
|
<div class="main box_center cf mb50">
|
||||||
<div class="nav_sub">
|
<div class="nav_sub">
|
||||||
<a href="/" th:text="${application.website.name}"></a>><a th:href="'/book/bookclass.html?c='+${book.catId}" th:text="${book.catName}"></a>><a
|
<a href="/" th:text="${application.website.name}"></a>><a th:href="'/book/bookclass.html?c='+${book.catId}"
|
||||||
|
th:text="${book.catName}"></a>><a
|
||||||
th:href="'/book/'+${book.id}+'.html'" th:utext="${book.bookName}"></a>
|
th:href="'/book/'+${book.id}+'.html'" th:utext="${book.bookName}"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="channelWrap channelBookInfo cf">
|
<div class="channelWrap channelBookInfo cf">
|
||||||
<div class="bookCover cf">
|
<div class="bookCover cf">
|
||||||
<a th:href="${book.picUrl}" class="book_cover"><img class="cover" th:src="${book.picUrl}"
|
<a th:href="${book.picUrl}" class="book_cover"><img class="cover" th:src="${book.picUrl}"
|
||||||
th:attr="alt=${book.bookName}"/></a>
|
th:attr="alt=${book.bookName}"/></a>
|
||||||
<div class="book_info">
|
<div class="book_info">
|
||||||
<div class="tit">
|
<div class="tit">
|
||||||
<h1 th:utext="${book.bookName}"></h1><!--<i class="vip_b">VIP</i>--><a class="author"
|
<h1 th:utext="${book.bookName}"></h1><!--<i class="vip_b">VIP</i>--><a class="author"
|
||||||
th:utext="${book.authorName}+' 著'"></a>
|
th:utext="${book.authorName}+' 著'"></a>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li><span class="item">类别:<em th:text="${book.catName}"></em></span>
|
<li><span class="item">类别:<em th:text="${book.catName}"></em></span>
|
||||||
<span class="item" th:switch="${book.bookStatus}">状态:<em th:case="'0'">连载中</em><em th:case="*">已完结</em></span>
|
<span class="item" th:switch="${book.bookStatus}">状态:<em th:case="'0'">连载中</em><em
|
||||||
|
th:case="*">已完结</em></span>
|
||||||
<span class="item">总点击:<em id="cTotal" th:text="${book.visitCount}"></em></span>
|
<span class="item">总点击:<em id="cTotal" th:text="${book.visitCount}"></em></span>
|
||||||
<span class="item">总字数:<em th:text="${book.wordCount}"></em></span></li>
|
<span class="item">总字数:<em th:text="${book.wordCount}"></em></span></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -70,7 +72,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="list cf">
|
<ul class="list cf">
|
||||||
<li>
|
<li>
|
||||||
<span class="fl font16"> <a th:href="'/book/'+${book.id}+'/'+${book.lastIndexId}+'.html'" th:utext="${book.lastIndexName}"><!--<i class="vip">VIP</i>--></a></span>
|
<span class="fl font16"> <a
|
||||||
|
th:href="'/book/'+${book.id}+'/'+${book.lastIndexId}+'.html'"
|
||||||
|
th:utext="${book.lastIndexName}"><!--<i class="vip">VIP</i>--></a></span>
|
||||||
<span class="black9 fr"
|
<span class="black9 fr"
|
||||||
th:text="'更新时间:'+${#dates.format(book.lastIndexUpdateTime, 'yy/MM/dd HH:mm:ss')}"></span>
|
th:text="'更新时间:'+${#dates.format(book.lastIndexUpdateTime, 'yy/MM/dd HH:mm:ss')}"></span>
|
||||||
</li>
|
</li>
|
||||||
@ -86,21 +90,46 @@
|
|||||||
<div class="bookComment">
|
<div class="bookComment">
|
||||||
<div class="book_tit">
|
<div class="book_tit">
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<h3>作品评论区</h3><span id="bookCommentTotal" th:text="'('+${bookCommentPageBean.total}+'条)'"></span>
|
<h3>作品评论区</h3><span id="bookCommentTotal"
|
||||||
|
th:text="'('+${bookCommentPageBean.total}+'条)'"></span>
|
||||||
</div>
|
</div>
|
||||||
<a class="fr" href="#txtComment">发表评论</a>
|
<a class="fr" href="#txtComment">发表评论</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="no_comment" id="noCommentPanel" th:style="${bookCommentPageBean.total > 0}? 'display:none'" >
|
<div class="no_comment" id="noCommentPanel"
|
||||||
|
th:style="${bookCommentPageBean.total > 0}? 'display:none'">
|
||||||
<img src="/images/no_comment.png" alt=""/>
|
<img src="/images/no_comment.png" alt=""/>
|
||||||
<span class="block">暂无评论</span>
|
<span class="block">暂无评论</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="commentBar" id="commentPanel" th:style="${bookCommentPageBean.total == 0}? 'display:none'">
|
<div class="commentBar" id="commentPanel"
|
||||||
<div th:each="comment: ${bookCommentPageBean.list}" class="comment_list cf"><div class="user_heads fl" vals="389"><img th:src="${comment.createUserPhoto}?${comment.createUserPhoto}:'/images/man.png'" class="user_head" alt=""><span class="user_level1" style="display: none;">见习</span></div><ul class="pl_bar fr"> <li class="name" th:text="${#strings.substring(comment.createUserName,0,4)}+'****'+${#strings.substring(comment.createUserName,#strings.length(comment.createUserName)-3,#strings.length(comment.createUserName))}"></li><li class="dec" th:utext="${comment.commentContent}"></li><li class="other cf"><span class="time fl" th:text="${#calendars.format(comment.createTime, 'yyyy-MM-dd HH:mm:ss')}"></span><span class="fr"><a href="javascript:void(0);" onclick="javascript:BookDetail.AddAgreeTotal(77,this);" class="zan" style="display: none;">赞<i class="num">(0)</i></a></span></li> </ul> </div>
|
th:style="${bookCommentPageBean.total == 0}? 'display:none'">
|
||||||
|
<div th:each="comment: ${bookCommentPageBean.list}" class="comment_list cf">
|
||||||
|
<div class="user_heads fl" vals="389"><img
|
||||||
|
th:src="${comment.createUserPhoto}?${comment.createUserPhoto}:'/images/man.png'"
|
||||||
|
class="user_head" alt=""><span class="user_level1"
|
||||||
|
style="display: none;">见习</span></div>
|
||||||
|
<ul class="pl_bar fr">
|
||||||
|
<li class="name"><span
|
||||||
|
th:text="${#strings.substring(comment.createUserName,0,4)}+'****'+${#strings.substring(comment.createUserName,#strings.length(comment.createUserName)-3,#strings.length(comment.createUserName))}"></span><span
|
||||||
|
style="padding-left: 10px" class="other" th:if="${comment.location}"
|
||||||
|
th:text="${comment.location} + '读者'"></span></span></li>
|
||||||
|
<li class="dec" th:utext="${comment.commentContent}"></li>
|
||||||
|
<li class="other cf"><span class="time fl"
|
||||||
|
th:text="${comment.createTimeFormat}"></span><span
|
||||||
|
class="fr"><a th:href="'javascript:toggleCommentUnLike(\''+${comment.id}+'\')'" onclick="javascript:;" class="zan"
|
||||||
|
style="padding-left: 10px">踩<i class="num" th:id="'unLikeCount'+${comment.id}">([[${comment.unLikesCount}]])</i></a></span><span
|
||||||
|
class="fr"><a th:href="'javascript:toggleCommentLike(\''+${comment.id}+'\')'" class="zan"
|
||||||
|
style="padding-left: 10px">赞<i class="num" th:id="'likeCount'+${comment.id}">([[${comment.likesCount}]])</i></a></span><span
|
||||||
|
class="fr"><a th:href="'/book/reply-'+${comment.id}+'.html'" class="zan"
|
||||||
|
style="padding-left: 10px">回复<i class="num">([[${comment.replyCount}]])</i></a></span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--无评论时此处隐藏-->
|
<!--无评论时此处隐藏-->
|
||||||
<div class="more_bar" id="moreCommentPanel" th:style="${bookCommentPageBean.total == 0}? 'display:none'">
|
<div class="more_bar" id="moreCommentPanel"
|
||||||
|
th:style="${bookCommentPageBean.total == 0}? 'display:none'">
|
||||||
<a th:href="'/book/comment-'+${book.id}+'.html'">查看全部评论></a>
|
<a th:href="'/book/comment-'+${book.id}+'.html'">查看全部评论></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -109,7 +138,7 @@
|
|||||||
<span class="fl font16">发表评论</span>
|
<span class="fl font16">发表评论</span>
|
||||||
<!--未登录状态下不可发表评论,显示以下链接-->
|
<!--未登录状态下不可发表评论,显示以下链接-->
|
||||||
<span class="fr black9" style="display:none; ">请先 <a class="orange"
|
<span class="fr black9" style="display:none; ">请先 <a class="orange"
|
||||||
href="/user/login.html">登录</a><em
|
href="/user/login.html">登录</a><em
|
||||||
class="ml10 mr10">|</em><a class="orange"
|
class="ml10 mr10">|</em><a class="orange"
|
||||||
href="/user/register.html">注册</a></span>
|
href="/user/register.html">注册</a></span>
|
||||||
</div>
|
</div>
|
||||||
@ -175,10 +204,12 @@
|
|||||||
<li th:each="book : ${recBooks}">
|
<li th:each="book : ${recBooks}">
|
||||||
<div class="book_intro">
|
<div class="book_intro">
|
||||||
<div class="cover">
|
<div class="cover">
|
||||||
<a th:href="'/book/'+${book.id}+'.html'"><img th:src="${book.picUrl}" th:alt="${book.bookName}"></a>
|
<a th:href="'/book/'+${book.id}+'.html'"><img th:src="${book.picUrl}"
|
||||||
|
th:alt="${book.bookName}"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="dec">
|
<div class="dec">
|
||||||
<a class="book_name" th:href="'/book/'+${book.id}+'.html'" th:text="${book.bookName}"></a>
|
<a class="book_name" th:href="'/book/'+${book.id}+'.html'"
|
||||||
|
th:text="${book.bookName}"></a>
|
||||||
<a class="txt" th:href="'/book/'+${book.id}+'.html'" th:utext="${book.bookDesc}">
|
<a class="txt" th:href="'/book/'+${book.id}+'.html'" th:utext="${book.bookDesc}">
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
@ -210,7 +241,7 @@
|
|||||||
var bookId = pathname.substring(pathname.lastIndexOf("/") + 1, pathname.lastIndexOf("."))
|
var bookId = pathname.substring(pathname.lastIndexOf("/") + 1, pathname.lastIndexOf("."))
|
||||||
//查询章节信息
|
//查询章节信息
|
||||||
var lastBookIndexId = $("#lastBookIndexId").val();
|
var lastBookIndexId = $("#lastBookIndexId").val();
|
||||||
if(lastBookIndexId){
|
if (lastBookIndexId) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: "/book/queryBookIndexAbout",
|
url: "/book/queryBookIndexAbout",
|
||||||
@ -232,7 +263,7 @@
|
|||||||
layer.alert('网络异常');
|
layer.alert('网络异常');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
$("#optBtn").remove();
|
$("#optBtn").remove();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -264,9 +295,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var currentBId = 37, spmymoney = 0;
|
var currentBId = 37, spmymoney = 0;
|
||||||
var relationStep = 0;
|
var relationStep = 0;
|
||||||
var authorUId = 8;
|
var authorUId = 8;
|
||||||
@ -283,7 +311,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#AuthorOtherNovel li").unbind("mouseover");
|
$("#AuthorOtherNovel li").unbind("mouseover");
|
||||||
|
|
||||||
$('#txtComment').on('input propertychange', function () {
|
$('#txtComment').on('input propertychange', function () {
|
||||||
@ -301,7 +328,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function loadCommentList(){
|
function loadCommentList() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: "/book/listCommentByPage",
|
url: "/book/listCommentByPage",
|
||||||
@ -311,20 +338,25 @@
|
|||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
var commentList = data.data.list;
|
var commentList = data.data.list;
|
||||||
if (commentList.length > 0) {
|
if (commentList.length > 0) {
|
||||||
$("#bookCommentTotal").html("("+data.data.total+"条)");
|
$("#bookCommentTotal").html("(" + data.data.total + "条)");
|
||||||
var commentListHtml = "";
|
var commentListHtml = "";
|
||||||
for (var i = 0; i < commentList.length; i++) {
|
for (var i = 0; i < commentList.length; i++) {
|
||||||
var comment = commentList[i];
|
var comment = commentList[i];
|
||||||
commentListHtml += ("<div class=\"comment_list cf\">" +
|
commentListHtml += ("<div class=\"comment_list cf\">" +
|
||||||
"<div class=\"user_heads fl\" vals=\"389\">" +
|
"<div class=\"user_heads fl\" vals=\"389\">" +
|
||||||
"<img src=\""+(comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png')+"\" class=\"user_head\" alt=\"\">" +
|
"<img src=\"" + (comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png') + "\" class=\"user_head\" alt=\"\">" +
|
||||||
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
|
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
|
||||||
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">"+(comment.createUserName)+"</li><li class=\"dec\">" +
|
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">" + (comment.createUserName) + "<span style='padding-left: 10px' class=\"other\">" + (comment.location ? comment.location + "读者" : '') + "</span></li><li class=\"dec\">" +
|
||||||
comment.commentContent+
|
comment.commentContent +
|
||||||
"</li><li class=\"other cf\">" +
|
"</li><li class=\"other cf\">" +
|
||||||
"<span class=\"time fl\">"+comment.createTime+"</span>" +
|
"<span class=\"time fl\">" + comment.createTime + "</span>" +
|
||||||
"<span class=\"fr\"><a href=\"javascript:void(0);\" onclick=\"javascript:BookDetail.AddAgreeTotal(77,this);\" class=\"zan\" style=\"display: none;\">赞<i class=\"num\">(0)</i></a>" +
|
"<span class=\"fr\"><a href=\"javascript:toggleCommentUnLike('"+comment.id+"')\" class=\"zan\" style=\"padding-left: 10px\">踩<i class=\"num\" id='unLikeCount"+comment.id+"'>("+comment.unLikesCount+")</i></a></span>" +
|
||||||
"</span></li>\t\t</ul>\t</div>");
|
"<span class=\"fr\"><a href=\"javascript:toggleCommentLike('"+comment.id+"')\" class=\"zan\" style=\"padding-left: 10px\">赞<i class=\"num\" id='likeCount"+comment.id+"'>("+comment.likesCount+")</i></a></span>" +
|
||||||
|
"<span class=\"fr\"><a href=\"/book/reply-"+comment.id+".html\" class=\"zan\" style=\"padding-left: 10px\">回复<i class=\"num\">("+comment.replyCount+
|
||||||
|
")</i></a></span>" +
|
||||||
|
"</li>\t\t</ul>\t</div>"
|
||||||
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
$("#commentPanel").html(commentListHtml);
|
$("#commentPanel").html(commentListHtml);
|
||||||
$("#noCommentPanel").hide();
|
$("#noCommentPanel").hide();
|
||||||
@ -348,6 +380,55 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
function toggleCommentLike(commentId) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/book/toggleCommentLike",
|
||||||
|
data: {'commentId': commentId},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
$("#likeCount"+commentId).text("("+data.data+")")
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCommentUnLike(commentId) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/book/toggleCommentUnLike",
|
||||||
|
data: {'commentId': commentId},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
$("#unLikeCount"+commentId).text("("+data.data+")")
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -965,3 +965,13 @@ i.vip_b {
|
|||||||
.userBox {
|
.userBox {
|
||||||
margin: 0 auto
|
margin: 0 auto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.layui-elem-quote {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
line-height: 1.8;
|
||||||
|
border-left: 5px solid #16b777;
|
||||||
|
border-radius: 0 2px 2px 0;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
Reference in New Issue
Block a user