From d4e8fb1cc758ffe25e1283fd320715f42da57bf5 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Fri, 25 Jul 2025 12:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../green/html/book/book_comment_reply.html | 216 ++++++++++++++++++ .../green/html/mobile/book/book_ranking.html | 25 +- templates/green/html/mobile/common/css.html | 9 + templates/green/html/mobile/index.html | 127 ++++++---- .../green/static/javascript/bookdetail.js | 46 ++++ 5 files changed, 367 insertions(+), 56 deletions(-) create mode 100644 templates/green/html/book/book_comment_reply.html diff --git a/templates/green/html/book/book_comment_reply.html b/templates/green/html/book/book_comment_reply.html new file mode 100644 index 0000000..0774fe5 --- /dev/null +++ b/templates/green/html/book/book_comment_reply.html @@ -0,0 +1,216 @@ + + + + + + + + + + + +
+
+ +
+
+ +
+
+
+ +
+
+
+

评论回复区

(0条) +
+ 发表回复 +
+
+
+ +
+ +
+
+
+ +
+
+ 发表回复 + + +
+ +
+ 0/1000 + 发表 +
+
+
+ +
+
+
+ + + + + +
+
+ +
+
+
+ + + + diff --git a/templates/green/html/mobile/book/book_ranking.html b/templates/green/html/mobile/book/book_ranking.html index f43f4ab..18de2e8 100644 --- a/templates/green/html/mobile/book/book_ranking.html +++ b/templates/green/html/mobile/book/book_ranking.html @@ -1,6 +1,4 @@ - - @@ -16,8 +14,6 @@
- - @@ -187,19 +192,19 @@ book.bookDesc = book.bookDesc.replace(/<[^>]+>/g, "").replace(/\s+/g, "").replace(/ /g, ""); } - bookListHtml += ("
\n" + + bookListHtml += ("
\n" + " \n" + - "
\n" + - " \n" + + " \n" + "\n" + "
\n" + "
\n" + - "
\n" + + "
\n" + " \n" + "
" + book.bookName + "
\n" + "
\n" + - "
\n" + + "
\n" + " \n" + "
作者:" + book.authorName + "
\n" + "
\n" + @@ -207,7 +212,7 @@ "
状态:" + (book.bookStatus == 0 ? '连载' : '完结') + "
\n" + "
更新:" + book.lastIndexUpdateTime.substr(0, 11) + "\n" + "
\n" + - "
简介:" + (book.bookDesc ? (book.bookDesc.length > 15 ? (book.bookDesc.substr(0, 15) + "...") : book.bookDesc) : book.bookDesc) + "
\n" + + "
简介:" + (book.bookDesc) + "
\n" + "\n" + "\n" + "
\n" + diff --git a/templates/green/html/mobile/common/css.html b/templates/green/html/mobile/common/css.html index e40c070..a6da973 100644 --- a/templates/green/html/mobile/common/css.html +++ b/templates/green/html/mobile/common/css.html @@ -26,6 +26,15 @@ } } + .book_name { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + white-space: pre-wrap; + } + #footer { position: absolute; bottom: 0px; diff --git a/templates/green/html/mobile/index.html b/templates/green/html/mobile/index.html index 0cc9db3..799ca61 100644 --- a/templates/green/html/mobile/index.html +++ b/templates/green/html/mobile/index.html @@ -53,6 +53,44 @@ color: #3eaf7c; } + .container { + display: flex; + overflow-x: auto; /* 允许内容水平滚动 */ + white-space: nowrap; /* 禁止换行 */ + scroll-snap-type: x mandatory; /* 在滚动时强制对齐 snap-points */ + -ms-overflow-style: none; /* Internet Explorer 10+ */ + scrollbar-width: none; /* Firefox */ + } + + .container::-webkit-scrollbar { + width: 0; + height: 0; + } + + .container::-webkit-scrollbar-track, + .container::-webkit-scrollbar-thumb { + display: none; + } + + + .item { + flex: 0 0 calc(100% / 10); /* 每个元素宽度为容器的十分之一 */ + scroll-snap-align: start; + box-sizing: border-box; + text-align: center; + border-radius: 5px; + margin-right: 5px; + } + + .book_desc { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + white-space: pre-wrap; + } + @@ -107,60 +145,58 @@ 精品推荐 +
- -
-
- 热门推荐 -
- - - -
+
+
+
+ 热门推荐 +
+ +
+ + +
+
@@ -184,7 +220,6 @@
-
@@ -226,7 +261,7 @@ "\n" + "
\n" + "
简介:  " + updateRankBook.bookDesc + "" + + " class=\"layui-elip layui-col-md11 layui-col-sm11 layui-col-lg11\">简介:" + updateRankBook.bookDesc + "" + "
\n" + "
"); diff --git a/templates/green/static/javascript/bookdetail.js b/templates/green/static/javascript/bookdetail.js index 3f6acd3..7760961 100644 --- a/templates/green/static/javascript/bookdetail.js +++ b/templates/green/static/javascript/bookdetail.js @@ -133,6 +133,52 @@ }) + }, + + SaveCommentReply: function (cmtBId, cmtCId, cmtDetail) { + if (!isLogin) { + layer.alert('请先登录'); + return; + } + var cmtDetailTemp = cmtDetail.replace(/(^\s*)/g, ""); + if (cmtDetailTemp == '') { + layer.alert('回复内容必须填写'); + return; + } + if (cmtDetailTemp.length < 5) { + layer.alert('回复内容必须大于5个字'); + return; + } + if (cmtDetail.length < 5) { + layer.alert('回复内容必须大于5个字'); + return; + } + $.ajax({ + type: "POST", + url: "/book/addCommentReply", + data: {'commentId': $("#commentId").val(), 'replyContent': cmtDetail}, + dataType: "json", + success: function (data) { + if (data.code == 200) { + $('#txtComment').val("") + layer.alert('回复成功!'); + loadCommentList(1, 20); + + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { + layer.alert(data.msg); + } + + }, + error: function () { + layer.alert('网络异常'); + } + }) + + }, GetFavoritesBook: function (BId) { },