mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
文件夹结构调整,新增模版自定义功能
This commit is contained in:
617
templates/orange/static/javascript/YT.js
Normal file
617
templates/orange/static/javascript/YT.js
Normal file
@ -0,0 +1,617 @@
|
||||
var $C = function (objName) {
|
||||
if (typeof (document.getElementById(objName)) != "object")
|
||||
{ return null; }
|
||||
else
|
||||
{ return document.getElementById(objName); }
|
||||
}
|
||||
var YT = {
|
||||
BaseCommon: {
|
||||
gL: function (x) { var l = 0; while (x) { l += x.offsetLeft; x = x.offsetParent; } return l },
|
||||
gT: function (x) { var t = 0; while (x) { t += x.offsetTop; x = x.offsetParent; } return t }
|
||||
},
|
||||
BaseData: {
|
||||
WaitImg: "/images/loading.gif"
|
||||
},
|
||||
Fun: {
|
||||
GetWordLength: function (str) {
|
||||
str = str.replace(/(\n)+|(\r\n)+/g, "");
|
||||
str = str.replace(" ", "");
|
||||
str = str.replace(" ", "");
|
||||
return str.length;
|
||||
},
|
||||
ConvertToMoney: function (btanch) {
|
||||
if (btanch != undefined) {
|
||||
return parseFloat(btanch) / 100;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
LoadShow: function () {
|
||||
if ($C("LayerShowPic") == null) {
|
||||
var sp = document.createElement("div");
|
||||
sp.innerHTML = "<div id=\"LayerShowPic\" style=\"position:absolute;width:180px;height:70px;z-index:100;background-color: #fdfce9;border: 1px solid #666666;font-size:12px;\"><div align=\"center\" style=\"z-index:91;\"><br><img src=\"" + YT.BaseData.WaitImg + "\" align=\"absmiddle\" /> 请稍后…</div></div><iframe id=\"LayerCover\" style=\"position:absolute;width:100%;height:100%;z-index:10;left: 0px;top: 0px;background-color:#eeeeee;FILTER: alpha(opacity=1);opacity: 0.3 !important; \"></iframe>";
|
||||
document.body.appendChild(sp);
|
||||
}
|
||||
$C("LayerShowPic").style.display = '';
|
||||
$C("LayerCover").style.display = '';
|
||||
$C("LayerCover").style.height = String(document.documentElement.scrollHeight) + 'px';
|
||||
YT.Fun.ScreenCenter($C("LayerShowPic"), 266, 200);
|
||||
|
||||
},
|
||||
LoadHide: function () {
|
||||
if ($C("LayerShowPic") != null) {
|
||||
$C("LayerShowPic").style.display = 'none';
|
||||
$C("LayerCover").style.display = 'none';
|
||||
}
|
||||
},
|
||||
ScreenCenter: function (obj, width, height) {
|
||||
if (obj.style.display == 'none') {
|
||||
obj.style.display = '';
|
||||
}
|
||||
var scrolltop = document.documentElement.scrollTop;
|
||||
if (width <= 0) {
|
||||
width = obj.offsetWidth;
|
||||
}
|
||||
if (height <= 0) {
|
||||
height = obj.offsetHeight;
|
||||
}
|
||||
if (scrolltop == null || scrolltop == 0) {
|
||||
scrolltop = document.body.scrollTop;
|
||||
}
|
||||
var offsetHT = document.body.clientHeight / 2 - height / 2;
|
||||
if (offsetHT <= 0) { offsetHT = 10; }
|
||||
var offsetWT = document.body.clientWidth / 2 - width / 2;
|
||||
if (offsetWT <= 0) { offsetWT = 10; }
|
||||
obj.style.top = String(scrolltop + offsetHT) + 'px';
|
||||
obj.style.left = String(offsetWT) + 'px';
|
||||
},
|
||||
NewPanel: function (url, title, width, height, needFits) {
|
||||
if (typeof (width) == 'undefind' || width == null) { width = 750; }
|
||||
if (typeof (height) == 'undefind' || height == null) { height = 550; }
|
||||
var fits = false;
|
||||
if (typeof (needFits) != "undefined" && needFits) {
|
||||
if (document.body.clientWidth < 650 || document.body.clientHeight < 450 || document.body.clientHeight - 50 < height)
|
||||
{ fits = true; }
|
||||
}
|
||||
if ($C("YT_Panel") == null) {
|
||||
var sp = document.createElement("div");
|
||||
sp.innerHTML = "<div id=\"YT_Panel\" class=\"easyui-panel\"><iframe frameborder=\"0\" id=\"YT_Panel_i\" name=\"YT_Panel_i\" scrolling=\"auto\" src=\"" + url + "\" style=\"height:100%;visibility:inherit; width:100%;z-index:1;\"></iframe></div>";
|
||||
document.body.appendChild(sp);
|
||||
}
|
||||
if (url.indexOf("?") > 0) {
|
||||
url = url + "&";
|
||||
}
|
||||
else {
|
||||
url = url + "?";
|
||||
}
|
||||
url = url + "randomkeys=" + Math.random();
|
||||
$C("YT_Panel_i").src = url;
|
||||
var sTop = null, sLeft = null;
|
||||
if (window.screen.height < 800) {
|
||||
sTop = 0;
|
||||
}
|
||||
if (fits) {
|
||||
sLeft = 0;
|
||||
}
|
||||
$('#YT_Panel').window({
|
||||
width: width,
|
||||
height: height,
|
||||
title: title,
|
||||
collapsible: true,
|
||||
minimizable: false,
|
||||
maximizable: true,
|
||||
closable: true,
|
||||
modal: true,
|
||||
fit: fits,
|
||||
top: sTop,
|
||||
left: sLeft
|
||||
});
|
||||
},
|
||||
NewPanelNoClose: function (url, title, width, height) {
|
||||
if (typeof (width) == 'undefind' || width == null) { width = 750; }
|
||||
if (typeof (height) == 'undefind' || height == null) { height = 550; }
|
||||
if ($C("YT_Panel") == null) {
|
||||
var sp = document.createElement("div");
|
||||
sp.innerHTML = "<div id=\"YT_Panel\" class=\"easyui-panel\" ><iframe frameborder=\"0\" id=\"YT_Panel_i\" name=\"YT_Panel_i\" scrolling=\"auto\" src=\"" + url + "\" style=\"height:100%;visibility:inherit; width:100%;z-index:1;\"></iframe></div>";
|
||||
document.body.appendChild(sp);
|
||||
}
|
||||
if (url.indexOf("?") > 0) {
|
||||
url = url + "&";
|
||||
}
|
||||
else {
|
||||
url = url + "?";
|
||||
}
|
||||
url = url + "randomkeys=" + Math.random();
|
||||
$C("YT_Panel_i").src = url;
|
||||
$('#YT_Panel').window({
|
||||
width: width,
|
||||
height: height,
|
||||
title: title,
|
||||
collapsible: false,
|
||||
minimizable: false,
|
||||
maximizable: true,
|
||||
closable: false,
|
||||
modal: true
|
||||
});
|
||||
},
|
||||
ClosePanel: function (id) {
|
||||
if (typeof (id) == 'undefind' || id == null) {
|
||||
$('#YT_Panel').panel('close');
|
||||
/*CreateGrid();*/
|
||||
CreateGridReload();
|
||||
}
|
||||
else { $('#' + id).panel('close'); }
|
||||
},
|
||||
/*格式化时间字符串*/
|
||||
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 "";
|
||||
}
|
||||
},
|
||||
/** 获取当前时间月份*/
|
||||
formatMonth: function (now) {
|
||||
if (now != null && now != "") {
|
||||
var dateN = new Date(+/\d+/.exec(now)[0]);
|
||||
var month = dateN.getMonth() + 1;
|
||||
return month;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
/** 获取当前时间具体的某一天*/
|
||||
formatDay: function (now) {
|
||||
if (now != null && now != "") {
|
||||
var dateN = new Date(+/\d+/.exec(now)[0]);
|
||||
var month = dateN.getMonth() + 1;
|
||||
var date = dateN.getDate();
|
||||
return month + "-" + date;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
/** 获取所属时间的季度*/
|
||||
formatSeasonal: function (now) {
|
||||
if (now != null && now != "") {
|
||||
var dateN = new Date(+/\d+/.exec(now)[0]);
|
||||
var year = dateN.getFullYear();
|
||||
var month = dateN.getMonth() + 1;
|
||||
if (month == 1) {
|
||||
return year + "年第1季度";
|
||||
}
|
||||
else if (month == 4) {
|
||||
return year + "年第2季度";
|
||||
}
|
||||
else if (month == 7) {
|
||||
return year + "年第三季度";
|
||||
}
|
||||
else {
|
||||
return year + "年第四季度";
|
||||
}
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
|
||||
formatStatus: function (id) {
|
||||
if (id == 0) {
|
||||
return "无效";
|
||||
}
|
||||
else {
|
||||
return "有效";
|
||||
}
|
||||
},
|
||||
ShowPanel: function (obj, divName, xlong, ylong) {
|
||||
var showobj = $C(divName);
|
||||
if (showobj) {
|
||||
if (showobj.style.display == 'none') {
|
||||
showobj.style.display = '';
|
||||
}
|
||||
if (xlong)
|
||||
{ showobj.style.top = YT.BaseCommon.gT(obj) + 20 + xlong + "px"; }
|
||||
else
|
||||
{ showobj.style.top = YT.BaseCommon.gT(obj) + 20 + "px"; }
|
||||
if (ylong)
|
||||
{ showobj.style.left = YT.BaseCommon.gL(obj) + ylong + "px"; }
|
||||
else
|
||||
{ showobj.style.left = YT.BaseCommon.gL(obj) + "px"; }
|
||||
}
|
||||
},
|
||||
GetDateDiff:function(startTime,endTime, diffType) {
|
||||
startTime = startTime.replace(/\-/g, "/");
|
||||
endTime= endTime.replace(/\-/g, "/");
|
||||
diffType = diffType.toLowerCase();
|
||||
var sTime = new Date(startTime);
|
||||
var eTime = new Date(endTime);
|
||||
var timeType = 1;
|
||||
switch (diffType) {
|
||||
case "second":
|
||||
timeType = 1000;
|
||||
break;
|
||||
case "minute":
|
||||
timeType = 1000 * 60;
|
||||
break;
|
||||
case "hour":
|
||||
timeType = 1000 * 3600;
|
||||
break;
|
||||
case "day":
|
||||
timeType = 1000 * 3600 * 24;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return parseInt((eTime.getTime() - sTime.getTime()) / parseInt(timeType));
|
||||
}
|
||||
},
|
||||
Dirt: {
|
||||
/*绑定到列表*/
|
||||
BindList: function (listId, dirtName, needBlock) {
|
||||
var obj = $C(listId);
|
||||
if (obj != undefined) {
|
||||
obj.length = 0;
|
||||
var objV = eval("DirtInfo." + dirtName);
|
||||
if (objV != undefined && objV != null) {
|
||||
for (var i = 0; i < objV.length; i++) {
|
||||
obj.options.add(new Option(objV[i][1], objV[i][0]));
|
||||
}
|
||||
}
|
||||
if (needBlock) {
|
||||
obj.options.add(new Option("请选择", "0"));
|
||||
obj.value = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
/*获取值表示的意义*/
|
||||
GetName: function (dirtName, dValue) {
|
||||
var obj = eval("DirtInfo." + dirtName);
|
||||
if (obj != undefined && obj != null) {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
if (obj[i][0] == dValue) {
|
||||
return obj[i][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
Cookie: function (name, value, options) {
|
||||
if (typeof value != 'undefined') { /* name and value given, set cookie*/
|
||||
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(); /* use expires attribute, max-age is not supported by IE */
|
||||
}
|
||||
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 { /* only name given, get cookie */
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*重新定义录入框校验规则*/
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
chinaMobile: {/*手机号码*/
|
||||
validator: function (value, param) {
|
||||
var reg = /^(13|14|15|17|18)\d{9}$/;
|
||||
var reglt = /^(\d{3}|\d{4})-\d{8}$/;
|
||||
/*var reg = /^\d{11,12}$/;*/
|
||||
if (value.indexOf('-') > 0) {
|
||||
return reglt.test(value);
|
||||
}
|
||||
else {
|
||||
return reg.test(value);
|
||||
}
|
||||
}, message: '手机号码有误'
|
||||
},
|
||||
chinaName: {/*中文名称*/
|
||||
validator: function (value, param) {
|
||||
// var reg = /^[\u4e00-\u9fa5a-zA-Z0-9]{2,6}$/;
|
||||
var reg = /^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]{1,5}$/;
|
||||
// var reg = /^[\u4e00-\u9fa5,a-zA-Z0-9]{2,5}$/;
|
||||
return reg.test(value);
|
||||
}, message: '在笔名中数字不能开头,且昵称的长度应在2-6之间'
|
||||
},
|
||||
realName: {/*真实姓名*/
|
||||
validator: function (value, param) {
|
||||
// var reg = /^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]{1,5}$/;
|
||||
var reg = /^[\u4e00-\u9fa5,a-zA-Z0-9]{2,5}$/;
|
||||
return reg.test(value);
|
||||
}, message: '真实姓名的长度为2-5位中文字符'
|
||||
},
|
||||
maxLength: {
|
||||
validator: function (value, param) {
|
||||
$.fn.validatebox.defaults.rules.maxLength.message = '只能少于' + param + '字符串';
|
||||
return value.length < param;
|
||||
}
|
||||
},
|
||||
isNumber: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(-|[0-9])(|\d{1,9})$/;
|
||||
return reg.test(value);
|
||||
}, message: '必须是数字'
|
||||
},
|
||||
isBankNumber: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^([0-9]{16}|[0-9]{19})$/;
|
||||
return reg.test(value);
|
||||
}, message: '银行卡号错误'
|
||||
},
|
||||
isEmail: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
|
||||
return reg.test(value);
|
||||
}, message: '邮箱格式错误'
|
||||
},
|
||||
|
||||
isPosInt: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(\d{1,9})$/;
|
||||
if (reg.test(value) && value > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}, message: '必须是大于0的正整数'
|
||||
},
|
||||
isPosIntTen: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(\d{1,9})$/;
|
||||
if (reg.test(value) && value > 10) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}, message: '必须是大于10的正整数'
|
||||
},
|
||||
isDate: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29))$/;
|
||||
return reg.test(value);
|
||||
}, message: 'yyyy-MM-dd'
|
||||
},
|
||||
isIdCard: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(^\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/;
|
||||
return isCardID(value);
|
||||
}, message: '身份证号码错误'
|
||||
},
|
||||
isFloat: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(^\+?[1-9][0-9]*$)$|^(\d{1,9}\.\d{1,9})$/;
|
||||
return reg.test(value);
|
||||
}, message: '必须是大于零的数字'
|
||||
},
|
||||
isFloatMin0:
|
||||
{
|
||||
validator: function (value, param) {
|
||||
var reg = /^(^\d{1,9})$|^(\d{1,9}\.\d{1,9})$/;
|
||||
return reg.test(value);
|
||||
}, message: '必须是大于零的数字'
|
||||
},
|
||||
isPassWord: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^[a-zA-Z0-9_]{5,15}$/;
|
||||
return reg.test(value);
|
||||
}, message: '密码格式错误'
|
||||
},
|
||||
isConfirmPassword: {
|
||||
validator: function (value, param) {
|
||||
return $(param[0]).val() == value;
|
||||
}, message: '两次录入的密码不同'
|
||||
},
|
||||
phoneCheck: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^(((\()?\d{2,4}(\))?[-(\s)*]){0,2})?(\d{8})$/;
|
||||
return reg.test(value);
|
||||
}, message: '输入的电话不正确'
|
||||
},
|
||||
isUserName: {
|
||||
validator: function (value, param) {
|
||||
var reg = /^[a-zA-Z0-9_]{3,15}$/;
|
||||
return reg.test(value);
|
||||
}, message: '用户名格式错误'
|
||||
},
|
||||
equalTo: {
|
||||
validator: function (value, param) {
|
||||
return $(param[0]).val() == value;
|
||||
},
|
||||
message: '字段不匹配'
|
||||
}
|
||||
});
|
||||
|
||||
/*空函数*/
|
||||
function CreateGrid() { }
|
||||
function CreateGridReload() { }
|
||||
|
||||
/*身份证校验正确性*/
|
||||
var NumbCardCity = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外" };
|
||||
function isCardID(sId) {
|
||||
var iSum = 0;
|
||||
var info = "";
|
||||
if (!/^\d{17}(\d|x)$/i.test(sId)) return false; /* "你输入的身份证长度或格式错误"; */
|
||||
sId = sId.replace(/x$/i, "a");
|
||||
if (NumbCardCity[parseInt(sId.substr(0, 2))] == null) return false; /*"你的身份证地区非法";*/
|
||||
sBirthday = sId.substr(6, 4) + "-" + Number(sId.substr(10, 2)) + "-" + Number(sId.substr(12, 2));
|
||||
var d = new Date(sBirthday.replace(/-/g, "/"));
|
||||
if (sBirthday != (d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate())) return false; /* "身份证上的出生日期非法";*/
|
||||
for (var i = 17; i >= 0; i--) iSum += (Math.pow(2, i) % 11) * parseInt(sId.charAt(17 - i), 11);
|
||||
if (iSum % 11 != 1) return false; /*"你输入的身份证号非法";*/
|
||||
return true;
|
||||
}
|
||||
|
||||
function getSex(val) {
|
||||
if (parseInt(val.charAt(16) / 2) * 2 != val.charAt(16))
|
||||
return '1';
|
||||
else
|
||||
return '0';
|
||||
}
|
||||
function showBirthday(val) {
|
||||
var mm;
|
||||
if (18 == val.length) {/*18位身份证号码*/
|
||||
mm = val.charAt(6) + val.charAt(7) + val.charAt(8) + val.charAt(9) + '-' + val.charAt(10) + val.charAt(11) + '-' + val.charAt(12) + val.charAt(13);
|
||||
|
||||
}
|
||||
return mm;
|
||||
}
|
||||
|
||||
|
||||
var DirtInfo = {
|
||||
TrueOrFalse: [[0, "否"], [1, "是"]],
|
||||
EnumUserCommendStatus: [[0, "新"], [1, "已处理"], [2, "已查看"]],
|
||||
AvailablesStatus: [[0, "禁用"], [1, "可用"]],
|
||||
SettleClass: [[0, "现金"], [1, "预付扣款"]],
|
||||
EnumSexClass: [[0, "不限"], [1, "男"], [2, "女"]],
|
||||
EnumUserType: [[1, "手机端app"], [2, "手机wap端"]],
|
||||
EnumPayClass: [[1, "支付宝"], [2, "微信"], [3, "微信扫码"], [100, "绑定手机奖励"]],
|
||||
EnumPayStatus: [[0, "新申请"], [2, "充值失败"], [3, "成功"]],
|
||||
EnumMoneyClass: [[0, "购买"], [1, "赠送"]],
|
||||
EnumUserFrom: [[1, "其他"], [2, "微博"], [3, "qq"], [4, "微信"], [10, "app注册"], [11, "wap注册"], [12, "微博绑定"], [13, "qq绑定"], [14, "微信绑定"]],
|
||||
EnumSignType: [[0, "未签约"], [1, "分成"], [2, "买断"], [3, "保底"], [4, "买断整本"], [9, "保底"], [15, "道具结算"], [30, "全勤奖励"]],
|
||||
EnumLogType: [[0, "app登录"], [1, "wap登录"]],
|
||||
EnumAuditStatus: [[-10, "下线"], [-1, "审核失败"], [0, "编辑中"], [1, "提交申请"], [2, "通过审核"], [3, "已发布"]],
|
||||
EnumHandleStatus: [[-1, "处理失败"], [0, "新申请"], [1, "待处理"], [2, "处理成功"]],
|
||||
EnumAuthorLevel: [[1, "一级"], [2, "二级"], [3, "三级"], [4, "四级"], [5, "五级"]],
|
||||
EnumChannelClass: [[0, "特级"], [1, "一级"], [2, "二级"], [3, "三级"], [4, "四级"], [5, "五级"], [6, "六级"], [7, "七级"], [8, "八级"], [9, "九级"], [1100, "千级"]],
|
||||
EnumVipChapter: [[0, "公众"], [1, "VIP"]],
|
||||
EnumBookLeveType: [[1, "A级"], [2, "B级"], [3, "C级"], [4, "普通"], [5, "S级"]],
|
||||
EnumBookLeveTypeL: [[1, "A"], [2, "B"], [3, "C"]],
|
||||
EnumAdmActClass: [[50, "签约等级修改"], [51, "封面修改"], [52, "渠道添加"], [53, "渠道修改"], [54, "渠道删除"], [55, "章节删除"]],
|
||||
EnumSettlementType: [[0, "未结算"], [1, "已结算"], [2, "结算失败"]],
|
||||
EnumBookProcess: [[0, "连载"], [1, "完结"]],
|
||||
EnumAuthStatus: [[1 ,"独家"], [2, "非独家"]]
|
||||
};
|
||||
|
||||
function dateToDate(date) {
|
||||
var sDate = new Date();
|
||||
if (typeof date == 'object'
|
||||
&& typeof new Date().getMonth == "function"
|
||||
) {
|
||||
sDate = date;
|
||||
}
|
||||
else if (typeof date == "string") {
|
||||
var arr = date.split('-')
|
||||
if (arr.length == 3) {
|
||||
sDate = new Date(arr[0] + '-' + arr[1] + '-' + arr[2]);
|
||||
}
|
||||
}
|
||||
|
||||
return sDate;
|
||||
}
|
||||
|
||||
|
||||
function addMonth(date, num) {
|
||||
num = parseInt(num);
|
||||
var sDate = dateToDate(date);
|
||||
|
||||
var sYear = sDate.getFullYear();
|
||||
var sMonth = sDate.getMonth() + 1;
|
||||
var sDay = sDate.getDate();
|
||||
|
||||
var eYear = sYear;
|
||||
var eMonth = sMonth + num;
|
||||
var eDay = sDay;
|
||||
while (eMonth > 12) {
|
||||
eYear++;
|
||||
eMonth -= 12;
|
||||
}
|
||||
|
||||
var eDate = new Date(eYear, eMonth - 1, eDay);
|
||||
|
||||
while (eDate.getMonth() != eMonth - 1) {
|
||||
eDay--;
|
||||
eDate = new Date(eYear, eMonth - 1, eDay);
|
||||
}
|
||||
|
||||
return eDate;
|
||||
}
|
||||
|
||||
function checkAll() {
|
||||
if ($("#selAll").attr("checked")) {
|
||||
$("input[name='selBox']").each(function () {
|
||||
$(this).attr("checked", true);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("input[name='selBox']").each(function () {
|
||||
$(this).removeAttr("checked");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initSubmitButton(3);
|
||||
});
|
||||
|
||||
//停留时间
|
||||
function initSubmitButton(wait) {
|
||||
$("input[type='submit']").each(function () {
|
||||
$(this).click(function () {
|
||||
if ($(this).attr("submited") == "1") {
|
||||
return false;
|
||||
}
|
||||
var oldVal = $(this).val();
|
||||
$(this).val("正在处理,请稍等(" + wait + ")");
|
||||
$(this).attr("submited", "1");
|
||||
setTimeout('ButtonLimit("' + $(this).attr("id") + '",' + wait + ',"' + oldVal + '")', 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
function ButtonLimit(objId, wait, oldVal) {
|
||||
wait--;
|
||||
if (wait > 0) {
|
||||
$("#" + objId).val("正在处理,请稍等(" + wait + ")");
|
||||
setTimeout('ButtonLimit("' + objId + '",' + wait + ',"' + oldVal + '");', 1000);
|
||||
}
|
||||
else {
|
||||
$("#" + objId).removeAttr("submited");
|
||||
$("#" + objId).val(oldVal);
|
||||
}
|
||||
}
|
217
templates/orange/static/javascript/ajaxfileupload.js
Normal file
217
templates/orange/static/javascript/ajaxfileupload.js
Normal file
@ -0,0 +1,217 @@
|
||||
jQuery.extend({
|
||||
createUploadIframe: function(id, uri)
|
||||
{
|
||||
//create frame
|
||||
var frameId = 'jUploadFrame' + id;
|
||||
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
|
||||
if(window.ActiveXObject)
|
||||
{
|
||||
if(typeof uri== 'boolean'){
|
||||
iframeHtml += ' src="' + 'javascript:false' + '"';
|
||||
|
||||
}
|
||||
else if(typeof uri== 'string'){
|
||||
iframeHtml += ' src="' + uri + '"';
|
||||
|
||||
}
|
||||
}
|
||||
iframeHtml += ' />';
|
||||
jQuery(iframeHtml).appendTo(document.body);
|
||||
|
||||
return jQuery('#' + frameId).get(0);
|
||||
},
|
||||
createUploadForm: function(id,fileElementId,data,fileElement)
|
||||
{
|
||||
//create form
|
||||
var formId = 'jUploadForm' + id;
|
||||
var fileId = 'jUploadFile' + id;
|
||||
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
|
||||
if(data)
|
||||
{
|
||||
for(var i in data)
|
||||
{
|
||||
jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
|
||||
}
|
||||
}
|
||||
var oldElement;
|
||||
if(fileElement == null)
|
||||
oldElement = jQuery('#' + fileElementId);
|
||||
else
|
||||
oldElement = fileElement;
|
||||
|
||||
var newElement = jQuery(oldElement).clone();
|
||||
jQuery(oldElement).attr('id', fileId);
|
||||
jQuery(oldElement).before(newElement);
|
||||
jQuery(oldElement).appendTo(form);
|
||||
|
||||
//set attributes
|
||||
jQuery(form).css('position', 'absolute');
|
||||
jQuery(form).css('top', '-1200px');
|
||||
jQuery(form).css('left', '-1200px');
|
||||
jQuery(form).appendTo('body');
|
||||
return form;
|
||||
},
|
||||
|
||||
ajaxFileUpload: function(s) {
|
||||
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
|
||||
s = jQuery.extend({}, jQuery.ajaxSettings, s);
|
||||
var id = new Date().getTime()
|
||||
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data),s.fileElement);
|
||||
var io = jQuery.createUploadIframe(id, s.secureuri);
|
||||
var frameId = 'jUploadFrame' + id;
|
||||
var formId = 'jUploadForm' + id;
|
||||
// Watch for a new set of requests
|
||||
if ( s.global && ! jQuery.active++ )
|
||||
{
|
||||
jQuery.event.trigger( "ajaxStart" );
|
||||
}
|
||||
var requestDone = false;
|
||||
// Create the request object
|
||||
var xml = {}
|
||||
if ( s.global )
|
||||
jQuery.event.trigger("ajaxSend", [xml, s]);
|
||||
// Wait for a response to come back
|
||||
var uploadCallback = function(isTimeout)
|
||||
{
|
||||
var io = document.getElementById(frameId);
|
||||
try
|
||||
{
|
||||
if(io.contentWindow)
|
||||
{
|
||||
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
|
||||
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
|
||||
|
||||
}else if(io.contentDocument)
|
||||
{
|
||||
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
|
||||
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
|
||||
}
|
||||
}catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
if ( xml || isTimeout == "timeout")
|
||||
{
|
||||
requestDone = true;
|
||||
var status;
|
||||
try {
|
||||
status = isTimeout != "timeout" ? "success" : "error";
|
||||
// Make sure that the request was successful or notmodified
|
||||
if ( status != "error" )
|
||||
{
|
||||
// process the data (runs the xml through httpData regardless of callback)
|
||||
var data = jQuery.uploadHttpData( xml, s.dataType );
|
||||
// If a local callback was specified, fire it and pass it the data
|
||||
if ( s.success )
|
||||
s.success( data, status );
|
||||
|
||||
// Fire the global callback
|
||||
if( s.global )
|
||||
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
|
||||
} else
|
||||
jQuery.handleError(s, xml, status);
|
||||
} catch(e)
|
||||
{
|
||||
status = "error";
|
||||
jQuery.handleError(s, xml, status, e);
|
||||
}
|
||||
|
||||
// The request was completed
|
||||
if( s.global )
|
||||
jQuery.event.trigger( "ajaxComplete", [xml, s] );
|
||||
|
||||
// Handle the global AJAX counter
|
||||
if ( s.global && ! --jQuery.active )
|
||||
jQuery.event.trigger( "ajaxStop" );
|
||||
|
||||
// Process result
|
||||
if ( s.complete )
|
||||
s.complete(xml, status);
|
||||
|
||||
jQuery(io).unbind()
|
||||
|
||||
setTimeout(function()
|
||||
{ try
|
||||
{
|
||||
jQuery(io).remove();
|
||||
jQuery(form).remove();
|
||||
|
||||
} catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
|
||||
}, 100)
|
||||
|
||||
xml = null
|
||||
|
||||
}
|
||||
}
|
||||
// Timeout checker
|
||||
if ( s.timeout > 0 )
|
||||
{
|
||||
setTimeout(function(){
|
||||
// Check to see if the request is still happening
|
||||
if( !requestDone ) uploadCallback( "timeout" );
|
||||
}, s.timeout);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
var form = jQuery('#' + formId);
|
||||
jQuery(form).attr('action', s.url);
|
||||
jQuery(form).attr('method', 'POST');
|
||||
jQuery(form).attr('target', frameId);
|
||||
if(form.encoding)
|
||||
{
|
||||
jQuery(form).attr('encoding', 'multipart/form-data');
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery(form).attr('enctype', 'multipart/form-data');
|
||||
}
|
||||
jQuery(form).submit();
|
||||
|
||||
} catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
|
||||
jQuery('#' + frameId).load(uploadCallback);
|
||||
return {abort: function(){
|
||||
try
|
||||
{
|
||||
jQuery('#' + frameId).remove();
|
||||
jQuery(form).remove();
|
||||
}
|
||||
catch(e){}
|
||||
}};
|
||||
},
|
||||
|
||||
uploadHttpData: function( r, type ) {
|
||||
var data = !type;
|
||||
data = type == "xml" || data ? r.responseXML : r.responseText;
|
||||
|
||||
// If the type is "script", eval it in global context
|
||||
if ( type == "script" )
|
||||
jQuery.globalEval( data );
|
||||
// Get the JavaScript object, if JSON is used.
|
||||
if ( type == "json" )
|
||||
data = jQuery.parseJSON(jQuery(data).text());
|
||||
// evaluate scripts within html
|
||||
if ( type == "html" )
|
||||
jQuery("<div>").html(data).evalScripts();
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
handleError: function( s, xml, status, e ) {
|
||||
// If a local callback was specified, fire it
|
||||
if ( s.error )
|
||||
s.error( xml, status, e );
|
||||
|
||||
// Fire the global callback
|
||||
if ( s.global )
|
||||
jQuery.event.trigger( "ajaxError", [xml, s, e] );
|
||||
}
|
||||
});
|
1
templates/orange/static/javascript/authorinfo.js
Normal file
1
templates/orange/static/javascript/authorinfo.js
Normal file
@ -0,0 +1 @@
|
||||
var authorInfoV3={"LogoImg":null,"Notes":null,"UId":0}
|
196
templates/orange/static/javascript/bookclass.js
Normal file
196
templates/orange/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
templates/orange/static/javascript/bookdetail.js
Normal file
308
templates/orange/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/indexList-' + bid + '.html';
|
||||
}
|
||||
} else if (e.keyCode == 39) {
|
||||
if (nextId > 0) {
|
||||
location.href = '/book/' + bid + '/' + nextId + '.html';
|
||||
} else {
|
||||
location.href = '/book/indexList-' + 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;
|
||||
}
|
127
templates/orange/static/javascript/common.js
Normal file
127
templates/orange/static/javascript/common.js
Normal file
@ -0,0 +1,127 @@
|
||||
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',
|
||||
"/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;
|
||||
};
|
||||
|
||||
|
||||
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.nickName+"</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();
|
||||
}
|
16
templates/orange/static/javascript/date.js
Normal file
16
templates/orange/static/javascript/date.js
Normal file
@ -0,0 +1,16 @@
|
||||
//格式化时间函数
|
||||
Date.prototype.Format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"h+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
};
|
70
templates/orange/static/javascript/easyui-lang-zh_CN.js
Normal file
70
templates/orange/static/javascript/easyui-lang-zh_CN.js
Normal file
@ -0,0 +1,70 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = '第';
|
||||
$.fn.pagination.defaults.afterPageText = '共{pages}页';
|
||||
$.fn.pagination.defaults.displayMsg = '显示{from}到{to},共{total}记录';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = '请稍后…';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = '确定';
|
||||
$.messager.defaults.cancel = '取消';
|
||||
}
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.missingMessage = '该输入项为必输项';
|
||||
$.fn.validatebox.defaults.rules.email.message = '请输入有效的电子邮件地址';
|
||||
$.fn.validatebox.defaults.rules.url.message = '请输入有效的URL地址';
|
||||
$.fn.validatebox.defaults.rules.length.message = '输入内容长度必须介于{0}和{1}之间';
|
||||
$.fn.validatebox.defaults.rules.remote.message = '请修正该字段';
|
||||
}
|
||||
if ($.fn.numberbox){
|
||||
$.fn.numberbox.defaults.missingMessage = '该输入项为必输项';
|
||||
}
|
||||
if ($.fn.combobox){
|
||||
$.fn.combobox.defaults.missingMessage = '该输入项为必输项';
|
||||
}
|
||||
if ($.fn.combotree){
|
||||
$.fn.combotree.defaults.missingMessage = '该输入项为必输项';
|
||||
}
|
||||
if ($.fn.combogrid){
|
||||
$.fn.combogrid.defaults.missingMessage = '该输入项为必输项';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六'];
|
||||
$.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = '今天';
|
||||
$.fn.datebox.defaults.closeText = '关闭';
|
||||
$.fn.datebox.defaults.okText = '确定';
|
||||
$.fn.datebox.defaults.missingMessage = '该输入项为必输项';
|
||||
$.fn.datebox.defaults.formatter = function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
|
||||
};
|
||||
$.fn.datebox.defaults.parser = function(s){
|
||||
if (!s) return new Date();
|
||||
var ss = s.split('-');
|
||||
var y = parseInt(ss[0],10);
|
||||
var m = parseInt(ss[1],10);
|
||||
var d = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
};
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText,
|
||||
missingMessage: $.fn.datebox.defaults.missingMessage
|
||||
});
|
||||
}
|
153
templates/orange/static/javascript/header.js
Normal file
153
templates/orange/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
templates/orange/static/javascript/jquery-1.8.0.min.js
vendored
Normal file
2
templates/orange/static/javascript/jquery-1.8.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16103
templates/orange/static/javascript/jquery.easyui.min.js
vendored
Normal file
16103
templates/orange/static/javascript/jquery.easyui.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
templates/orange/static/javascript/layer.m.js
Normal file
2
templates/orange/static/javascript/layer.m.js
Normal file
@ -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
templates/orange/static/javascript/need/layer.css
Normal file
239
templates/orange/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)
|
||||
}
|
93
templates/orange/static/javascript/pay.js
Normal file
93
templates/orange/static/javascript/pay.js
Normal file
@ -0,0 +1,93 @@
|
||||
var UserPay = {
|
||||
czData: [[30, "3000屋币"], [50, "5000屋币"], [100, "10000屋币"], [200, "20000屋币"], [500, "50000屋币"], [365, "全站包年阅读"] ],
|
||||
czPayPalData: [[20, "10000屋币"], [50, "25000屋币"], [100, "50000屋币"], [80, "全站包年阅读"]],
|
||||
sendPay: function () {
|
||||
$("#payform").submit();
|
||||
},
|
||||
GetPayState: function (payId) {
|
||||
$.post("/api/book.aspx", { act: "getpaystatus", pid: payId }, function (data, textStatus) {
|
||||
if (data == "1") {
|
||||
location.href = '/pay/wx_return.aspx?out_trade_no=sc'+payId;
|
||||
}
|
||||
else {
|
||||
setTimeout("UserPay.GetPayState("+payId+")",3000);
|
||||
}
|
||||
}, "html");
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#ulPayType li").click(function () {
|
||||
|
||||
if($(this).attr("valp")==2){
|
||||
layer.alert("微信支付暂未开通,敬请期待");
|
||||
}
|
||||
|
||||
return ;
|
||||
|
||||
|
||||
|
||||
$($(this).parent()).children().each(function () {
|
||||
$(this).removeClass("on");
|
||||
});
|
||||
$(this).addClass("on");
|
||||
|
||||
var type = $(this).attr("valp");
|
||||
if (type == "3") {
|
||||
$("#ulPayPal").show();
|
||||
$("#ulPayPalXJ").show();
|
||||
$("#ulZFWX").hide();
|
||||
$("#ulZFWXXJ").hide();
|
||||
}
|
||||
else {
|
||||
$("#ulPayPal").hide();
|
||||
$("#ulPayPalXJ").hide();
|
||||
$("#ulZFWX").show();
|
||||
$("#ulZFWXXJ").show();
|
||||
}
|
||||
|
||||
var postUrl = "";
|
||||
switch (type)
|
||||
{
|
||||
case "1":
|
||||
postUrl = "sendalipay.aspx";
|
||||
break;
|
||||
case "2":
|
||||
postUrl = "sendwxpaynowqr.aspx";
|
||||
break;
|
||||
case "3":
|
||||
postUrl = "sendpaypal.aspx";
|
||||
break;
|
||||
}
|
||||
$("#payform").attr("action", postUrl);
|
||||
})
|
||||
|
||||
$("#ulZFWX li").click(function () {
|
||||
$("#ulZFWX li").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
if ($(this).attr("vals") > 0) {
|
||||
$("#pValue").val($(this).attr("vals"));
|
||||
$("#showTotal").html('¥' + $(this).attr("vals") + '元');
|
||||
for (var i = 0; i < UserPay.czData.length; i++) {
|
||||
if (UserPay.czData[i][0] == $(this).attr("vals")) {
|
||||
$("#showRemark").html(UserPay.czData[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#ulPayPal li").click(function () {
|
||||
$("#ulPayPal li").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
if ($(this).attr("vals") > 0) {
|
||||
$("#pValue").val($(this).attr("vals"));
|
||||
$("#showPayPalTotal").html($(this).attr("vals") + '美元');
|
||||
for (var i = 0; i < UserPay.czData.length; i++) {
|
||||
if (UserPay.czPayPalData[i][0] == $(this).attr("vals")) {
|
||||
$("#showPayPalRemark").html(UserPay.czPayPalData[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
167
templates/orange/static/javascript/ufans.js
Normal file
167
templates/orange/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
templates/orange/static/javascript/user.js
Normal file
77
templates/orange/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");
|
||||
}
|
||||
}
|
||||
}
|
32
templates/orange/static/javascript/ycUtils.js
Normal file
32
templates/orange/static/javascript/ycUtils.js
Normal file
@ -0,0 +1,32 @@
|
||||
var SCYC = {
|
||||
}
|
||||
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
checkPenName: {
|
||||
validator: function (value, param) {
|
||||
var url = "/author/checkPenName";
|
||||
var data = { penName: value};
|
||||
var bool = false;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
url: url,
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result.data) {
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '笔名已存在,请重新输入';
|
||||
bool = false;
|
||||
} else {
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '';
|
||||
bool = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return bool;
|
||||
message: '';
|
||||
}
|
||||
}
|
||||
|
||||
});
|
Reference in New Issue
Block a user