From dabfb9d1e83db9723d9f5b72a3b3bcac6996134b Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Sat, 13 May 2023 15:15:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=8B=E6=9C=BA=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../novel/controller/PageController.java | 8 + .../main/resources/static/mobile/js/common.js | 64 ++++++++ .../static/mobile/layui/css/layui.css | 6 +- .../templates/mobile/user/login.html | 148 +++++++++--------- 4 files changed, 153 insertions(+), 73 deletions(-) diff --git a/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java b/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java index f32f6d6..a50f89e 100644 --- a/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java +++ b/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java @@ -91,6 +91,14 @@ public class PageController extends BaseController { return ThreadLocalUtil.getTemplateDir() + "index"; } + /** + * 登录页 + */ + @RequestMapping("user/login.html") + public String login() { + return ThreadLocalUtil.getTemplateDir() + "user/login"; + } + /** * 作品页 */ diff --git a/novel-front/src/main/resources/static/mobile/js/common.js b/novel-front/src/main/resources/static/mobile/js/common.js index feea8a3..214592f 100644 --- a/novel-front/src/main/resources/static/mobile/js/common.js +++ b/novel-front/src/main/resources/static/mobile/js/common.js @@ -4,6 +4,49 @@ var needLoginPath = ['/user/favorites.html','/user/comment.html','/user/feedback "/pay/index.html," + "/author/register.html","/author/index.html"]; var isLogin = false; +var url = window.location.search; +//key(需要检索的键) +function getSearchString(key) { + var str = url; + str = str.substring(1, str.length); // 获取URL中?之后的字符(去掉第一位的问号) + // 以&分隔字符串,获得类似name=xiaoli这样的元素数组 + var arr = str.split("&"); + + for (var i = 0; i < arr.length; i++) { + var tmp_arr = arr[i].split("="); + if(tmp_arr[0] == key){ + return decodeURIComponent(tmp_arr[1]); + } + } + return undefined; +} +var keyword = getSearchString("k"); +if(keyword != undefined) { + $("#searchKey").val(keyword); + $("#workDirection").remove(); + $("#idGirl").remove(); +} + +function searchByK(k){ + if(!k){ + window.location.href='/book/bookclass.html?k='+encodeURIComponent(document.getElementById("searchKey").value) + }else{ + window.location.href='/book/bookclass.html?k='+encodeURIComponent(k) + } +} +$("#searchKey").keypress(function (even) { + if (even.which == 13) { + even.stopPropagation(); + //enter键按下 + searchByK(); + } +}); +Array.prototype.indexOf = function (val) { + for (var i = 0; i < this.length; i++) { + if (this[i] == val) return i; + } + return -1; +}; jQuery.cookie = function (name, value, options) { if (typeof value != 'undefined') { @@ -129,5 +172,26 @@ function getQueryVariable(variable) { return (false); } +String.prototype.isPhone = function () { + var strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/; + if (strTemp.test(this)) { + return true; + } + return false; +}; + +String.prototype.isBlank = function () { + if(this == null || $.trim(this) == ""){ + return true; + } + return false; +}; +String.prototype.isNickName = function () { + var strTemp = /^[\u4E00-\u9FA5A-Za-z0-9_]+$/; + if (strTemp.test(this)) { + return true; + } + return false; +}; diff --git a/novel-front/src/main/resources/static/mobile/layui/css/layui.css b/novel-front/src/main/resources/static/mobile/layui/css/layui.css index a7258a3..a42ab15 100644 --- a/novel-front/src/main/resources/static/mobile/layui/css/layui.css +++ b/novel-front/src/main/resources/static/mobile/layui/css/layui.css @@ -1847,7 +1847,7 @@ a cite { } .layui-btn-primary:hover { - border-color: #009688; + border-color: #f80; color: #333 } @@ -2230,11 +2230,11 @@ a cite { } .layui-form-checked span, .layui-form-checked:hover span { - background-color: #5FB878 + background-color: #f80 } .layui-form-checked i, .layui-form-checked:hover i { - color: #5FB878 + color: #f80 } .layui-form-item .layui-form-checkbox { diff --git a/novel-front/src/main/resources/templates/mobile/user/login.html b/novel-front/src/main/resources/templates/mobile/user/login.html index c2048ac..0a7b195 100644 --- a/novel-front/src/main/resources/templates/mobile/user/login.html +++ b/novel-front/src/main/resources/templates/mobile/user/login.html @@ -5,109 +5,117 @@ - 登录|注册 - -
+ 登录 +
- - - +
-
+
- +
- 登录|注册 -
- + 登录 +
+
- -
+ +
+

+
- -
- + +
+
- +
-
如果登录名不存在,则直接注册!
+
- + +
+
+
+
+
-
+
- - -
- - - - - + \ No newline at end of file