mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-06 01:06:39 +00:00
上传代码
This commit is contained in:
@ -0,0 +1 @@
|
||||
var authorInfoV3={"LogoImg":null,"Notes":null,"UId":0}
|
196
novel-front/src/main/resources/static/javascript/bookclass.js
Normal file
196
novel-front/src/main/resources/static/javascript/bookclass.js
Normal file
@ -0,0 +1,196 @@
|
||||
var bClass = {
|
||||
"total": 16,
|
||||
"rows": [{
|
||||
"BId": 1,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "玄幻",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 2,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "都市",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 3,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "仙侠",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 4,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "奇幻",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 5,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "历史",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 6,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "军事",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 7,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "游戏",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 8,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "竞技",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 9,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "科幻",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 10,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "武侠",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 11,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "同人",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 12,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "灵异",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 13,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "现代言情",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 14,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "古代言情",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 15,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "幻想言情",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}, {
|
||||
"BId": 16,
|
||||
"BookTotal": null,
|
||||
"ClassId": null,
|
||||
"IsShow": null,
|
||||
"Ld": null,
|
||||
"Name": "青春校园",
|
||||
"ParentId": null,
|
||||
"Rank": null,
|
||||
"Remark": null,
|
||||
"SexClass": null,
|
||||
"Status": null
|
||||
}]
|
||||
}
|
308
novel-front/src/main/resources/static/javascript/bookdetail.js
Normal file
308
novel-front/src/main/resources/static/javascript/bookdetail.js
Normal file
@ -0,0 +1,308 @@
|
||||
var BookDetail = {
|
||||
wepDomain: 'java2nb.com',
|
||||
msgStyle: 'background-color:#333; color:#fff; text-align:center; border:none; font-size:20px; padding:10px;',
|
||||
reShowCover: function () {
|
||||
//$(".cCover").height($(".cDetail").height());
|
||||
//$(".cCover").width($(".cDetail").width());
|
||||
},
|
||||
DescriptionMore: function (sClass) {
|
||||
if (sClass == "") {
|
||||
if ($("#pDesMore").html().length > 150) {
|
||||
$("#divDescription").html($("#pDesMore").html().substring(0, 150) + "<a href=\"javascript:void(0);\" class=\"info_txt_more\" onclick=\"javascript:BookDetail.DescriptionMore('down');\">展开<img src=\"../images/arrow_d.png\" /></a>");
|
||||
} else {
|
||||
$("#divDescription").html($("#pDesMore").html());
|
||||
}
|
||||
} else {
|
||||
$("#divDescription").html($("#pDesMore").html() + "<a href=\"javascript:void(0);\" class=\"info_txt_more\" onclick=\"javascript:BookDetail.DescriptionMore('');\">收起<img src=\"../images/arrow_t.png\" /></a>");
|
||||
}
|
||||
},
|
||||
AddFavorites: function (BId, CId, layerStatus) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/addToBookShelf",
|
||||
data: {'bookId': $("#bookId").val(), 'preContentId': $("#preContentId").val()},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
if (layerStatus == 1) {
|
||||
$("#cFavs").html("<a class=\"ico_shelf\" href=\"javascript:void(0);\"><b>已收藏</b></a>");
|
||||
jQuery.cookie("u-faorites", "1");
|
||||
}
|
||||
else {
|
||||
$("#cFavs").html("<a class=\"btn_ora_white btn_addsj\" href=\"javascript:void(0);\">已在书架</a>");
|
||||
}
|
||||
|
||||
|
||||
} else if (data.code == 1001) {
|
||||
//未登录
|
||||
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||
|
||||
} else {
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
})
|
||||
},
|
||||
GetFavorites: function (BId) {
|
||||
if (jQuery.cookie("u-faorites") == null) {
|
||||
} else {
|
||||
if (jQuery.cookie("u-faorites") == "1") {
|
||||
$("#cFavs").html("<a class=\"ico_shelf\" href=\"javascript:void(0);\"><b>已加书架</b></a>");
|
||||
}
|
||||
}
|
||||
/*BookDetail.SetWholeTip();*/
|
||||
},
|
||||
GetUserBookLevel: function (idList, bId) {
|
||||
if (idList.length > 2) {
|
||||
}
|
||||
},
|
||||
GetUserLevel: function (mTotal) {
|
||||
if (mTotal != undefined) {
|
||||
var iTotal = parseInt(mTotal);
|
||||
if (iTotal < 500) {
|
||||
return ["user_level1", "见习"];
|
||||
} else if (iTotal < 2000) {
|
||||
return ["user_level2", "学徒"];
|
||||
} else if (iTotal < 5000) {
|
||||
return ["user_level3", "弟子"];
|
||||
} else if (iTotal < 10000) {
|
||||
return ["user_level4", "执事"];
|
||||
} else if (iTotal < 20000) {
|
||||
return ["user_level5", "舵主"];
|
||||
} else if (iTotal < 30000) {
|
||||
return ["user_level6", "堂主"];
|
||||
} else if (iTotal < 40000) {
|
||||
return ["user_level7", "护法"];
|
||||
} else if (iTotal < 50000) {
|
||||
return ["user_level8", "长老"];
|
||||
} else if (iTotal < 70000) {
|
||||
return ["user_level9", "掌门"];
|
||||
} else if (iTotal < 100000) {
|
||||
return ["user_level10", "宗师"];
|
||||
} else {
|
||||
return ["user_level11", "盟主"];
|
||||
}
|
||||
} else {
|
||||
return ["user_level1", "见习"];
|
||||
}
|
||||
},
|
||||
SaveComment: 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/addBookComment",
|
||||
data: {'bookId': $("#bookId").val(), 'commentContent': cmtDetail},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
$('#txtComment').val("")
|
||||
layer.alert('评价成功!');
|
||||
loadCommentList();
|
||||
|
||||
} else if (data.code == 1001) {
|
||||
//未登录
|
||||
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||
|
||||
} else {
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
GetFavoritesBook: function (BId) {
|
||||
},
|
||||
GetMoneyFlower: function () {
|
||||
},
|
||||
AddAgreeTotal: function (AId, objs) {
|
||||
},
|
||||
RelationBook: function () {
|
||||
relationStep++;
|
||||
var bListCount = 0;
|
||||
var bList = $("#relationBookList div");
|
||||
bListCount = bList.length;
|
||||
var sStep = 0, eStep = 2;
|
||||
if (bListCount > relationStep * 3) {
|
||||
sStep = relationStep * 3;
|
||||
eStep = sStep + 2;
|
||||
if (sStep > bListCount - 1) {
|
||||
eStep = bListCount;
|
||||
}
|
||||
} else {
|
||||
relationStep = -1;
|
||||
}
|
||||
for (var i = 0; i < bListCount; i++) {
|
||||
if (i >= sStep && i <= eStep) {
|
||||
bList[i].style.display = "";
|
||||
} else {
|
||||
bList[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
},
|
||||
Click: function (bId) {
|
||||
//BookDetail.DescriptionMore("");
|
||||
},
|
||||
ClickChapter: function (bId, cId, isVip) {
|
||||
if (isVip == 1) {
|
||||
var m = Math.floor(6 * Math.random());
|
||||
if (m == 3) {
|
||||
}
|
||||
} else {
|
||||
}
|
||||
},
|
||||
SetReadFont: function (fonts) {
|
||||
var cFont = parseInt($("#cFonts").html());
|
||||
fonts = cFont + fonts;
|
||||
if (fonts < 8) {
|
||||
fonts = 8;
|
||||
}
|
||||
if (fonts > 48) {
|
||||
fonts = 48;
|
||||
}
|
||||
localStorage.setItem("fonts", fonts);
|
||||
$(".readBox").css("font-size", fonts + "px");
|
||||
$("#cFonts").html(fonts);
|
||||
$("#ChapterBody").attr("class","article-content font"+fonts);
|
||||
BookDetail.reShowCover();
|
||||
},
|
||||
SetBackUpColor: function (colorNum) {
|
||||
localStorage.setItem("colorNum", colorNum);
|
||||
document.body.className = 'read_style_' + colorNum;
|
||||
|
||||
},
|
||||
SetReadFontFamily: function (fontNum) {
|
||||
localStorage.setItem("fontNum", fontNum);
|
||||
BookDetail.SetReadFontFamilyClear(fontNum);
|
||||
},
|
||||
SetReadFontFamilyClear: function (fontNum) {
|
||||
$("#setup_font_yahei").removeClass("current");
|
||||
$("#setup_font_simsun").removeClass("current");
|
||||
$("#setup_font_ks").removeClass("current");
|
||||
if (fontNum == 1) {
|
||||
$("#setup_font_simsun").addClass("current");
|
||||
$(".readBox").css("font-family", "Simsun");
|
||||
} else if (fontNum == 2) {
|
||||
$("#setup_font_ks").addClass("current");
|
||||
$(".readBox").css("font-family", "kaiti");
|
||||
} else {
|
||||
$("#setup_font_yahei").addClass("current");
|
||||
$(".readBox").css("font-family", "microsoft yahei");
|
||||
}
|
||||
},
|
||||
GetReadSet: function (bid, cid, preId, nextId, crank) {
|
||||
/*$(".nextPageBox .prev,.ico_pagePrev").click(function () {
|
||||
if (preId > 0) {
|
||||
location.href = '/book/' + bid + '/' + preId + '.html';
|
||||
}
|
||||
else {
|
||||
location.href = '/book/chapterlist-' + bid + '.html';
|
||||
}
|
||||
});
|
||||
|
||||
$(".nextPageBox .next,.ico_pageNext").click(function () {
|
||||
if (nextId > 0) {
|
||||
location.href = '/book/' + bid + '/' + nextId + '.html';
|
||||
}
|
||||
else {
|
||||
location.href = '/book/chapterlist-' + bid + '.html';
|
||||
}
|
||||
});*/
|
||||
$(window).bind('keydown',
|
||||
function (e) {
|
||||
if (e.keyCode == 37) {
|
||||
if (preId > 0) {
|
||||
location.href = '/book/' + bid + '/' + preId + '.html';
|
||||
} else {
|
||||
location.href = '/book/chapterlist-' + bid + '.html';
|
||||
}
|
||||
} else if (e.keyCode == 39) {
|
||||
if (nextId > 0) {
|
||||
location.href = '/book/' + bid + '/' + nextId + '.html';
|
||||
} else {
|
||||
location.href = '/book/chapterlist-' + bid + '.html';
|
||||
}
|
||||
}
|
||||
});
|
||||
BookDetail.SetReadHistory(bid, cid, crank);
|
||||
},
|
||||
SetReadHistory: function (bid, cid, crank) {
|
||||
var strHistory = jQuery.cookie("wapviewhistory");
|
||||
if (strHistory != null) {
|
||||
var r = new RegExp('b' + bid + '\\\|(.*?),', 'g');
|
||||
strHistory = strHistory.replace(r, '')
|
||||
strHistory = 'b' + bid + '|' + cid + '|' + crank + ',' + strHistory;
|
||||
if (strHistory.length > 500) {
|
||||
strHistory = strHistory.substring(0, 500);
|
||||
strHistory = strHistory.substring(0, strHistory.lastIndexOf(','));
|
||||
strHistory = strHistory + ',';
|
||||
}
|
||||
} else {
|
||||
strHistory = 'b' + bid + '|' + cid + '|' + crank + ',';
|
||||
}
|
||||
jQuery.cookie("wapviewhistory", strHistory, {path: '/', domain: BookDetail.wepDomain, expires: 365});
|
||||
},
|
||||
formatDate: function (now, types) {
|
||||
if (now != null && now != "") {
|
||||
var dateN = new Date(+/\d+/.exec(now)[0]);
|
||||
var year = dateN.getFullYear();
|
||||
var month = dateN.getMonth() + 1;
|
||||
var date = dateN.getDate();
|
||||
var hour = dateN.getHours();
|
||||
var minute = dateN.getMinutes();
|
||||
var second = dateN.getSeconds();
|
||||
if (typeof (types) != "undefined" && types != null) {
|
||||
return year + "-" + month + "-" + date;
|
||||
} else if (hour == 0 && minute == 0 && second == 0) {
|
||||
return year + "-" + month + "-" + date;
|
||||
} else {
|
||||
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
SetWholeTip: function () {
|
||||
var str = '<li>1、此书为全网优质作品,按照整本定价折扣销售,购买之后可以阅读该书全部章节。</li>';
|
||||
str += '<li>2、支付屋币即可阅读收费章节,没有屋币的需要先充值。</li>';
|
||||
str += '<li>3、QQ、微信、微博3种账号之间的数据不互通,如果你发现充值成功但没有屋币到账,请切换账号查看是否充到了别的账号中。</li>';
|
||||
if ($("#HidIsWholeBook").val() == "1") {
|
||||
$(".tip_list").html(str);
|
||||
}
|
||||
},
|
||||
SetDZChapter: function (bId, cId, isDianZan) {
|
||||
if (isDianZan == 1) {
|
||||
/*是点赞,设置点赞数+1和不可点状态*/
|
||||
var dzData = parseInt($("#read_dz_bar a").text()) + 1;
|
||||
$("#read_dz_bar").html('<a class="read_dz on" href="javascript:void(0)"><i></i>' + dzData + '</a>');
|
||||
}
|
||||
}
|
||||
}
|
||||
var rand = {};
|
||||
rand.get = function (begin, end) {
|
||||
return Math.floor(Math.random() * (end - begin)) + begin;
|
||||
}
|
125
novel-front/src/main/resources/static/javascript/common.js
Normal file
125
novel-front/src/main/resources/static/javascript/common.js
Normal file
@ -0,0 +1,125 @@
|
||||
var needLoginPath = ['/user/favorites.html','/user/comment.html','/user/feedback.html',
|
||||
'/user/feedback_list.html','/user/read_history.html','/user/set_name.html',
|
||||
'/user/set_password.html','/user/set_sex.html','/user/setup.html','/user/userinfo.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;
|
||||
};
|
||||
|
||||
|
||||
var token = $.cookie('Authorization');
|
||||
if(!token){
|
||||
if(needLoginPath.indexOf(window.location.pathname) != -1){
|
||||
location.href = '/user/login.html?originUrl='+decodeURIComponent(location.href);
|
||||
}
|
||||
|
||||
$(".user_link").html("<i class=\"line mr20\">|</i><a href=\"/user/login.html\" class=\"mr15\">登录</a><a href=\"/user/register.html\" >注册</a>");
|
||||
}else{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/refreshToken",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.code == 200){
|
||||
$(".user_link").html("<i class=\"line mr20\">|</i>" +
|
||||
"<a href=\"/user/userinfo.html\" class=\"mr15\">"+data.data.username+"</a>" +
|
||||
"<a href=\"javascript:logout()\" >退出</a>");
|
||||
;
|
||||
if("/user/login.html" == window.location.pathname){
|
||||
var orginUrl = getSearchString("originUrl");
|
||||
window.location.href = orginUrl == undefined || orginUrl.isBlank() ? "/" : orginUrl;
|
||||
return;
|
||||
}
|
||||
isLogin = true;
|
||||
if(localStorage.getItem("autoLogin") == 1){
|
||||
$.cookie('Authorization', data.data.token, { expires: 7 ,path: '/' });
|
||||
}else {
|
||||
$.cookie('Authorization', data.data.token,{ path: '/' });
|
||||
}
|
||||
}else{
|
||||
if(needLoginPath.indexOf(window.location.pathname) != -1){
|
||||
location.href = '/user/login.html';
|
||||
}
|
||||
$(".user_link").html("<i class=\"line mr20\">|</i><a href=\"/user/login.html\" class=\"mr15\">登录</a><a href=\"/user/register.html\" >注册</a>");
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function logout() {
|
||||
$.cookie('Authorization', null,{ path: '/' });
|
||||
location.reload();
|
||||
}
|
153
novel-front/src/main/resources/static/javascript/header.js
Normal file
153
novel-front/src/main/resources/static/javascript/header.js
Normal file
@ -0,0 +1,153 @@
|
||||
var $C = function (objName) {
|
||||
if (typeof (document.getElementById(objName)) != "object")
|
||||
{ return null; }
|
||||
else
|
||||
{ return document.getElementById(objName); }
|
||||
}
|
||||
jQuery.cookie = function (name, value, options) {
|
||||
if (typeof value != 'undefined') {
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString();
|
||||
}
|
||||
var path = options.path ? '; path=' + options.path : '';
|
||||
var domain = options.domain ? '; domain=' + options.domain : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else {
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
||||
$(function () {
|
||||
|
||||
|
||||
$(".rightList li").mouseover(function () {
|
||||
//$($(this).parent()).children().each(function () {
|
||||
// $(this).removeClass("on");
|
||||
//});
|
||||
//$(this).addClass("on");
|
||||
});
|
||||
$(".rightList_nobor li").mouseover(function () {
|
||||
$($(this).parent()).children().each(function () {
|
||||
$(this).addClass("on");
|
||||
});
|
||||
});
|
||||
|
||||
$("#headerUserHistoryBtn").mouseover(function () {
|
||||
HeaderShowUtil.headerShowHistory();
|
||||
});
|
||||
$("#headerUserHistory").mouseleave(function () {
|
||||
HeaderShowUtil.headerHideHistory();
|
||||
});
|
||||
});
|
||||
function getNote() {
|
||||
}
|
||||
function goPage(cpage) {
|
||||
location.href = '?page=' + cpage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isWeiXin() {
|
||||
var ua = window.navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var HeaderShowUtil = {
|
||||
headerShowHistory: function (obj) {
|
||||
if ($("#headerUserHistory").html().length < 10) {
|
||||
var rStr = '<div class="record_box">';
|
||||
rStr += ' <div class="record_title" id="hdShowTitle"><a href="javascript:void(0);" class="record_tit1 on" onclick="javascript:HeaderShowUtil.headerShowHistoryLog(this);">最近阅读</a><a href="javascript:void(0);" class="record_tit2" onclick="javascript:HeaderShowUtil.headerShowFavLog(this);">我的书架</a></div>';
|
||||
rStr += ' <div class="record_list record_list1" id="hdShowHistory">';
|
||||
rStr += ' <ul>';
|
||||
rStr += ' </ul>';
|
||||
rStr += ' <a class="all" href="/" >查看全部</a>';
|
||||
rStr += ' </div>';
|
||||
rStr += ' <div class="record_list record_list2" style="display:none" id="hsShowFav">';
|
||||
rStr += ' <ul>';
|
||||
rStr += ' </ul>';
|
||||
rStr += ' <a class="all" href="/" >查看全部</a>';
|
||||
rStr += ' </div>';
|
||||
rStr += ' <p class="sp"></p>';
|
||||
rStr += ' </div>';
|
||||
$("#headerUserHistory").html(rStr);
|
||||
}
|
||||
$("#headerUserHistory").show();
|
||||
$("#headerUserHistoryBtn").addClass("on");
|
||||
HeaderShowUtil.headerShowHistoryLog();
|
||||
},
|
||||
headerHideHistory: function () {
|
||||
$("#headerUserHistory").hide();
|
||||
$("#headerUserHistoryBtn").removeClass("on");
|
||||
},
|
||||
headerShowHistoryLog: function (obj) {
|
||||
if (obj != undefined) {
|
||||
$("#hdShowTitle a").removeClass("on");
|
||||
$(obj).addClass("on");
|
||||
$("#hdShowHistory").show();
|
||||
$("#hsShowFav").hide();
|
||||
}
|
||||
var cookieHistory = jQuery.cookie("wapviewhistory");
|
||||
if (cookieHistory != undefined && cookieHistory.length > 0) {
|
||||
var bList, bIdList;
|
||||
var bIdArray = new Array();
|
||||
var cookieList = cookieHistory.split(',');
|
||||
for (var i = 0; i < cookieList.length && i < 3; i++) {
|
||||
var str = cookieList[i];
|
||||
if (str.indexOf('|') > 0) {
|
||||
bList = str.split('|');
|
||||
if (bList.length == 3) {
|
||||
bIdList += ',' + bList[0].replace("b", "");
|
||||
bIdArray[bList[0].replace("b", "")] = bList[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
$("#hdShowHistory ul").html("<li>暂无看书历史</li>");
|
||||
}
|
||||
},
|
||||
headerShowFavLog: function (obj) {
|
||||
$("#hdShowTitle a").removeClass("on");
|
||||
$(obj).addClass("on");
|
||||
$("#hsShowFav").show();
|
||||
$("#hdShowHistory").hide();
|
||||
var rStr = '';
|
||||
var uname = jQuery.cookie("waplogname");
|
||||
if (uname != undefined && uname != "") {
|
||||
}
|
||||
else {
|
||||
rStr = '<li><a href="/user/login.html">请先登录</a></li>';
|
||||
$("#hsShowFav ul").html(rStr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
2
novel-front/src/main/resources/static/javascript/jquery-1.8.0.min.js
vendored
Normal file
2
novel-front/src/main/resources/static/javascript/jquery-1.8.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,2 @@
|
||||
/*! layer mobile-v1.6 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(a){"use strict";var b="";b=b?b:document.scripts[document.scripts.length-1].src.match(/[\s\S]*\//)[0];var c=document,d="querySelectorAll",e="getElementsByClassName",f=function(a){return c[d](a)};document.head.appendChild(function(){var a=c.createElement("link");return a.href=b+"need/layer.css",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}());var g={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:!0};a.ready={extend:function(a){var b=JSON.parse(JSON.stringify(g));for(var c in a)b[c]=a[c];return b},timer:{},end:{}},ready.touch=function(a,b){var c;return/Android|iPhone|SymbianOS|Windows Phone|iPad|iPod/.test(navigator.userAgent)?(a.addEventListener("touchmove",function(){c=!0},!1),void a.addEventListener("touchend",function(a){a.preventDefault(),c||b.call(this,a),c=!1},!1)):void a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layermbox"],j=function(a){var b=this;b.config=ready.extend(a),b.view()};j.prototype.view=function(){var a=this,b=a.config,d=c.createElement("div");a.id=d.id=i[0]+h,d.setAttribute("class",i[0]+" "+i[0]+(b.type||0)),d.setAttribute("index",h);var g=function(){var a="object"==typeof b.title;return b.title?'<h3 style="'+(a?b.title[1]:"")+'">'+(a?b.title[0]:b.title)+'</h3><button class="layermend"></button>':""}(),j=function(){var a,c=(b.btn||[]).length;return 0!==c&&b.btn?(a='<span type="1">'+b.btn[0]+"</span>",2===c&&(a='<span type="0">'+b.btn[1]+"</span>"+a),'<div class="layermbtn">'+a+"</div>"):""}();if(b.fixed||(b.top=b.hasOwnProperty("top")?b.top:100,b.style=b.style||"",b.style+=" top:"+(c.body.scrollTop+b.top)+"px"),2===b.type&&(b.content='<i></i><i class="laymloadtwo"></i><i></i><div>'+(b.content||"")+"</div>"),d.innerHTML=(b.shade?"<div "+("string"==typeof b.shade?'style="'+b.shade+'"':"")+' class="laymshade"></div>':"")+'<div class="layermmain" '+(b.fixed?"":'style="position:static;"')+'><div class="section"><div class="layermchild '+(b.className?b.className:"")+" "+(b.type||b.shade?"":"layermborder ")+(b.anim?"layermanim":"")+'" '+(b.style?'style="'+b.style+'"':"")+">"+g+'<div class="layermcont">'+b.content+"</div>"+j+"</div></div></div>",!b.type||2===b.type){var l=c[e](i[0]+b.type),m=l.length;m>=1&&k.close(l[0].getAttribute("index"))}document.body.appendChild(d);var n=a.elem=f("#"+a.id)[0];b.success&&b.success(n),a.index=h++,a.action(b,n)},j.prototype.action=function(a,b){var c=this;if(a.time&&(ready.timer[c.index]=setTimeout(function(){k.close(c.index)},1e3*a.time)),a.title){var d=b[e]("layermend")[0],f=function(){a.cancel&&a.cancel(),k.close(c.index)};ready.touch(d,f)}var g=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),k.close(c.index)):a.yes?a.yes(c.index):k.close(c.index)};if(a.btn)for(var h=b[e]("layermbtn")[0].children,i=h.length,j=0;i>j;j++)ready.touch(h[j],g);if(a.shade&&a.shadeClose){var l=b[e]("laymshade")[0];ready.touch(l,function(){k.close(c.index,a.end)})}a.end&&(ready.end[c.index]=a.end)};var k={v:"1.6",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var b=f("#"+i[0]+a)[0];b&&(b.innerHTML="",c.body.removeChild(b),clearTimeout(ready.timer[a]),delete ready.timer[a],"function"==typeof ready.end[a]&&ready.end[a](),delete ready.end[a])},closeAll:function(){for(var a=c[e](i[0]),b=0,d=a.length;d>b;b++)k.close(0|a[0].getAttribute("index"))}};"function"==typeof define?define(function(){return k}):a.layer=k}(window);
|
239
novel-front/src/main/resources/static/javascript/need/layer.css
Normal file
239
novel-front/src/main/resources/static/javascript/need/layer.css
Normal file
@ -0,0 +1,239 @@
|
||||
.layermbox {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 19891014
|
||||
}
|
||||
|
||||
.layermmain, .laymshade {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.layermbtn span, .layermchild {
|
||||
display: inline-block;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.laymshade {
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
pointer-events: auto
|
||||
}
|
||||
|
||||
.layermmain {
|
||||
display: table;
|
||||
font-family: Helvetica, arial, sans-serif;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.layermmain .section {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.layermchild {
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 0 8px rgba(0, 0, 0, .1);
|
||||
pointer-events: auto;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
-webkit-animation-duration: .18s;
|
||||
animation-duration: .18s
|
||||
}
|
||||
|
||||
.layermborder {
|
||||
border: 1px solid #999
|
||||
}
|
||||
|
||||
@-webkit-keyframes bounceIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: scale(.5);
|
||||
transform: scale(.5)
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
.layermanim {
|
||||
animation-name: bounceIn;
|
||||
-webkit-animation-name: bounceIn
|
||||
}
|
||||
|
||||
.layermbox0 .layermchild {
|
||||
max-width: 260px;
|
||||
min-width: 150px
|
||||
}
|
||||
|
||||
.layermbox1 .layermchild {
|
||||
border: none;
|
||||
border-radius: 0
|
||||
}
|
||||
|
||||
.layermbox2 .layermchild {
|
||||
width: auto;
|
||||
max-width: 260px;
|
||||
min-width: 40px;
|
||||
border: none;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.layermchild h3 {
|
||||
padding: 0 45px 0 10px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
border-radius: 5px 5px 0 0;
|
||||
border-bottom: 1px solid #EBEBEB
|
||||
}
|
||||
|
||||
.layermbtn span, .layermchild h3 {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
.layermcont {
|
||||
padding: 20px 15px;
|
||||
line-height: 22px;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
.layermbox1 .layermcont {
|
||||
padding: 0
|
||||
}
|
||||
|
||||
.layermbox2 .layermcont {
|
||||
text-align: center;
|
||||
padding: 30px 30px 0;
|
||||
line-height: 0
|
||||
}
|
||||
|
||||
.layermbox2 .layermcont i {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
margin-left: 8px;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
border-radius: 100%;
|
||||
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
|
||||
animation: bouncedelay 1.4s infinite ease-in-out;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both
|
||||
}
|
||||
|
||||
@-webkit-keyframes bouncedelay {
|
||||
0%, 100%, 80% {
|
||||
-webkit-transform: scale(0)
|
||||
}
|
||||
40% {
|
||||
-webkit-transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bouncedelay {
|
||||
0%, 100%, 80% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0)
|
||||
}
|
||||
40% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
.layermbox2 .layermcont i:first-child {
|
||||
margin-left: 0;
|
||||
-webkit-animation-delay: -.32s;
|
||||
animation-delay: -.32s
|
||||
}
|
||||
|
||||
.layermbox2 .layermcont i.laymloadtwo {
|
||||
-webkit-animation-delay: -.16s;
|
||||
animation-delay: -.16s
|
||||
}
|
||||
|
||||
.layermbox2 .layermcont > div {
|
||||
line-height: 22px;
|
||||
padding-top: 7px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 14px
|
||||
}
|
||||
|
||||
.layermbtn {
|
||||
position: relative;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 0;
|
||||
text-align: center;
|
||||
border-top: 1px solid #EBEBEB
|
||||
}
|
||||
|
||||
.layermbtn span {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-radius: 0 5px 0 0
|
||||
}
|
||||
|
||||
.layermbtn span:first-child {
|
||||
height: 39px;
|
||||
background-color: #fff;
|
||||
border-radius: 0 0 0 5px
|
||||
}
|
||||
|
||||
.layermbtn:before {
|
||||
content: '\20';
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 39px;
|
||||
left: 50%;
|
||||
top: 0;
|
||||
background-color: #EBEBEB
|
||||
}
|
||||
|
||||
.layermend {
|
||||
position: absolute;
|
||||
right: 7px;
|
||||
top: 10px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border: 0;
|
||||
font-weight: 400;
|
||||
background: 0 0;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
font-size: 30px
|
||||
}
|
||||
|
||||
.layermend::after, .layermend::before {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 13px;
|
||||
content: '';
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
background-color: rgba(0, 0, 0, .3);
|
||||
transform: rotate(45deg);
|
||||
-webkit-transform: rotate(45deg);
|
||||
border-radius: 3px
|
||||
}
|
||||
|
||||
.layermend::after {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg)
|
||||
}
|
167
novel-front/src/main/resources/static/javascript/ufans.js
Normal file
167
novel-front/src/main/resources/static/javascript/ufans.js
Normal file
@ -0,0 +1,167 @@
|
||||
var uFans = {
|
||||
startSupportRead: function () {
|
||||
var uname = jQuery.cookie("waplogname");
|
||||
if (uname != undefined && uname != "") {
|
||||
if (spmymoney == 0) {
|
||||
}
|
||||
else {
|
||||
uFans.startSupport();
|
||||
}
|
||||
}
|
||||
else {
|
||||
layer.open({
|
||||
content: '请先登录',
|
||||
style: BookDetail.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
startSupport: function () {
|
||||
var rStr = '<a class="closePopup" href="javascript:void(0);" onclick="javascript:uFans.closeBox();"></a>';
|
||||
rStr += '<div class="popupTit">';
|
||||
rStr += ' <h3>我要捧场作品</h3>';
|
||||
rStr += '</div>';
|
||||
rStr += '<div class="propsList cf">';
|
||||
rStr += ' <ul>';
|
||||
rStr += ' <li vals="100">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">100屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' <li class="on" vals="500">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">500屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' <li vals="2000">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">2000屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' <li vals="5000">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">5000屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' <li vals="10000">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">10000屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' <li vals="100000">';
|
||||
rStr += ' <a class="propWrap" href="javascript:void(0);">';
|
||||
rStr += ' <i class="icon_check"></i>';
|
||||
rStr += ' <span class="propsBox">100000屋币</span>';
|
||||
rStr += ' </a>';
|
||||
rStr += ' </li>';
|
||||
rStr += ' </ul>';
|
||||
rStr += '</div>';
|
||||
rStr += '<p class="have_num">当前剩余<span class="red">' + spmymoney + '</span>屋币 本次捧场<span class="red" id="pcTotal">500</span>屋币<a class="red" href="../pay/" >[充值]</a></p>';
|
||||
rStr += '<p><textarea class="popup_text" id="sendSupportNote" placeholder="感谢您的捧场,留句话鼓励作者吧!"></textarea></p>';
|
||||
rStr += '<p class="tc"><a class="btn_red btn_send_pc" href="javascript:void(0);" onclick="javascript:uFans.SendSupport();">立即捧场</a></p>';
|
||||
$("#showPC").html(rStr);
|
||||
$("#showPC").show();
|
||||
$(".maskBox").show();
|
||||
$(".pcBox .propsList li").click(function () {
|
||||
$(".pcBox .propsList li").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
$("#pcTotal").html($(this).attr("vals"));
|
||||
})
|
||||
},
|
||||
closeBox: function () {
|
||||
$(".pcBox,.flowerBox,.newsTipBox,.maskBox").hide();
|
||||
},
|
||||
SendSupport: function () {
|
||||
var uname = jQuery.cookie("waplogname");
|
||||
if (uname != undefined && uname != "") {
|
||||
var moneyTotal = spmymoney;
|
||||
var moneySupport = parseInt($("#pcTotal").html());
|
||||
var sendNote = $("#sendSupportNote").val();
|
||||
var clearSendNote = sendNote.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g, "");
|
||||
if (sendNote == "") {
|
||||
layer.open({
|
||||
content: '感谢您的捧场,留句话鼓励作者吧!',
|
||||
style: BookDetail.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (clearSendNote.length<5)
|
||||
{
|
||||
layer.open({
|
||||
content: '评论最少5个字符!',
|
||||
style: BookDetail.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (moneyTotal >= moneySupport) {
|
||||
var BId = currentBId;
|
||||
}
|
||||
else {
|
||||
layer.open({
|
||||
content: '屋币余额不足',
|
||||
style: BookDetail.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
layer.open({
|
||||
content: '请先登录',
|
||||
style: BookDetail.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
GetSupport: function (BId) {
|
||||
},
|
||||
GetFlower: function (BId) {
|
||||
},
|
||||
showNote: function (noteClass) {
|
||||
uFans.closeBox();
|
||||
$(".maskBox").show();
|
||||
var rStr = '<a class="closePopup" href="javascript:void(0);" onclick="javascript:uFans.closeBox();"></a>';
|
||||
rStr += '<div class="popupTit">';
|
||||
rStr += ' <h3>消息提示</h3>';
|
||||
rStr += '</div>';
|
||||
if (noteClass == 'pc') {
|
||||
rStr += '<div class="tipWrap suc_txt_pc">捧场作品成功!</div>';
|
||||
}
|
||||
else {
|
||||
rStr += '<div class="tipWrap suc_txt_flw">点赞作品成功!</div>';
|
||||
}
|
||||
rStr += '<div class="tc">';
|
||||
rStr += ' <a href="javascript:void(0);" class="btn_red btn_sure" onclick="javascript:uFans.closeBox();">确定</a>';
|
||||
rStr += '</div>';
|
||||
$("#showNote").html(rStr);
|
||||
$("#showNote").show();
|
||||
},
|
||||
formatDateTime: function (now) {
|
||||
if (now != null && now != "") {
|
||||
var dateN = new Date(+/\d+/.exec(now)[0]);
|
||||
var year = dateN.getFullYear();
|
||||
var month = dateN.getMonth() + 1;
|
||||
var date = dateN.getDate();
|
||||
var hour = dateN.getHours();
|
||||
var minute = dateN.getMinutes();
|
||||
var second = dateN.getSeconds();
|
||||
minute = parseInt(minute) < 10 ? "0" + minute : minute;
|
||||
|
||||
if (hour == 0 && minute == 0 && second == 0) {
|
||||
return year + "-" + month + "-" + date;
|
||||
}
|
||||
else {
|
||||
return month + "-" + date + " " + hour + ":" + minute;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
77
novel-front/src/main/resources/static/javascript/user.js
Normal file
77
novel-front/src/main/resources/static/javascript/user.js
Normal file
@ -0,0 +1,77 @@
|
||||
var UserUtil = {
|
||||
msgStyle: 'background-color:#333; color:#fff; text-align:center; border:none; font-size:20px; padding:10px;',
|
||||
GetFavoritesNew: function () {
|
||||
var bIdList = "";
|
||||
$(".book_list").each(function () {
|
||||
bIdList += "," + $(this).attr("vals");
|
||||
});
|
||||
if (bIdList != "") {
|
||||
}
|
||||
},
|
||||
GetHistory: function () {
|
||||
var bIdList = "";
|
||||
$(".book_list").each(function () {
|
||||
bIdList += "," + $(this).attr("vals");
|
||||
});
|
||||
if (bIdList != "") {
|
||||
}
|
||||
},
|
||||
GetChapterInfo: function () {
|
||||
var cIdList = "";
|
||||
$(".showCName").each(function () {
|
||||
cIdList += "," + $(this).attr("vals");
|
||||
});
|
||||
if (cIdList != "") {
|
||||
}
|
||||
},
|
||||
SignDay: function () {
|
||||
if (!signed) {
|
||||
signed = true;
|
||||
}
|
||||
},
|
||||
SignDayStatus: function () {
|
||||
},
|
||||
RegSendSms: function () {
|
||||
var mob = $("#txtUName").val();
|
||||
var cCode = $("#TxtChkCode").val();
|
||||
if (mob != "" && cCode != "") {
|
||||
$("#btnSendSms").attr("disabled", "disabled");
|
||||
$("#txtUName").attr("readonly", "true");
|
||||
}
|
||||
else {
|
||||
layer.open({
|
||||
content: '手机号码和验证码必须填写',
|
||||
style: UserUtil.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
GetPassSendSms: function () {
|
||||
var mob = $("#txtMobile").val();
|
||||
var cCode = $("#TxtChkCode").val();
|
||||
if (mob != "" && cCode != "") {
|
||||
$("#btnSendSms").attr("disabled", "disabled");
|
||||
$("#txtMobile").attr("readonly", "true");
|
||||
}
|
||||
else {
|
||||
layer.open({
|
||||
content: '手机号码和验证码必须填写',
|
||||
style: UserUtil.msgStyle,
|
||||
time: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
RegSmsWait: function () {
|
||||
if (secondStep > 0) {
|
||||
$("#btnSendSms").val("重新发送(" + secondStep + ")");
|
||||
secondStep--;
|
||||
setTimeout("UserUtil.RegSmsWait()", 1000);
|
||||
}
|
||||
else {
|
||||
secondStep = 180;
|
||||
$("#btnSendSms").val("重新获取验证码");
|
||||
$("#btnSendSms").removeAttr("disabled");
|
||||
$("#txtUName").removeAttr("readonly");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user