mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
perf: 手机端页面优化
This commit is contained in:
parent
4c9f39ab19
commit
05d65c19a7
@ -5,6 +5,7 @@ var needLoginPath = ['/user/favorites.html','/user/comment.html','/user/feedback
|
|||||||
"/author/register.html", "/author/index.html"];
|
"/author/register.html", "/author/index.html"];
|
||||||
var isLogin = false;
|
var isLogin = false;
|
||||||
var url = window.location.search;
|
var url = window.location.search;
|
||||||
|
|
||||||
//key(需要检索的键)
|
//key(需要检索的键)
|
||||||
function getSearchString(key) {
|
function getSearchString(key) {
|
||||||
var str = url;
|
var str = url;
|
||||||
@ -20,6 +21,7 @@ function getSearchString(key) {
|
|||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
var keyword = getSearchString("k");
|
var keyword = getSearchString("k");
|
||||||
if (keyword != undefined) {
|
if (keyword != undefined) {
|
||||||
$("#searchKey").val(keyword);
|
$("#searchKey").val(keyword);
|
||||||
@ -34,6 +36,7 @@ function searchByK(k){
|
|||||||
window.location.href = '/book/bookclass.html?k=' + encodeURIComponent(k)
|
window.location.href = '/book/bookclass.html?k=' + encodeURIComponent(k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#searchKey").keypress(function (even) {
|
$("#searchKey").keypress(function (even) {
|
||||||
if (even.which == 13) {
|
if (even.which == 13) {
|
||||||
even.stopPropagation();
|
even.stopPropagation();
|
||||||
@ -115,8 +118,10 @@ if(!token){
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
$(".user_link").html("<a href=\"/user/userinfo.html\">"+(data.data.nickName.substring(0,3))+"...</a> <a href=\"javascript:logout()\">退出</a>");
|
$(".user_link").html("<a href=\"/user/userinfo.html\"><i style=\"font-size: 20px;\" class=\"layui-icon \n" +
|
||||||
;
|
"\">" +
|
||||||
|
"\n" +
|
||||||
|
"</i></a>");
|
||||||
if ("/user/login.html" == window.location.pathname) {
|
if ("/user/login.html" == window.location.pathname) {
|
||||||
var orginUrl = getSearchString("originUrl");
|
var orginUrl = getSearchString("originUrl");
|
||||||
window.location.href = orginUrl == undefined || orginUrl.isBlank() ? "/" : orginUrl;
|
window.location.href = orginUrl == undefined || orginUrl.isBlank() ? "/" : orginUrl;
|
||||||
@ -148,7 +153,6 @@ function logout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function readHistory() {
|
function readHistory() {
|
||||||
|
|
||||||
var books = localStorage.getItem("historyBooks");
|
var books = localStorage.getItem("historyBooks");
|
||||||
|
@ -45,10 +45,11 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
padding: 0 20px;
|
padding: 0 5px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user_link a {
|
.user_link a {
|
||||||
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -187,7 +188,8 @@
|
|||||||
|
|
||||||
<div class="layui-container">
|
<div class="layui-container">
|
||||||
<div class="layui-row" id="hotRecBooks" th:if="${bookMap['3']}">
|
<div class="layui-row" id="hotRecBooks" th:if="${bookMap['3']}">
|
||||||
<div th:each="book,iterStat : ${bookMap['3']}" th:if="${iterStat.index<6}" style="margin-bottom: 5px" class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg4">
|
<div th:each="book,iterStat : ${bookMap['3']}" th:if="${iterStat.index<6}" style="margin-bottom: 5px"
|
||||||
|
class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg4">
|
||||||
<a th:href="'/book/'+${book.bookId}+'.html'">
|
<a th:href="'/book/'+${book.bookId}+'.html'">
|
||||||
<div class="layui-col-xs5 layui-col-sm4 layui-col-md4 layui-col-lg4">
|
<div class="layui-col-xs5 layui-col-sm4 layui-col-md4 layui-col-lg4">
|
||||||
<img style=" width:100px; height:125px;" th:src="${book.picUrl}">
|
<img style=" width:100px; height:125px;" th:src="${book.picUrl}">
|
||||||
@ -195,11 +197,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs5 layui-col-sm6 layui-col-md6 layui-col-lg6">
|
<div class="layui-col-xs5 layui-col-sm6 layui-col-md6 layui-col-lg6">
|
||||||
<ul>
|
<ul>
|
||||||
<li style="padding-bottom: 2px" class="line-limit-length" th:text="${book.bookName}"></li>
|
<li style="padding-bottom: 2px" class="line-limit-length"
|
||||||
|
th:text="${book.bookName}"></li>
|
||||||
<li style="padding-bottom: 2px;color: #a6a6a6" th:text="'作者:'+${book.authorName}"></li>
|
<li style="padding-bottom: 2px;color: #a6a6a6" th:text="'作者:'+${book.authorName}"></li>
|
||||||
<li style="color: #a6a6a6;width: 180px;height:60px;overflow: hidden" th:utext="${book.bookDesc}"> </li></ul>
|
<li style="color: #a6a6a6;width: 180px;height:60px;overflow: hidden"
|
||||||
|
th:utext="${book.bookDesc}"></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-style: italic;color: red" class="layui-col-xs2 layui-col-sm2 layui-col-md2 layui-col-lg2"></div>
|
<div style="font-style: italic;color: red"
|
||||||
|
class="layui-col-xs2 layui-col-sm2 layui-col-md2 layui-col-lg2"></div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -87,7 +87,22 @@
|
|||||||
|
|
||||||
<div class="layui-container" style="padding: 50px;text-align: center">
|
<div class="layui-container" style="padding: 50px;text-align: center">
|
||||||
<img id="imgLogo" class="user_big_head" src="/images/man.png">
|
<img id="imgLogo" class="user_big_head" src="/images/man.png">
|
||||||
<div id="my_name" style="padding: 10px;font-size: 18px">梦入神机</div>
|
<div style="padding: 10px;font-size: 18px"><span id="my_name">梦入神机</span>
|
||||||
|
<svg id="boyIcon" style="display: none" t="1693635090733" class="icon" viewBox="0 0 1024 1024"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
p-id="8815" width="15" height="15">
|
||||||
|
<path d="M872.335 421.516V151.71H602.528L702.949 252.13 601.4 353.68c-46.47-32.81-103.174-52.091-164.385-52.091-157.595 0-285.351 127.756-285.351 285.35S279.421 872.29 437.014 872.29s285.352-127.755 285.352-285.35c0-57.78-17.19-111.537-46.711-156.47l102.818-102.814 93.862 93.861zM437.015 782.18c-107.827 0-195.24-87.413-195.24-195.24s87.413-195.24 195.24-195.24 195.24 87.413 195.24 195.24-87.413 195.24-195.24 195.24z"
|
||||||
|
fill="#1296DB" p-id="8816"></path>
|
||||||
|
</svg>
|
||||||
|
<svg id="girlIcon" style="display: none" t="1693635698738" class="icon" viewBox="0 0 1024 1024"
|
||||||
|
version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3685" width="15" height="15">
|
||||||
|
<path d="M513 636.1c-76.4 0-148.2-29.7-202.2-83.8-54-54-83.8-125.8-83.8-202.2s29.7-148.2 83.8-202.2c54-54 125.8-83.8 202.2-83.8s148.2 29.7 202.2 83.8c54 54 83.8 125.8 83.8 202.2s-29.7 148.2-83.8 202.2c-54 54.1-125.8 83.8-202.2 83.8z m0-515.9c-61.4 0-119.2 23.9-162.6 67.4C307 231 283 288.7 283 350.1s23.9 119.2 67.4 162.6 101.2 67.4 162.6 67.4 119.2-23.9 162.6-67.4S743 411.6 743 350.1 719 231 675.6 187.5c-43.4-43.4-101.2-67.3-162.6-67.3z"
|
||||||
|
fill="#d4237a" p-id="3686"></path>
|
||||||
|
<path d="M671.4 712.1H544.7v-104h-56v104H362c-15.5 0-28 12.5-28 28s12.5 28 28 28h126.7v163.3c0 15.5 12.5 28 28 28s28-12.5 28-28V768.1h126.7c15.5 0 28-12.5 28-28s-12.5-28-28-28z"
|
||||||
|
fill="#d4237a" p-id="3687"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
<div style="padding: 5px;">账户余额:<span id="accountBalance" style="color: #f80">3000</span> 屋币</div>
|
<div style="padding: 5px;">账户余额:<span id="accountBalance" style="color: #f80">3000</span> 屋币</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -217,6 +232,14 @@
|
|||||||
$("#my_name").html(data.data.username);
|
$("#my_name").html(data.data.username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.data.userSex === '0') {
|
||||||
|
$("#boyIcon").css("display", "inline")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.data.userSex === '1') {
|
||||||
|
$("#girlIcon").css("display", "inline")
|
||||||
|
}
|
||||||
|
|
||||||
$("#accountBalance").html(data.data.accountBalance);
|
$("#accountBalance").html(data.data.accountBalance);
|
||||||
|
|
||||||
} else if (data.code == 1001) {
|
} else if (data.code == 1001) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user