window.xlog = function (a) { var b = window.console || { log: function () { return } }; if (b.log) { b.log(a) } }; $(function () { var a = $("#Poweredby").find("a").attr("href"); var h = "https://s.click.taobao.com/t?e=m%3D2%26s%3DJvDoTxVU%2FaIcQipKwQzePCperVdZeJviEViQ0P1Vf2kguMN8XjClAjWRN9Qgu1TChTHH3SLdpkB%2B%2BZdddB%2Fw0OU2ypSedH3JmivXcocEXpwHe3wpMV0Nd1eCyZVRWUMRiYWStHE%2B0ceFSvfO0N66nzO5MaXTjVACyw%2Bb0Sl2aPhWYetMiZZgV1Jkp%2BJs%2BBdiHCfeuY4QgTDGDF1NzTQoPw%3D%3D"; var e = "https://ac.aliyun.com/application/webdesign?source=5176.11533457&userCode=4kxgpnsp"; var g = "https://ac.aliyun.com/application/webdesign?source=5176.11533457&userCode=yg0w1bfe&type=copy"; if ($("#Poweredby")) { if (a && (a == "http://www.clouddream.net/" || a == "https://www.aliyun.com/product/ecs" || a == h || a == e)) { $("#Poweredby").find("a").attr("href", g) } } if ($(".powerby-area")) { var f = $(".powerby-area a").length; if (f === 0) { $(".powerby-area").css("cursor", "pointer"); $(".powerby-area").click(function () { window.open(g) }) } else { var b = $(".powerby-area.bottom-words").find("a"); if (b && (b == "http://www.clouddream.net/" || b == "https://www.aliyun.com/product/ecs" || b == h || b == e)) { $(".powerby-area.bottom-words").find("a").attr("href", g) } } } var d = $("#xPowered img"); if (d) { d.parent().attr("href", g) } var c = $(".ali-area.bottom-words"); if (c && c.find("a").attr("href") !== "#") { $(".ali-area.bottom-words").find("a").attr("href", g) } }); "object" != typeof JSON && (JSON = {}), function () { function f(a) { return 10 > a ? "0" + a : a } function this_value() { return this.valueOf() } function quote(a) { return rx_escapable.lastIndex = 0, rx_escapable.test(a) ? '"' + a.replace(rx_escapable, function (a) { var b = meta[a]; return "string" == typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + a + '"' } function str(a, b) { var c, d, e, f, h, g = gap, i = b[a]; switch (i && "object" == typeof i && "function" == typeof i.toJSON && (i = i.toJSON(a)), "function" == typeof rep && (i = rep.call(b, a, i)), typeof i) { case "string": return quote(i); case "number": return isFinite(i) ? String(i) : "null"; case "boolean": case "null": return String(i); case "object": if (!i) { return "null" } if (gap += indent, h = [], "[object Array]" === Object.prototype.toString.apply(i)) { for (f = i.length, c = 0; f > c; c += 1) { h[c] = str(c, i) || "null" } return e = 0 === h.length ? "[]" : gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]" : "[" + h.join(",") + "]", gap = g, e } if (rep && "object" == typeof rep) { for (f = rep.length, c = 0; f > c; c += 1) { "string" == typeof rep[c] && (d = rep[c], e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e)) } } else { for (d in i) { Object.prototype.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e)) } } return e = 0 === h.length ? "{}" : gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}" : "{" + h.join(",") + "}", gap = g, e } } var gap, indent, meta, rep, rx_one = /^[\],:{}\s]*$/, rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rx_four = /(?:^|:|,)(?:\s*\[)+/g, rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null }, Boolean.prototype.toJSON = this_value, Number.prototype.toJSON = this_value, String.prototype.toJSON = this_value), "function" != typeof JSON.stringify && (meta = { "\b": "\\b", " ": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, JSON.stringify = function (a, b, c) { var d; if (gap = "", indent = "", "number" == typeof c) { for (d = 0; c > d; d += 1) { indent += " " } } else { "string" == typeof c && (indent = c) } if (rep = b, b && "function" != typeof b && ("object" != typeof b || "number" != typeof b.length)) { throw new Error("JSON.stringify") } return str("", { "": a }) }), "function" != typeof JSON.parse && (JSON.parse = function (text, reviver) { function walk(a, b) { var c, d, e = a[b]; if (e && "object" == typeof e) { for (c in e) { Object.prototype.hasOwnProperty.call(e, c) && (d = walk(e, c), void 0 !== d ? e[c] = d : delete e[c]) } } return reviver.call(a, b, e) } var j; if (text = String(text), rx_dangerous.lastIndex = 0, rx_dangerous.test(text) && (text = text.replace(rx_dangerous, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) })), rx_one.test(text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, ""))) { return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({ "": j }, "") : j } throw new SyntaxError("JSON.parse") }) }(); +function (b, a) { b.fn.fullScreen = function (c) { var d = b(document).width(); var e = b(a).width(); return this.each(function () { var i = b(this); var g = i.parent().width(); var f = Math.max(e, d); var h = 0; if (f > g) { h = parseInt((f - g) * 10 / 2) / 10 } i.css({ "left": -h }); i.css({ "width": f }); if (typeof c == "function") { c(i) } }) }; b.fn.navfullScreen = function (c) { var d = b(document).width(); var e = b(a).width(); return this.each(function () { var k = b(this); var i = k.parent().width(); var g = Math.max(e, d); k.css({ "width": g }); k.parent().css("width", "").css("left", ""); k.parent().parent().parent().css({ "width": g }); if (typeof c == "function") { c(k) } var h = k.find(".logo-area"); var f = k.find(".nav-area"); setTimeout(function () { var l = parseInt(h.attr("data-width")) * g / 100; var m = parseInt(f.attr("data-width")) * g / 100; h.css("width", l + "px"); f.css("width", m + "px") }, 20) }) }; b.fn.altasfullScreen = function (c) { var e = b(document).height(); var d = b(a).height(); var f = b(a).width(); return this.each(function () { var h = b(this); var g = h.offset().left; h.css({ "left": -g, "width": f }) }) }; b.fn.cutFillAuto = function () { var e, d, f, c; return this.cutFill(e, d, f, c, true) }; b.fn.cutFill = function (f, e, i, d, c) { var g = f; var k = e; var h = function (n, m, l, o) { if (n.attr("src") != "") { if (typeof g === "undefined") { m = n.width() } if (typeof k === "undefined") { l = n.height() } _cutFillInit(n, m, l, o) } }; this.each(function () { var n = b(this); var l = n.hasClass("NoCutFill"); if (l) { return true } if (c) { if (n.attr("init") != "ok") { return true } if (n.attr("autoFill") != "ok") { return true } } var m = false; if (typeof g === "undefined" && typeof k === "undefined") { if (n.attr("autoFill") == "ok") { n.css("width", "").css("height", "").css("margin-left", "").css("margin-top", ""); m = true } else { if (!c) { n.attr("autoFill", "ok") } } } if (!c) { n.attr("init", "ok") } if (n[0].complete) { if (m) { var o = parseInt(n.attr("timeoutId")); if (o > 0) { clearTimeout(o) } o = setTimeout(function () { h(n, f, e, i) }, 100); n.attr("timeoutId", o) } else { h(n, f, e, i) } } else { n.on("load", function () { h(n, f, e, i) }) } if (typeof d == "function") { d(n) } }); return this }; _cutFillInit = function (f, i, k, o) { var h = b(f); var c = parseInt(i); var m = parseInt(k); var l = h[0].naturalWidth; var g = h[0].naturalHeight; var d = c / 2; var e = m / 2; var n = l / g; if (n >= 1.5) { if (c > m * n) { h.css("width", c + "px").css("height", "auto").css("marginTop", (e - (d * parseInt(g) / parseInt(l))) + "px") } else { if (o || typeof o == "undefined") { h.css("width", "auto").css("height", m + "px").css("marginLeft", (d - (e * parseInt(l) / parseInt(g))) + "px") } else { h.css("width", "auto").css("height", m + "px") } } } else { if (m > c / n) { h.css("width", "auto").css("height", m + "px").css("marginLeft", (d - (e * parseInt(l) / parseInt(g))) + "px") } else { h.css("width", c + "px").css("height", "auto").css("marginTop", (e - (d * parseInt(g) / parseInt(l))) + "px") } } }; b.fn.FixFill = function (g, f, k) { var d = new Image(); d.src = this.attr("src"); var c = d.width; var e = d.height; var i = {}; if (k == "x") { i.width = g; i.height = parseInt(g * e / c, 10) } else { if (k == "y") { i.height = f; i.width = parseInt(f * c / e, 10) } else { if (c > e) { i.width = g; i.height = parseInt(g * e / c, 10) } else { i.height = f; i.width = parseInt(f * c / e, 10) } } } return i }; b.fn.disableDrag = function () { b(this).draggable("option", "disabled", true) }; b.fn.enableDrag = function () { b(this).draggable("option", "disabled", false) }; b.fn.disableResize = function () { b(this).resizable("option", "disabled", true) }; b.fn.enableResize = function () { b(this).resizable("option", "disabled", false) } }(jQuery, window) + function (b) { var a; a = function () { this.options = { controlId: "", languageId: 2, isHideTitle: false }; this.init = function (c) { b.extend(this.options, c || {}); if (this.options.isHideTitle) { return false } var n = window.location.origin; if (!n) { n = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "") } var l = document.referrer; if (l != undefined && l != "" && l.indexOf(n) > -1) { var g = l.substring(n.length, l.length).toLowerCase(); var e = l.substring(n.length, l.length).toLowerCase(); if (g.indexOf("/") === 0) { g = g.substring(1, g.length) } if (g.indexOf("?") > -1) { g = g.substring(0, g.indexOf("?")) } var d = RegExp(/^\w*[a-zA-Z]+\w*$/); var i = b("#" + this.options.controlId + " .w-crumbs").height(); var k = b("#" + this.options.controlId + " .w-crumbs-item:first").text(); if (d.test(g)) { var o = g + "_" + this.options.languageId; var m = sessionStorage.getItem(o); if (m != null && m != k) { var f = ""; var h = b("#" + this.options.controlId + " .w-crumbs i:first"); if (h.length > 0) { f += ' ' + b(h).html() + "" } f += ' ' + m + ""; b("#" + this.options.controlId + " a.w-crumbs-item:first").after(f); this.smrecompute(i) } } } }; this.smrecompute = function (d) { var c = b("#" + this.options.controlId + " .w-crumbs").height(); b("#" + this.options.controlId).smrecompute("recomputeTo", [c, d]) } }; b.fn.smartNPCrumbsControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.wzArticleCrumbsControl") } } } }(jQuery); +function (b) { var a; a = function () { this.options = { controlId: "", quantity: "w-num-input", minus: "w-num-minus", plus: "w-num-plus" }; this.init = function (c) { b.extend(this.options, c || {}); this._quantityElement = b("#" + this.options.controlId + " ." + this.options.quantity); this._minusElement = b("#" + this.options.controlId + " ." + this.options.minus); this._plusElement = b("#" + this.options.controlId + " ." + this.options.plus); this._bindEvent() }; this._formatQuantity = function (d) { var c = parseInt(d); if (isNaN(c) || c < 1) { c = 1 } if (c > 9999) { c = 9999 } this._quantityElement.val(c); if (c == 1) { b(this._minusElement).addClass("w-num-disabled"); b(this._minusElement).addClass("mw-num-disabled") } else { if (c > 1) { b(this._minusElement).removeClass("w-num-disabled"); b(this._minusElement).removeClass("mw-num-disabled") } } }; this._bindEvent = function () { var c = this; b(c._minusElement).bind("click", function (e) { var d = c._quantityElement.val(); d = parseInt(d) - 1; c._formatQuantity(d); c._stopPropagation(e)._preventDefault(e) }); b(c._plusElement).bind("click", function (e) { var d = c._quantityElement.val(); d = parseInt(d) + 1; c._formatQuantity(d); c._stopPropagation(e)._preventDefault(e) }); b(c._quantityElement).bind("keypress", function (e) { var d = d || e; currKey = d.keyCode || d.which || d.charCode; if ((currKey >= 48 && currKey <= 57) || currKey == 8) { } else { return false } }); b(c._quantityElement).bind("blur", function (e) { var d = c._quantityElement.val().replace(/\D/g, ""); c._formatQuantity(d) }); b(c._quantityElement).bind("afterpaste", function (e) { var d = c._quantityElement.val().replace(/\D/g, ""); c._formatQuantity(d); c._stopPropagation(e)._preventDefault(e) }) }; this._stopPropagation = function (c) { if (c && c.stopPropagation) { c.stopPropagation() } else { c.cancelBubble = true } return this }; this._preventDefault = function (c) { if (c && c.preventDefault) { c.preventDefault() } else { c.returnValue = false } return this } }; b.fn.wzQuantitySmartControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.wzQuantitySmartControl") } } } }(jQuery); +function (b) { var a; a = function () { var c = this; this.options = { controlId: "", entityId: 1, entityType: 1, pageIndex: 1, pageSize: 1, totalPageCount: 1, totalCount: 0, replyText: "回复", changeCaptchaText: "换一张", summitText: "发表", isShowAvatar: true, isShowReplyIcon: true, replyIcon: "ꂖ", isMustLogin: true, isLogin: false, pagerStyle: "Style1_Item0", isShowPager: true, eventSource: undefined, isPosting: false, postType: "comment", commentTextEmpty: "请输入评论内容", commentTextMaxLength: "评论内容最长支付400个字符", replyTextEmpty: "请输入回复内容", replyTextMaxLength: "回复内容最长支付400个字符", captchaEmpty: "请输入验证码", captchaError: "验证码错误", error: "提交的数据有错误", pageNumberError: "请输入正确有页码", postCommentSucess: "提交评论成功", postCommentFail: "提交评论失败", postReplySucess: "回复评论成功", postReplyFail: "回复评论失败", adminUserName: "管理员", anonymousUserName: "匿名用户", isHiddenFullName: false }; this.init = function (e) { b.extend(this.options, e || {}); var d = b("#pageinfo").attr("data-entityid"); var f = b("#pageinfo").attr("data-type"); if (typeof d !== "undefined") { this.options.entityId = parseInt(d) } if (typeof f !== "undefined") { this.options.entityType = parseInt(f) } this.loadCommentInfo() }; this.refreshCommentCaptcha = function (e, d) { this.options["Timestamp" + d] = Math.random(); b(e).attr("src", "/Common/GenerateCommentCaptcha?timestamp=" + this.options["Timestamp" + d]) }; this.loadCommentInfo = function () { b("#" + this.options.controlId + " .w_pager").hide(); var d = this; b.ajax({ url: "/Common/GetCommentInfo", type: "POST", async: true, data: { entityId: d.options.entityId, entityType: d.options.entityType, isHiddenFullName: d.options.isHiddenFullName }, timeout: 5000, dataType: "json", success: function (f) { if (f.IsAllowComments) { var e = b("#" + d.options.controlId + " .w-comment-loginInfo"); var g = b("#" + d.options.controlId + " .w-comment-code"); if (f.IsLogin) { e.find("img").attr("src", f.Avatar); e.find(".name").text(f.UserName); e.parents(".w-comment-top").addClass("w-contleft"); e.show(); g.hide(); d.options.isLogin = true } else { d.options.isLogin = false; e.hide(); g.show() } b("#" + d.options.controlId).find(".w-comment").show(); d.initCommentHeight(); d.bindEvent(); d.loadCommentList(); d.refreshCommentCaptcha(b("#" + d.options.controlId + " .w-comment-top img.validCodeImg"), 0) } else { b("#" + d.options.controlId).remove() } } }) }; this.ajaxLogout = function () { var d = this; b.ajax({ url: "/Customer/AjaxLogout", type: "POST", async: true, data: {}, timeout: 5000, dataType: "json", success: function (e) { if (e.IsSuccess) { b.get("/customer/GenerateNewCSRFToken", {}, function (g) { b('input[name="__RequestVerificationToken"]').val(g.token); var f = b("#" + d.options.controlId + " .w-comment-loginInfo"); var h = b("#" + d.options.controlId + " .w-comment-code"); f.parents(".w-comment-top").removeClass("w-contleft"); f.hide(); h.show() }, "json") } } }) }; this.loadCommentList = function (e) { var d = this; var f = {}; f.entityId = d.options.entityId; f.entityType = d.options.entityType; f.pageIndex = d.options.pageIndex; f.pageSize = d.options.pageSize; f.isHiddenFullName = d.options.isHiddenFullName; b.ajax({ url: "/Comment/LoadCommentList", type: "POST", async: true, data: f, timeout: 5000, dataType: "json", success: function (g) { if (g.IsSuccess) { var p = b("#" + d.options.controlId + " .w-comment").height(); b("#" + d.options.controlId + " .w-comment-bottom .w-comment-num .text").text(g.total); var l = ""; var o = g.rows; for (var k = 0; k < o.length; k++) { var n = o[k]; if (n.CommentUserName == "Comment.UserName.Admin") { n.CommentUserName = d.options.adminUserName } if (n.CommentUserName == "Comment.UserName.Anonymous") { n.CommentUserName = d.options.anonymousUserName } l += '
'; l += ' '; l += "
"; l += '
'; l += '
' + n.CommentUserName + ' ' + n.CreateDatetime + "
"; l += '
' + n.CommentText + "
"; if (n.Reply != undefined && n.Reply != null && n.Reply.length > 0) { for (var h = 0; h < n.Reply.length; h++) { var m = n.Reply[h]; if (m.CommentUserName == "Comment.UserName.Admin") { m.CommentUserName = d.options.adminUserName } if (m.CommentUserName == "Comment.UserName.Anonymous") { m.CommentUserName = d.options.anonymousUserName } l += '
'; l += '
'; l += '
' + m.CommentUserName + ":
"; l += '
' + m.CommentText + "
"; l += "
"; l += "
" } } l += '
' + d.options.replyIcon + " " + d.options.replyText + "
"; l += ' "; l += "
"; l += " " } b("#" + d.options.controlId + " .w-comment-bottom .w-comment-list").html(l); d.options.totalPageCount = g.pageTotal; d.options.totalCount = g.total; d.showPager(); d.smrecompute(p); if (e) { d.goToComemntTextbox() } } } }) }; this.bindEvent = function () { var d = this; b("#" + this.options.controlId + " .w-comment-top img.validCodeImg").on("click", function () { d.refreshCommentCaptcha(this, 0) }); b("#" + this.options.controlId + " .w-comment-bottom .w-comment-list").on("click", "a.toggleReply", function () { var g = b("#" + d.options.controlId + " .w-comment").height(); if (b(this).parent().next().is(":hidden")) { if (!d.options.isLogin) { var f = b(this).parent().next().find("img"); if (f.attr("src").toLowerCase() == "/content/images/code.png") { var e = b("#" + d.options.controlId + " .w-comment-bottom .w-comment-list img.validCodeImg").index(f); e = e + 1; d.refreshCommentCaptcha(f, e) } } else { b(this).parent().next().find(".w-comment-code").hide() } b(this).parent().addClass("open"); b(this).parent().next().show() } else { b(this).parent().removeClass("open"); b(this).parent().next().hide() } d.smrecompute(g) }); b("#" + this.options.controlId + " .w-comment-bottom .w-comment-list").on("click", "img.validCodeImg", function () { var e = b("#" + d.options.controlId + " .w-comment-bottom .w-comment-list img.validCodeImg").index(this); e = e + 1; d.refreshCommentCaptcha(b(this), e) }); b("#" + this.options.controlId + "").on("click", ".w-comment-button a", function () { if (d.options.isPosting) { return false } if (d.options.isMustLogin) { d.getCurrentUser(); if (!d.options.isLogin) { d.ajaxLogin(); return } } if (b(this).parents(".w-comment-list-reply-cont").length > 0) { d.options.eventSource = this; d.options.postType = "reply"; d.submitReply() } else { d.options.eventSource = this; d.options.postType = "comment"; d.submitComment() } }); b("#" + this.options.controlId + " .w-comment-top .w-comment-loginInfo").on("click", "a.quit", function () { d.ajaxLogout() }); b("#" + this.options.controlId + "").on("keyup", "textarea", function () { var e = b(this).val().length; b(this).next().find("span").text(e) }); b("#" + this.options.controlId).on("click", "textarea", function () { if (d.options.isMustLogin) { d.getCurrentUser(); if (!d.options.isLogin) { d.ajaxLogin() } } }) }; this.submitComment = function () { var f = this.serializePostData(); var d = 0; f.Timestamp = this.options["Timestamp" + d]; var e = this.checkPostData(f); if (e) { f.CommentText = escape(f.CommentText); this.postComment(f) } }; this.submitReply = function () { var f = this.serializePostData(); var g = b(this.options.eventSource).parent().prev().find(".validCodeImg"); var d = b("#" + this.options.controlId + " .w-comment-bottom .w-comment-list img.validCodeImg").index(g); d = d + 1; f.Timestamp = this.options["Timestamp" + d]; f.AtCommentId = b(this.options.eventSource).parents(".w-comment-list-item").attr("commentid"); var e = this.checkPostData(f); if (e) { f.CommentText = escape(f.CommentText); this.postComment(f) } }; this.checkPostData = function (e) { var d = this.options.postType; this.clearError(); if (b.trim(e.CommentText) == "") { if (d == "comment") { this.showError(this.getCurrentCommentElement(), this.options.commentTextEmpty) } else { this.showError(this.getCurrentCommentElement(), this.options.replyTextEmpty) } return false } else { if (e.CommentText.length > 400) { if (d == "comment") { this.showError(this.getCurrentCommentElement(), this.options.commentTextMaxLength) } else { this.showError(this.getCurrentCommentElement(), this.options.replyTextMaxLength) } return false } } if (b.trim(e.Captcha) == "") { if (d == "comment") { if (!this.options.isLogin) { this.showError(this.getCurrentCaptchaElement(), this.options.captchaEmpty); return false } } else { if (!this.options.isLogin) { this.showError(this.getCurrentCaptchaElement(), this.options.captchaEmpty); return false } } } return true }; this.serializePostData = function () { var e = this.options.eventSource; var d = {}; d.CommentText = b(e).parent().parent().parent().find("textarea").val(); d.CommentText = b.trim(d.CommentText); d.Captcha = b(e).parent().parent().find(".w-comment-code-input").val(); d.EntityId = this.options.entityId; d.EntityType = this.options.entityType; return d }; this.smrecompute = function (e) { var d = b("#" + this.options.controlId + " .w-comment").height(); b("#" + this.options.controlId).smrecompute("recomputeTo", [d, e]) }; this.postComment = function (e) { var d = this; d.options.isPosting = true; b.ajax({ url: "/Comment/AddComment", type: "POST", async: true, data: e, timeout: 5000, dataType: "json", success: function (f) { if (f.IsSuccess) { if (d.options.postType == "comment") { alert(d.options.postCommentSucess) } else { alert(d.options.postReplySucess) } b(d.getCurrentCommentElement()).val(""); b(d.getCurrentCaptchaElement()).val(""); d.loadCommentList() } else { if (typeof f.validate != "undefined") { if (f.target == "Captcha") { d.showError(d.getCurrentCaptchaElement(), f.validate) } if (f.target == "Comment" || f.target == "Reply") { d.showError(d.getCurrentCommentElement(), f.validate) } } } }, complete: function () { d.options.isPosting = false } }) }; this.showPager = function () { var h = this.options.pagerStyle; var f = this.options.controlId; var d = this.options.pageIndex; var g = this.options.totalPageCount; if (this.options.isShowPager && this.options.totalPageCount > 1) { var e = b("#" + f).find(".xn-pager"); e.jqPaginator("option", { totalCounts: this.options.totalCount, onPageChange: this.onPageChange }); b("#" + f + " .xn-pager").show() } else { b("#" + f + " .xn-pager").hide() } }; this.ajaxLogin = function () { var d = this; b.get("/ebusiness/RenderLoginPartial", {}, function (e) { b("body").append(e); window["CommentAjaxLoginCallBack"] = function (f) { if (f.IsSuccess && f.IsLogin) { d.getCurrentUser() } } }) }; this.clearError = function () { b("#" + this.options.controlId + " .w-haserror").removeClass("w-haserror"); b("#" + this.options.controlId + " .notifi").remove() }; this.showError = function (g, e) { this.clearError(); b(g).parent().addClass("w-haserror"); b(g).parent().parent().append('' + e + ""); var d = b(this.options.eventSource).parent().prevAll(); var f = 0; d.each(function () { if (b(this).is(":visible")) { f = b(this).width() } }); b("#" + this.options.controlId).find(".notifi").css("left", f + "px") }; this.getCurrentCommentElement = function () { var d = this.options.eventSource; return b(d).parent().parent().parent().find("textarea") }; this.getCurrentCaptchaElement = function () { var d = this.options.eventSource; return b(d).parent().parent().parent().find(".w-comment-code-input") }; this.getCurrentUser = function () { var d = this; b.ajax({ url: "/Common/GetCommentInfo", type: "POST", async: true, data: { entityId: d.options.entityId, entityType: d.options.entityType }, timeout: 5000, dataType: "json", success: function (f) { var e = b("#" + d.options.controlId + " .w-comment-top .w-comment-loginInfo"); var g = b("#" + d.options.controlId + " .w-comment-top .w-comment-code"); if (f.IsLogin) { e.find("img").attr("src", f.Avatar); e.find(".name").text(f.UserName); e.parents(".w-comment-top").addClass("w-contleft"); e.show(); g.hide(); d.options.isLogin = true } else { d.options.isLogin = false; e.parents(".w-comment-top").removeClass("w-contleft"); e.hide(); g.show() } } }) }; this.goToComemntTextbox = function () { b("#" + this.options.controlId)[0].scrollIntoView() }; this.initCommentHeight = function () { var e = b("#" + this.options.controlId).height(); var d = b("#" + this.options.controlId + " .w-comment").height(); b("#" + this.options.controlId).css("min-height", d + "px"); b("#" + this.options.controlId).attr("hish", d); this.smrecompute(e) }; this.onPageChange = function (d, e) { if (e == "change") { if (d <= 0 || d == c.options.pageIndex || d > c.options.totalPageCount) { return } c.options.pageIndex = d; c.loadCommentList(true) } } }; b.fn.smartNPCommentControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.smartNPCommentControl") } } } }(jQuery); +function (b) { var a; a = function () { this.options = { controlId: "", controlType: "Pc", style: "Style1", $subjectElement: {}, $messageElement: {}, $emailElement: {}, $captchaElement: {}, $submitElement: {}, $resetElement: {}, isPosting: false, emptyPrefix: "请输入", correctMailPrefix: "请输入正确的", contentMaxLength: "不能超过200个字符", postSucess: "提交成功", postFail: "提交失败", correctMailValidate: "请输入正确格式的邮箱!" }; this.init = function (c) { b.extend(this.options, c || {}); this.options.$subjectElement = b("#" + this.options.controlId + " input[name='Subject']"); if (b("#" + this.options.controlId + " textarea[name='Message']").length > 0) { this.options.$messageElement = b("#" + this.options.controlId + " textarea[name='Message']") } else { this.options.$messageElement = b("#" + this.options.controlId + " input[name='Message']") } this.options.$emailElement = b("#" + this.options.controlId + " input[name='Email']"); this.options.$captchaElement = b("#" + this.options.controlId + " input[name='Captcha']"); this.options.$submitElement = b("#" + this.options.controlId + " a[name='Submit']"); this.options.$resetElement = b("#" + this.options.controlId + " a[name='Reset']"); if (b("#" + this.options.controlId + " .mw-guestbook").length > 0) { this.options.controlType = "Mobile" } this.options.style = b("#" + this.options.controlId).attr("cstyle"); b("#" + this.options.controlId + " .w-item-textarea").height(b("#" + this.options.controlId + " .w-guestbook-both-left").outerHeight() - 12); this.refreshLeavewordCaptcha(); this.bindEvent() }; this.refreshLeavewordCaptcha = function () { this.options["Timestamp"] = Math.random(); b("#" + this.options.controlId + " img").attr("src", "/code.do?timestamp=" + this.options["Timestamp"]) }; this.bindEvent = function () { var c = this; b("#" + this.options.controlId + " img").on("click", function () { c.refreshLeavewordCaptcha() }); b("#" + this.options.controlId).on("click", "a[name='Submit']", function () { if (c.options.isPosting) { return false } c.submitLeaveword() }); b("#" + this.options.controlId).on("click", "a[name='Reset']", function () { c.reset() }) }; this.submitLeaveword = function () { var d = this.serializePostData(); var c = this.checkPostData(d); if (c) { this.postLeaveword(d) } }; this.checkPostData = function (c) { this.clearError(); if (b.trim(c.Subject) == "") { this.showError(this.options.$subjectElement, this.options.emptyPrefix + " " + this.getElementTitle(this.options.$subjectElement)); return false } else { if (c.Subject.length > 200) { this.showError(this.options.$subjectElement, this.getElementTitle(this.options.$subjectElement) + " " + this.options.contentMaxLength); return false } } if (b.trim(c.Message) == "") { this.showError(this.options.$messageElement, this.options.emptyPrefix + " " + this.getElementTitle(this.options.$messageElement)); return false } if (b.trim(c.Email) == "") { this.showError(this.options.$emailElement, this.options.emptyPrefix + " " + this.getElementTitle(this.options.$emailElement)); return false } if (b.trim(c.Captcha) == "") { this.showError(this.options.$captchaElement, this.options.emptyPrefix + " " + this.getElementTitle(this.options.$captchaElement)); return false } return true }; this.serializePostData = function () { var c = {}; c.Subject = this.options.$subjectElement.val(); c.Message = this.options.$messageElement.val(); c.Email = this.options.$emailElement.val(); c.Captcha = this.options.$captchaElement.val(); c.Timestamp = this.options["Timestamp"]; c.emailPlaceHolder = this.options.$emailElement.attr("placeholder"); return c }; this.smrecompute = function () { b("#" + this.options.controlId).smrecompute() }; this.postLeaveword = function (d) { var c = this; c.options.isPosting = true; d.Subject = escape(d.Subject); d.Message = escape(d.Message); b.ajax({ url: "/Leaveword/AppendLeaveword", type: "POST", async: true, data: d, timeout: 5000, dataType: "json", success: function (e) { if (e.IsSuccess) { alert(c.options.postSucess); c.reset(); c.refreshLeavewordCaptcha() } else { if (e.target != undefined && e.target == "Captcha") { c.showError(c.options.$captchaElement, e.validate) } else { alert(c.options.postFail) } } }, complete: function () { c.options.isPosting = false } }) }; this.clearError = function () { if (this.options.controlType == "Pc") { b("#" + this.options.controlId + " .w-verify").addClass("w-hide"); b("#" + this.options.controlId + " .w-verify-text").text("") } else { b("#" + this.options.controlId + " .mw-verify").addClass("mw-hide"); b("#" + this.options.controlId + " .mw-verify-text").text("") } b("#" + this.options.controlId + " .w-haserror").removeClass("w-haserror") }; this.showError = function (d, c) { this.clearError(); if (this.options.style == "Style6" && b(d).attr("name") == "Message") { b(d).parent().parent().addClass("w-haserror") } else { b(d).parent().addClass("w-haserror") } if (this.options.controlType == "Pc") { b("#" + this.options.controlId + " .w-verify-text").text(c); b("#" + this.options.controlId + " .w-verify").removeClass("w-hide") } else { b("#" + this.options.controlId + " .mw-verify-text").text(c); b("#" + this.options.controlId + " .mw-verify").removeClass("mw-hide") } }; this.getElementTitle = function (c) { var d = ""; if (this.options.controlType == "Pc") { if (this.options.style == "Style1") { return c.attr("placeHolder") } else { if (this.options.style == "Style2") { if (c.attr("name") == "Captcha") { return c.parent().parent().prev().html() } else { return c.parent().prev().html() } } else { if (this.options.style == "Style3") { return c.parents("td").prev().find("label").html() } else { if (this.options.style == "Style4" || this.options.style == "Style5" || this.options.style == "Style6") { return c.attr("placeHolder") } } } } } else { if (this.options.style == "Style1") { return c.attr("placeHolder") } else { if (this.options.style == "Style2") { return c.attr("placeHolder") } } } }; this.reset = function () { this.clearError(); this.options.$subjectElement.val(""); this.options.$messageElement.val(""); this.options.$emailElement.val(""); this.options.$captchaElement.val("") } }; b.fn.smartNPLeavewordControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.smartNPLeavewordControl") } } } }(jQuery); +function (b) { var a; a = function () { var c = this; this.options = { controlId: "", entityId: 1, entityType: 1, pageIndex: 1, pageSize: 1, totalPageCount: 1, totalCount: 0, replyText: "回复", changeCaptchaText: "换一张", summitText: "发表", isShowAvatar: true, isShowReplyIcon: true, replyIcon: "ꂖ", isMustLogin: true, isLogin: false, pagerStyle: "Style1_Item0", isShowPager: true, eventSource: undefined, isPosting: false, postType: "comment", commentTextEmpty: "请输入评论内容", commentTextMaxLength: "评论内容最长支付400个字符", replyTextEmpty: "请输入回复内容", replyTextMaxLength: "回复内容最长支付400个字符", captchaEmpty: "请输入验证码", captchaError: "验证码错误", error: "提交的数据有错误", pageNumberError: "请输入正确有页码", postCommentSucess: "提交评论成功", postCommentFail: "提交评论失败", postReplySucess: "回复评论成功", postReplyFail: "回复评论失败", adminUserName: "管理员", anonymousUserName: "匿名用户", isHiddenFullName: false, atCommentId: 0 }; this.init = function (e) { b.extend(this.options, e || {}); var d = b("#pageinfo").attr("data-entityid"); var f = b("#pageinfo").attr("data-type"); if (typeof d !== "undefined") { this.options.entityId = parseInt(d) } if (typeof f !== "undefined") { this.options.entityType = parseInt(f) } this.loadCommentInfo() }; this.refreshCommentCaptcha = function (e, d) { this.options["Timestamp" + d] = Math.random(); b(e).attr("src", "/Common/GenerateCommentCaptcha?timestamp=" + this.options["Timestamp" + d]) }; this.loadCommentInfo = function () { b("#" + this.options.controlId + " .w_pager").hide(); var d = this; b.ajax({ url: "/Common/GetCommentInfo", type: "POST", async: true, data: { entityId: d.options.entityId, entityType: d.options.entityType, isHiddenFullName: d.options.isHiddenFullName }, timeout: 5000, dataType: "json", success: function (f) { if (f.IsAllowComments) { var e = b("#" + d.options.controlId + " .mw-comment-dialogue-cont .mw-comment-loginInfo"); var g = b("#" + d.options.controlId + " .mw-comment-dialogue-cont .mw-comment-code"); if (f.IsLogin) { e.find("img").attr("src", f.Avatar); e.find(".name").text(f.UserName); e.show(); g.hide(); d.options.isLogin = true } else { d.options.isLogin = false; e.hide(); g.show() } b("#" + d.options.controlId).find(".mw-comment").show(); d.initCommentHeight(); d.bindEvent(); d.loadCommentList(); d.refreshCommentCaptcha(b("#" + d.options.controlId + " .mw-comment-dialogue-cont img.validCodeImg"), 0) } else { b("#" + d.options.controlId).remove() } } }) }; this.ajaxLogout = function () { var d = this; b.ajax({ url: "/Customer/AjaxLogout", type: "POST", async: true, data: {}, timeout: 5000, dataType: "json", success: function (e) { if (e.IsSuccess) { b.get("/customer/GenerateNewCSRFToken", {}, function (g) { b('input[name="__RequestVerificationToken"]').val(g.token); var f = b("#" + d.options.controlId + " .mw-comment-loginInfo"); var h = b("#" + d.options.controlId + " .mw-comment-code"); f.hide(); h.show() }, "json") } } }) }; this.loadCommentList = function (e) { var d = this; var f = {}; f.entityId = d.options.entityId; f.entityType = d.options.entityType; f.pageIndex = d.options.pageIndex; f.pageSize = d.options.pageSize; f.isHiddenFullName = d.options.isHiddenFullName; b.ajax({ url: "/Comment/LoadCommentList", type: "POST", async: true, data: f, timeout: 5000, dataType: "json", success: function (g) { if (g.IsSuccess) { var p = b("#" + d.options.controlId + " .mw-comment").height(); b("#" + d.options.controlId + " .mw-comment-num .text").text(g.total); var l = ""; var o = g.rows; for (var k = 0; k < o.length; k++) { var n = o[k]; if (n.CommentUserName == "Comment.UserName.Admin") { n.CommentUserName = d.options.adminUserName } if (n.CommentUserName == "Comment.UserName.Anonymous") { n.CommentUserName = d.options.anonymousUserName } l += '
'; l += ' '; l += "
"; l += '
'; l += '
' + n.CreateDatetime + '' + n.CommentUserName + "
"; l += '
' + n.CommentText + "
"; if (n.Reply != undefined && n.Reply != null && n.Reply.length > 0) { for (var h = 0; h < n.Reply.length; h++) { var m = n.Reply[h]; if (m.CommentUserName == "Comment.UserName.Admin") { m.CommentUserName = d.options.adminUserName } if (m.CommentUserName == "Comment.UserName.Anonymous") { m.CommentUserName = d.options.anonymousUserName } l += '
'; l += '
'; l += '
' + m.CommentUserName + ":
"; l += '
' + m.CommentText + "
"; l += "
"; l += "
" } } l += '
' + d.options.replyIcon + " " + d.options.replyText + "
"; l += "
"; l += " " } b("#" + d.options.controlId + " .mw-comment-list").html(l); d.options.totalPageCount = g.pageTotal; d.options.totalCount = g.total; d.showPager(); d.smrecompute(p); if (e) { d.goToComemntTextbox() } } } }) }; this.bindEvent = function () { var d = this; b("#" + this.options.controlId + " .mw-comment-dialogue-cont img.validCodeImg").on("click", function () { d.refreshCommentCaptcha(this, 0) }); b("#" + this.options.controlId + " .mw-comment-list").on("click", "a.toggleReply", function () { d.options.eventSource = this; if (d.options.isMustLogin) { d.getCurrentUser(d.showReply) } else { d.showReply() } }); b("#" + this.options.controlId + " .mw-comment-dialogue-cont .mw-comment-button").on("click", function () { if (d.options.isPosting) { return false } if (d.options.isMustLogin) { d.getCurrentUser(d.checkPostLogin) } else { if (d.options.postType == "reply") { d.submitReply() } else { d.submitComment() } } }); b("#" + this.options.controlId + " .mw-comment-dialogue-cont .mw-comment-loginInfo").on("click", "a.quit", function () { d.ajaxLogout() }); b("#" + this.options.controlId + "").on("keyup", "textarea", function () { var e = b(this).val().length; b(this).next().find("span").text(e) }); b("#" + this.options.controlId).on("click", "textarea", function () { }); b("#" + this.options.controlId + " .mw-comment-input").on("click", function () { if (d.options.isMustLogin) { d.getCurrentUser(d.showComment) } else { d.showComment() } }); b("#" + this.options.controlId + " .mw-close").on("click", function () { d.closeCommentDialog() }) }; this.submitComment = function () { var f = this.serializePostData(); var d = 0; f.Timestamp = this.options["Timestamp" + d]; var e = this.checkPostData(f); if (e) { f.CommentText = escape(f.CommentText); this.postComment(f) } }; this.submitReply = function () { var e = this.serializePostData(); index = 0; e.Timestamp = this.options["Timestamp" + index]; e.AtCommentId = this.options.atCommentId; var d = this.checkPostData(e); if (d) { e.CommentText = escape(e.CommentText); this.postComment(e) } }; this.checkPostData = function (e) { var d = this.options.postType; this.clearError(); if (b.trim(e.CommentText) == "") { if (d == "comment") { this.showError(this.getCurrentCommentElement(), this.options.commentTextEmpty) } else { this.showError(this.getCurrentCommentElement(), this.options.replyTextEmpty) } return false } else { if (e.CommentText.length > 400) { if (d == "comment") { this.showError(this.getCurrentCommentElement(), this.options.commentTextMaxLength) } else { this.showError(this.getCurrentCommentElement(), this.options.replyTextMaxLength) } return false } } if (b.trim(e.Captcha) == "") { if (d == "comment") { if (!this.options.isLogin) { this.showError(this.getCurrentCaptchaElement(), this.options.captchaEmpty); return false } } else { if (!this.options.isLogin) { this.showError(this.getCurrentCaptchaElement(), this.options.captchaEmpty); return false } } } return true }; this.serializePostData = function () { var d = {}; d.CommentText = b("#" + this.options.controlId).find("textarea").val(); d.CommentText = b.trim(d.CommentText); d.Captcha = b("#" + this.options.controlId).find(".mw-comment-code-input").val(); d.EntityId = this.options.entityId; d.EntityType = this.options.entityType; return d }; this.smrecompute = function (e) { var d = b("#" + this.options.controlId + " .mw-comment").height(); b("#" + this.options.controlId).smrecompute("recomputeTo", [d, e]) }; this.postComment = function (e) { var d = this; d.options.isPosting = true; b.ajax({ url: "/Comment/AddComment", type: "POST", async: true, data: e, timeout: 5000, dataType: "json", success: function (f) { if (f.IsSuccess) { if (d.options.postType == "comment") { alert(d.options.postCommentSucess) } else { alert(d.options.postReplySucess) } b(d.getCurrentCommentElement()).val(""); b(d.getCurrentCaptchaElement()).val(""); d.loadCommentList(); d.closeCommentDialog() } else { if (typeof f.validate != "undefined") { if (f.target == "Captcha") { d.showError(d.getCurrentCaptchaElement(), f.validate) } if (f.target == "Comment" || f.target == "Reply") { d.showError(d.getCurrentCommentElement(), f.validate) } } } }, complete: function () { d.options.isPosting = false } }) }; this.showPager = function () { var h = this.options.pagerStyle; var f = this.options.controlId; var d = this.options.pageIndex; var g = this.options.totalPageCount; if (this.options.isShowPager && this.options.totalPageCount > 1) { var e = b("#" + f).find(".xn-pager"); e.jqPaginator("option", { totalCounts: this.options.totalCount, onPageChange: this.onPageChange }); b("#" + f + " .xn-pager").show() } else { b("#" + f + " .xn-pager").hide() } }; this.ajaxLogin = function () { var d = this; b.get("/ebusiness/RenderLoginPartial", {}, function (e) { b("body").append(e); window["CommentAjaxLoginCallBack"] = function (f) { if (f.IsSuccess && f.IsLogin) { d.getCurrentUser() } } }) }; this.clearError = function () { b("#" + this.options.controlId + " .w-haserror").removeClass("w-haserror"); b("#" + this.options.controlId + " .notifi").remove() }; this.showError = function (e, d) { this.clearError(); b("#" + this.options.controlId + " .mw-comment-dialogue .mw-comment-title").after('
' + d + "
"); b(e).addClass("w-haserror") }; this.getCurrentUser = function (e) { var d = this; b.ajax({ url: "/Common/GetCommentInfo", type: "POST", async: true, data: { entityId: d.options.entityId, entityType: d.options.entityType }, timeout: 5000, dataType: "json", success: function (g) { var f = b("#" + d.options.controlId + " .mw-comment-dialogue-cont .mw-comment-loginInfo"); var h = b("#" + d.options.controlId + " .mw-comment-dialogue-cont .mw-comment-code"); if (g.IsLogin) { f.find("img").attr("src", g.Avatar); f.find(".name").text(g.UserName); f.show(); h.hide(); d.options.isLogin = true } else { d.options.isLogin = false; f.hide(); h.show() } if (typeof e == "function") { e.call(d) } } }) }; this.getCurrentCommentElement = function () { return b("#" + this.options.controlId).find("textarea") }; this.getCurrentCaptchaElement = function () { return b("#" + this.options.controlId).find(".mw-comment-code ") }; this.goToComemntTextbox = function () { b("#" + this.options.controlId)[0].scrollIntoView() }; this.initCommentHeight = function () { var e = b("#" + this.options.controlId).height(); var d = b("#" + this.options.controlId + " .mw-comment").height(); b("#" + this.options.controlId).css("min-height", d + "px"); b("#" + this.options.controlId).attr("hish", d); this.smrecompute(e) }; this.onPageChange = function (d, e) { if (e == "change") { if (d <= 0 || d == c.options.pageIndex || d > c.options.totalPageCount) { return } c.options.pageIndex = d; c.loadCommentList(true) } }; this.closeCommentDialog = function () { b("#" + this.options.controlId + " .mw-comment-dialogue-wrap").hide(); b("#" + this.options.controlId).removeClass("dialogshowed") }; this.showReply = function () { if (this.options.isMustLogin && !this.options.isLogin) { this.ajaxLogin(); return } else { var e = this.options.eventSource; var d = b(e).parents(".mw-comment-list-item").attr("commentid"); var f = b(e).parents(".mw-comment-list-con").find(".mw-comment-list-time").find(".mw-fl").text(); b("#" + this.options.controlId + " textarea").attr("placeholder", this.options.replyText + " " + f + ":"); b("#" + this.options.controlId + " textarea").next().find("span").text(0); b("#" + this.options.controlId + " textarea").val(""); this.clearError(); this.options.postType = "reply"; this.options.atCommentId = d; this.refreshCommentCaptcha(b("#" + this.options.controlId + " .mw-comment-dialogue-cont img.validCodeImg"), 0); b("#" + this.options.controlId + " .mw-comment-code-input").val(""); b("#" + this.options.controlId + " .mw-comment-dialogue-wrap").show(); b("#" + this.options.controlId).addClass("dialogshowed") } }; this.showComment = function () { if (this.options.isMustLogin && !this.options.isLogin) { this.ajaxLogin(); return } else { this.options.postType = "comment"; this.options.atCommentId = 0; this.refreshCommentCaptcha(b("#" + this.options.controlId + " .mw-comment-dialogue-cont img.validCodeImg"), 0); b("#" + this.options.controlId + " .mw-comment-dialogue-wrap").show(); b("#" + this.options.controlId + " textarea").val(""); b("#" + this.options.controlId + " textarea").next().find("span").text(0); b("#" + this.options.controlId + " textarea").attr("placeholder", ""); b("#" + this.options.controlId + " .mw-comment-code-input").val(""); this.clearError(); b("#" + this.options.controlId).addClass("dialogshowed") } }; this.checkPostLogin = function () { if (!this.options.isLogin) { this.ajaxLogin(); return } else { if (this.options.postType == "reply") { this.submitReply() } else { this.submitComment() } } } }; b.fn.smartNPMobileCommentControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.smartNPMobileCommentControl") } } } }(jQuery); +function ($) { var baiDuShare; var shareJson; var shareNum = 0; baiDuShare = function () { this.options = { controlId: "", imageStyle: "", bdSize: "", }; this.init = function (opt) { $.extend(this.options, opt || {}); if (shareJson == "" || shareJson == undefined) { shareJson = "{'tag':'" + this.options.controlId + "','bdStyle':'" + this.options.imageStyle + "','bdSize':'" + this.options.bdSize + "'}" } else { shareJson += ",{'tag':'" + this.options.controlId + "','bdStyle':'" + this.options.imageStyle + "','bdSize':'" + this.options.bdSize + "'}" } var data = { pageId: (parseInt($("#pageinfo").attr("data-type")) - 1) == 1 ? $("#pageinfo").val() : $("#pageinfo").attr("data-entityid"), pageType: (parseInt($("#pageinfo").attr("data-type")) - 1) }; window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdPic": "", "bdMiniList": ["mshare", "qzone", "tsina", "weixin", "renren", "tqq", "bdxc", "tqf", "tieba", "douban", "sqq", "thx", "ibaidu"], "onAfterClick": function (cmd) { $.ajax({ cache: false, url: "/BaiDuShare/IncrementShareCount", type: "post", data: data, dataType: "json", success: function (result) { if (result.IsSuccess) { shareNum++; $(".bds_count").html(shareNum); $(".bds_count").attr("title", "累计分享" + shareNum + "次") } } }) } }, "share": eval("([" + shareJson + "])") }; if (window._bd_share_main != undefined) { window._bd_share_main.init() } } }; $.fn.smartShareControl = function (opt) { if (baiDuShare[opt]) { return baiDuShare[opt].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof opt === "object" || !opt) { new baiDuShare().init(opt); $("#smv_" + opt.controlId).find("div[data-tag='" + opt.controlId + "']").css("display", ""); window.onload = function () { var data = { pageId: (parseInt($("#pageinfo").attr("data-type")) - 1) == 1 ? $("#pageinfo").val() : $("#pageinfo").attr("data-entityid"), pageType: (parseInt($("#pageinfo").attr("data-type")) - 1) }; $.ajax({ cache: false, url: "/BaiDuShare/GetShareCount", type: "post", data: data, dataType: "json", success: function (result) { if (result.IsSuccess) { shareNum = result.num; $(".bds_count").html(shareNum); $(".bds_count").attr("title", "累计分享" + shareNum + "次") } else { $(".bds_count").html("0"); $(".bds_count").attr("title", "累计分享0次") } $(".mw-share .popup_more").attr("style", "background-position:inherit !important") } }); $("#smv_" + opt.controlId).find("div[data-tag='" + opt.controlId + "']").css("display", "") } } else { $.error("Method " + method + " does not exist on jQuery.smartShareControl") } } } }(jQuery); +function (b) { var a; a = function () { this.options = { controlId: "", controlType: "Pc", entityType: 1, entityId: 1, isLogin: false, isInMyFavourite: false, entityTypeName: "文章", favouriteSucess: "收藏成功", removeFavouriteSucess: "取消收藏成功" }; this.init = function (e) { b.extend(this.options, e || {}); var c = b("#pageinfo").attr("data-entityid"); var f = b("#pageinfo").attr("data-type"); if (typeof c !== "undefined") { this.options.entityId = parseInt(c) } if (typeof f !== "undefined") { this.options.entityType = parseInt(f) - 1 } this.bindEvent(); this.LoadFavorite(); if (b("#smvSysFavoriteModal").length == 0) { var d = "
"; d += '
'; d += '
'; d += "
"; d += "
"; b("body").append(d) } }; this.bindEvent = function () { var c = this; b("#" + this.options.controlId + " a").on("click", function () { c.postFavorite() }) }; this.LoadFavorite = function (d) { var c = this; CheckIfInMyFavourite(this.options.entityId, this.options.entityType, function (e, f) { c.options.isLogin = e; c.options.isInMyFavourite = f; if (f) { b("#" + c.options.controlId + " .mw-collect").addClass("mw-current") } if (typeof d == "function") { d(c) } }) }; this.smrecompute = function () { b("#" + this.options.controlId).smrecompute() }; this.checkFavorite = function (c) { if (c.options.isLogin) { if (c.options.isInMyFavourite) { c.removeFavorite() } else { c.addFavorite() } } else { c.ajaxLogin() } }; this.postFavorite = function () { this.LoadFavorite(this.checkFavorite) }; this.ajaxLogin = function () { var c = this; b.get("/ebusiness/RenderLoginPartial", { trigger: "favourite" }, function (d) { b("body").append(d); window["AjaxLoginCallBack"] = function (e) { if (e.IsSuccess && e.IsLogin) { c.postFavorite() } } }) }; this.addFavorite = function () { var d = this; var c = this.options.entityTypeName + this.options.favouriteSucess; AddToMyFavourite(this.options.entityId, this.options.entityType, function () { b("#" + d.options.controlId + " .mw-collect").addClass("mw-current"); b("#smvSysFavoriteModal .mw-smtips").text(c); b("#smvSysFavoriteModal .mw-modal").removeClass("mw-fade").addClass("mw-fadein"); setTimeout(function () { b("#smvSysFavoriteModal .mw-modal").removeClass("mw-fadein").addClass("mw-fade") }, 1500) }) }; this.removeFavorite = function () { var d = this; var c = this.options.entityTypeName + this.options.removeFavouriteSucess; DeleteFromMyFavourite(this.options.entityId, this.options.entityType, function () { b("#" + d.options.controlId + " .mw-collect").removeClass("mw-current"); b("#smvSysFavoriteModal .mw-smtips").text(c); b("#smvSysFavoriteModal .mw-modal").removeClass("mw-fade").addClass("mw-fadein"); setTimeout(function () { b("#smvSysFavoriteModal .mw-modal").removeClass("mw-fadein").addClass("mw-fade") }, 1500) }) } }; b.fn.smartNPwzFavoriteControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.smartNPwzFavoriteControl") } } } }(jQuery); (function () { function a(b) { this.ele = b; this.queryArr = [] } a.prototype.query = function (c) { var b = this; c == null && (c = ".lz-compare"); b.queryArr = $(b.ele).find(c) }; a.prototype.getSize = function (e) { var h = this, d = [], g = [], c; $(e).css("marginTop", ""); for (var f = 0, b = e.length; f < b; f++) { theHei = $(e[f]).outerHeight(); d.push(theHei) } c = Math.max.apply(null, d); for (var f = 0, b = e.length; f < b; f++) { g.push((c - d[f]) / 2) } return g }; a.prototype.setSize = function (c) { var d = this.getSize(c); $(c).css("marginTop", 0); for (var e = 0, b = c.length; e < b; e++) { d[e] != 0 && ($(c[e]).css("marginTop", d[e])) } }; a.prototype.init = function (c) { var b = this; b.query(c); b.setSize(b.queryArr) }; $.fn.verticalCenter = function (c) { var b = $(this); $.each(b, function (d, e) { var f = new a(e); f.init(c) }) } })(jQuery); function PcListPagination(s, l, p, o, d, m, r, q, k, h, g, c, n, a, b, e, i) { kino.razor.use("$"); if (p.indexOf("Style1_") > -1) { $("#smv_" + s + " #prePage").click(function () { var t = $("#smv_" + s + " #pagerHtml a[class *='activi']"); if (t.html() == "1") { return } var u = $("#smv_" + s + " #pagerHtml li[class !='dom'] a:not(a[class *='w-page-flip'])"); $.each(u, function (v, w) { if (parseInt($(this).html()) == parseInt(t.html()) - 1) { $(this).click() } }) }); $("#smv_" + s + " #nextPage").click(function () { var t = $("#smv_" + s + " #pagerHtml a[class *='activi']"); if (t.html() == d.toString()) { return } var u = $("#smv_" + s + " #pagerHtml li[class !='dom'] a:not(a[class *='w-page-flip'])"); $.each(u, function (v, w) { if (parseInt($(this).html()) == parseInt(t.html()) + 1) { $(this).click() } }) }); $("#smv_" + s + " #pagerHtml li[class !='dom'] a:not(a[class *='w-page-flip'])").click(function () { var t = parseInt($(this).html()); var u = $(this).html(); if (d > 5) { if (t < 4) { $("#smv_" + s + " #firstdom").hide(); $("#smv_" + s + " #lasedom").show(); $("#smv_" + s + " #secondPage").html(2); $("#smv_" + s + " #thirdPage").html(3); $("#smv_" + s + " #forthPage").html(4) } else { if (t > d - 3) { $("#smv_" + s + " #firstdom").show(); $("#smv_" + s + " #lasedom").hide(); $("#smv_" + s + " #secondPage").html(d - 3); $("#smv_" + s + " #thirdPage").html(d - 2); $("#smv_" + s + " #forthPage").html(d - 1) } else { $("#smv_" + s + " #firstdom").show(); $("#smv_" + s + " #lasedom").show(); $("#smv_" + s + " #secondPage").html(t - 1); $("#smv_" + s + " #thirdPage").html(t); $("#smv_" + s + " #forthPage").html(t + 1) } } } $("#smv_" + s + " #pagerHtml").find("a").removeClass("activi"); $.each($("#smv_" + s + " #pagerHtml").find("a"), function (v, w) { if ($(this).html() == u) { $(this).addClass("activi") } }); AssembleData(s, l, p, o, t, d, m, r, q, k, h, g, c, n, a, b, e, i) }) } else { if (p.indexOf("Style2_") > -1) { $("#smv_" + s + " #prePage").click(function () { var t = parseInt($("#smv_" + s + " #firstNum").html()); if (t == 1) { return } else { t = t - 1; $("#smv_" + s + " #firstNum").html(t) } AssembleData(s, l, p, o, t, d, m, r, q, k, h, g, c, n, a, b, e, i) }); $("#smv_" + s + " #nextPage").click(function () { var t = parseInt($("#smv_" + s + " #firstNum").html()); if (t == d) { return } else { t = t + 1; $("#smv_" + s + " #firstNum").html(t) } AssembleData(s, l, p, o, t, d, m, r, q, k, h, g, c, n, a, b, e, i) }); $("#smv_" + s + " #goPage").click(function () { var u = $("#smv_" + s + " #turnPage").val(); var t = parseInt(u); if (!isNaN(t) && t <= d && t >= 1) { $("#smv_" + s + " #firstNum").html(t); AssembleData(s, l, p, o, t, d, m, r, q, k, h, g, c, n, a, b, e, i); $("#smv_" + s + " #turnPage").val("") } else { $("#smv_" + s + " #turnPage").val("") } }) } else { if (p.indexOf("Style3_") > -1) { var f = 1; $("#smv_" + s + " #searchMore").click(function () { f++; if (f == d) { $(this).parent().hide() } AssembleData(s, l, p, o, f, d, m, r, q, k, h, g, c, n, a, b, e, i) }) } } } } function AssembleData(htmlId, listType, pagerStyle, pageSize, pageIndex, totalPage, categoryIds, entityIds, dateStyle, orderByField, orderByType, isCategoryList, postData, searchKeyWord, showImage, showPrice, callBack, templateId) { var param = { dataType: listType, key: searchKeyWord, pageIndex: pageIndex - 1, pageSize: pageSize, selectCategory: categoryIds, selectId: entityIds, dateFormater: dateStyle, orderByField: orderByField, orderByType: orderByType, setTop: true, templateId: templateId, postData: JSON.stringify(postData) }; $.post("/Designer/Common/GetData", param, function (data) { if (pagerStyle.indexOf("Style1_") > -1 || pagerStyle.indexOf("Style2_") > -1) { $("#ulList_" + htmlId + " li").remove(); $.each(data.Data, function (i, o) { $("#ulList_" + htmlId).append(kino.razor($("#listTemplate_" + htmlId).html(), { data: o })) }) } else { if (pagerStyle.indexOf("Style3_") > -1) { var preAddHetght = $("#smv_" + htmlId + " .yibuFrameContent").height(); $.each(data.Data, function (i, o) { $("#ulList_" + htmlId).append(kino.razor($("#listTemplate_" + htmlId).html(), { data: o })) }) } } if (isExitsFunction(callBack)) { var func = eval(callBack); func() } }, "json") } function isExitsFunction(funcName) { try { if (typeof (eval(funcName)) == "function") { return true } } catch (e) { } return false } function recordPageAccess(c, a, b, d) { $.ajax({ url: "/PageVisit/Index", data: { pageId: c, siteId: a, entityId: b, pageType: d }, dataType: "jsonp", jsonp: "callback", type: "get", success: function () { } }) } function GetStateProvince(a, c, b) { $.ajax({ cache: false, url: "/Customer/GetStateProvinces", type: "get", dataType: "json", success: function (d) { if (d != null) { $.each(d, function (e, f) { if (b == "mobile") { if (f["Id"] == a) { c.append('
  • ' + f["Name"] + "
  • ") } else { c.append('
  • ' + f["Name"] + "
  • ") } } else { if (f["Id"] == a) { c.append('
  • ' + f["Name"] + "
  • ") } else { c.append('
  • ' + f["Name"] + "
  • ") } } }) } }, error: function () { } }) } function GetCity(a, d, c, b) { $.ajax({ cache: false, url: "/Customer/GetCitysByStateProvince", data: { "stateProvinceId": a }, type: "get", dataType: "json", success: function (e) { if (e != null) { $.each(e, function (f, g) { if (b == "mobile") { if (g["Id"] == d) { c.append('
  • ' + g["Name"] + "
  • ") } else { c.append('
  • ' + g["Name"] + "
  • ") } } else { if (g["Id"] == d) { c.append('
  • ' + g["Name"] + "
  • ") } else { c.append('
  • ' + g["Name"] + "
  • ") } } }) } }, error: function () { } }) } function GetArea(d, c, b, a) { $.ajax({ cache: false, url: "/Customer/GetAreasByCityId", data: { "cityId": d }, type: "get", dataType: "json", success: function (e) { if (e != null) { $.each(e, function (f, g) { if (a == "mobile") { if (g["Id"] == d) { b.append('
  • ' + g["Name"] + "
  • ") } else { b.append('
  • ' + g["Name"] + "
  • ") } } else { if (g["Id"] == d) { b.append('
  • ' + g["Name"] + "
  • ") } else { b.append('
  • ' + g["Name"] + "
  • ") } } }) } }, error: function () { } }) } function SetNavContainerSelectedStyle(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find(".nav-item").each(function () { var c = $(this).find("span").attr("data-url"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("active"); return } } if ($(this).children("ul").length > 0) { $(this).children("ul").find("li").each(function () { c = $(this).attr("data-url"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("active"); return } } }) } }) } function SetNavSelectedStyle(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find(".w-nav-inner").each(function () { var c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).find(".w-nav-item").addClass("current"); return } } if ($(this).children("ul").length > 0) { $(this).children("ul").find("li").each(function () { c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("current"); return } } }) } }) } function SetNavSelectedStyleForStyle12(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find("li.w-nav-item").each(function () { var c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("current"); return } } if ($(this).children("ul").length > 0) { $(this).children("ul").find("li").each(function () { c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("current"); return } } }) } }) } function SetNavSelectedStyleForInner(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find("li.w-nav-inner").each(function () { var c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("current"); return } } if ($(this).children("ul").length > 0) { $(this).children("ul").find("li").each(function () { c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).addClass("current"); return } } }) } }) } function SetNavSelectedStyleForMobile(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find("li").each(function () { var c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).find(".mw-nav-item-link").addClass("current"); return } } }) } function InitImageSmv(o, d, e, f) { var l = $("#div_" + o); var n = $("#smv_" + o); var g = $("#img_smv_" + o); var c = l.find(".w-image-box"); var b = parseInt(l.css("border-left-width")); var m = d - b; var i = parseInt(n.css("height")) - 2 * b; if (f == "1") { if (g[0].complete) { ImagecutFill(m, i, o, e) } else { g.load(function () { ImagecutFill(m, i, o, e) }) } } else { if (f == "2") { l.css({ "width": m + 2 * b + "px", "height": i + 2 * b + "px" }); g.css("width", m + "px").css("height", i + "px"); g.parent().css("width", "100%").css("height", "100%") } else { var n = $("#smv_" + o); var h = $("#div_" + o); var k = {}; k = $("#div_" + o + " img").FixFill(parseInt(n.css("width")), i, ""); $("#div_" + o + " img").css({ "height": k.height, "width": k.width }); h.css({ "height": k.height, "width": k.width }); var a = parseInt(k.height); n.css({ "height": a, "width": k.width }) } } } function ImagecutFill(f, d, i, a) { var e = $("#div_" + i); var b = $("#img_smv_" + i); var g; var c; var h; g = b[0].naturalWidth; c = b[0].naturalHeight; halfIntWidth = f / 2; halfIntHeight = d / 2; h = g / c; e.css({ "height": a + "px" }); if (h >= 1.5) { if (f > d * h) { $(b).css("width", f + "px").css("height", "auto").css("marginTop", (halfIntHeight - (halfIntWidth * parseInt(c) / parseInt(g))) + "px").css("marginLeft", "0px") } else { $(b).css("width", "auto").css("height", d + "px").css("marginLeft", (halfIntWidth - (halfIntHeight * parseInt(g) / parseInt(c))) + "px").css("marginTop", "0px") } } else { if (d > f / h) { $(b).css("width", "auto").css("height", d + "px").css("marginLeft", (halfIntWidth - (halfIntHeight * parseInt(g) / parseInt(c))) + "px").css("marginTop", "0px") } else { $(b).css("width", f + "px").css("height", "auto").css("marginTop", (halfIntHeight - (halfIntWidth * parseInt(c) / parseInt(g))) + "px").css("marginLeft", "0px") } } } function SetNavSelectedStyleForMobileOpen(b) { var a = decodeURI(window.location.pathname) + window.location.search; $("#" + b).find("li").each(function () { var c = $(this).find("a").attr("href"); if (c != null) { c = c.replace(" ", "%20"); if (c.toLowerCase() == a.toLowerCase()) { $(this).find(".mw-nav-item-link").addClass("current"); return } } }) } function VisitFromMobile() { var c = navigator.userAgent; var b = c.match(/(iPad).*OS\s([\d_]+)/), e = !b && c.match(/(iPhone\sOS)\s([\d_]+)/), d = c.match(/(Android)\s+([\d.]+)/), a = e || d; return a } function SetCategoryStyleForPc(b) { var c = window.xwezhan.getQueryString("categoryId"); if (c) { var a = c.split(","); var d = a[0]; $("#" + b).find("li").each(function () { var e = $(this).attr("data-id"); if (e == d) { $(this).addClass("on"); return } }) } } function pagination(y, n, q, d, v, g) { var x = y; var w = 5; var p = 0, r = 0; var c = $("#" + x); var m = c.height(); if (c.html() != null) { var u = c.find("div").html().split("_ueditor_page_break_tag_"); var e = u.length; if (e != 1) { var t = $("
    ", { "class": "pagination" }); c.append(t); if (e > w) { t.append("" + ((n == null || n == undefined) ? "首页" : n) + ""); t.append("" + ((d == null || d == undefined) ? "上一页" : d) + "") } for (var s = 0; s < e; s++) { t.append("" + (s + 1) + "") } var h = c.find(".page"); h.first().addClass("hover"); c.find(".page:gt(" + (w - 1) + ")").hide(); h.click(function () { m = c.height(); var A = parseInt($(this).attr("id")); if (e < w) { h.removeClass("hover"); c.find("div:eq(0)").html(u[A]); $(this).addClass("hover") } else { if (e >= w && A > Math.floor(w / 2)) { h.removeClass("hover"); c.find("div:eq(0)").html(u[A]); $(this).addClass("hover"); w % 2 === 0 ? (p = A - w / 2 + 1, r = A + w / 2) : (p = A - Math.floor(w / 2), r = A + Math.floor(w / 2)); if (p > e - w) { c.find(".page:gt(" + (e - w) + ")").show(); c.find(".page:lt(" + (e - w) + ")").hide() } else { c.find(".page:lt(" + p + ")").hide(); c.find(".page:gt(" + r + ")").hide(); h.slice(p, r + 1).show() } } else { if (e >= w && A <= Math.floor(w / 2)) { h.removeClass("hover"); c.find("div:eq(0)").html(u[A]); $(this).addClass("hover"); c.find(".page:gt(" + (w - 1) + ")").hide(); c.find(".page:lt(" + w + ")").show() } } } if (e > w) { var i = parseInt(c.find(".hover").attr("id")) + 1; $("#current_page_" + x).text(i + "/" + e) } if (typeof (g) == "function") { setTimeout(function () { g(m) }, 500) } }); if (e > w) { var b = parseInt(c.find(".hover").attr("id")) + 1; t.append("" + b + "/" + e + ""); t.append("" + ((v == null || v == undefined) ? "下一页" : v) + ""); t.append("" + ((q == null || q == undefined) ? "尾页" : q) + "") } var l = $("#pre_page_" + x); var f = $("#post_page_" + x); var a = $("#first_page_" + x); var o = $("#last_page_" + x); var z = $("#to_page_" + x); var k = $("#go_page_" + x); l.click(function () { var i = $(this).parent().find(".hover"); if (i.attr("id") !== "0") { h.removeClass("hover"); i.prev().addClass("hover"); i.prev().click() } }); f.click(function () { var i = $(this).parent().find(".hover").next(); if (i.attr("id") < $(this).parent().children("a").length) { h.removeClass("hover"); i.addClass("hover"); i.click() } }); a.click(function () { h.removeClass("hover"); h.first().addClass("hover"); var i = h.first(); i.click() }); o.click(function () { h.removeClass("hover"); h.last().addClass("hover"); var i = h.last(); i.click() }); k.click(function () { var i = z.val(); var C = /^[0-9]*[1-9][0-9]*$/; var A = C.test(i); if (parseInt(i) > e || !A) { alert("无第【" + i + "】页,请重新键入"); return } h.removeClass("hover"); c.find(".page:eq(" + (i - 1) + ")").addClass("hover"); var B = $(this).parent().find(".hover"); B.click() }) } c.find("div:eq(0)").html(u[0]); if (typeof (g) == "function") { setTimeout(g, 500) } } } function setCurrentPageTitle(a, e) { if (a == undefined || a == "") { return } var g = window.location.pathname.toLowerCase(); var d = window.location.search.toLowerCase(); if (g.indexOf("/") === 0) { g = g.substring(1, g.length) } var f = RegExp(/^\w*[a-zA-Z]+\w*$/); if (f.test(g)) { var c = ""; var b = g + "_" + e; sessionStorage.setItem(b, a) } } function CheckIfInMyFavourite(a, b, c) { $.post("/customer/MyFavouriteCheckIfIn", { id: a, type: b }, function (d) { if (typeof c == "function") { c(d.IsLogin, d.IsInMyFavourite) } }, "json") } function DeleteFromMyFavourite(a, b, c) { $.post("/customer/MyFavouriteDeleteByEntityId", { id: a, type: b }, function (d) { if (typeof c == "function") { c() } if (typeof cartControlGetProductCount == "function") { cartControlGetProductCount() } }, "json") } function AddToMyFavourite(c, b, d, a) { $.post("/customer/MyFavouriteAdd", { ids: c, type: b, trigger: a }, function (e) { if (typeof d == "function") { d(e.NewsCount, e.ProductCount, e.alreadyInFavourite) } if (typeof cartControlGetProductCount == "function") { cartControlGetProductCount() } }, "json") } function GetPcStyleTemp(c, b) { var a = ""; switch (c.toLowerCase().substring(0, 6)) { case "style1": a = "w-page-square"; switch (b) { case "0": a = "w-page-square"; break; case "1": a = "w-page-square-orange"; break; case "2": a = "w-page-square-blue"; break; case "3": a = "w-page-square-red"; break; case "4": a = "w-page-round"; break; case "5": a = "w-page-alpha"; break }return { baseClass: "w-pageline w-page-num", firsthtml: "", prevhtml: "
  • {{prev}}<
  • ", nexthtml: "
  • {{next}}>
  • ", lasthtml: "", pagehtml: "
  • {{page}}
  • ", wrapperhtml: "" }; case "style2": a = "w-page-rectangle-white"; switch (b) { case "0": a = "w-page-rectangle-white"; break; case "1": a = "w-page-rectangle"; break; case "2": a = "w-page-rectangle-round"; break; case "3": a = "w-page-rectangle-red"; break; case "4": a = "w-page-rectangle-alpha"; break }return { baseClass: "w-pageline w-page-go", firsthtml: "", prevhtml: "
  • {{prev}}<
  • ", nexthtml: "
  • {{next}}>
  • ", lasthtml: "", pagehtml: "
  • {{page}}/{{totalPages}}
  • ", afterhtml: "
  • {{goto}}
  • {{go}}
  • ", wrapperhtml: "", vpage: 1 }; case "style3": a = "w-page-more-one"; switch (b) { case "0": a = "w-page-more-one"; break; case "1": a = "w-page-more-two"; break; case "2": a = "w-page-more-three"; break; case "3": a = "w-page-more-fives"; break; case "4": a = "w-page-more-six"; break }return { baseClass: "w-pageline w-page-more-box", firsthtml: "", prevhtml: "", nexthtml: "{{more}}", lasthtml: "", pagehtml: "" }; default: return { baseClass: "w-pageline", firsthtml: "", prevhtml: "", nexthtml: "", lasthtml: "", pagehtml: "" } } } function GetMobileStyleTemp(c, b) { var a = ""; switch (c.toLowerCase().substring(0, 6)) { case "style1": a = "mw-previous-one"; switch (b) { case "0": a = "mw-previous-one"; break; case "1": a = "mw-previous-two"; break; case "2": a = "mw-previous-three"; break; case "3": a = "mw-previous-four"; break; case "4": a = "mw-previous-fives"; break; case "5": a = "mw-previous-six"; break }return { baseClass: "mw-page mw-pagenum mw-clearfix", firsthtml: "", prevhtml: "
  • {{prev}}<
  • ", nexthtml: "
  • {{next}}>
  • ", lasthtml: "", pagehtml: "", afterhtml: "
  • {{page}}/{{totalPages}}
  • ", wrapperhtml: "", vpage: 1 }; case "style2": a = "mw-page-more-one"; switch (b) { case "0": a = "mw-page-more-one"; break; case "1": a = "mw-page-more-two"; break; case "2": a = "mw-page-more-three"; break; case "3": a = "mw-page-more-fives"; break; case "4": a = "mw-page-more-six"; break }return { baseClass: "mw-page mw-page-more-box", firsthtml: "", prevhtml: "", nexthtml: "{{more}}", lasthtml: "", pagehtml: "", afterhtml: "", wrapperhtml: "" }; default: return { baseClass: "mw-pageline", firsthtml: "", prevhtml: "", nexthtml: "", lasthtml: "", pagehtml: "" } } } function xnPager(a) { xnPagerCommon(a, "/Designer/Common/GetData") } function spXnPager(a) { xnPagerCommon(a, "/SpDesigner/Common/GetData") } function xnPagerCommon(pagerId, url) { var pager = $("#" + pagerId); var filter = function (pager) { var ctype = pager.parent().parent().attr("ctype"); if (ctype == "listproductcategory" || ctype == "listproductsearch") { if (typeof (xFilter) == "function") { var result = xFilter(); return JSON.stringify(result); if (typeof (result) == "string") { return result } } } return pager.attr("jp-postdata") }; var queryData = function (pager, pageIndex, forcerefresh) { var style = pager.attr("jp-style").toLowerCase().substring(0, 6); var device = pager.attr("jp-device"); var callback = pager.attr("jp-callback"); var htmlId = pager.attr("jp-htmlid"); var localLoad = pager.attr("jp-localload"); var query = { dataType: pager.attr("jp-listtype"), key: pager.attr("jp-skey"), pageIndex: pageIndex - 1, pageSize: pager.attr("jp-pagesize"), selectCategory: pager.attr("jp-cid"), selectId: pager.attr("jp-eid"), dateFormater: pager.attr("jp-datestyle"), orderByField: pager.attr("jp-orderbyfield"), orderByType: pager.attr("jp-orderbytype"), templateId: pager.attr("jp-templateid"), postData: filter(pager), es: pager.attr("jp-es") == "true", setTop: true }; var bulidHtml = function (data, totalCount) { kino.razor.use("$"); switch (device + "_" + style) { case "pc_style1": case "pc_style2": case "mobile_style1": $("#ulList_" + htmlId + " li").remove(); var htmlappend = ""; $.each(data, function (i, o) { htmlappend += kino.razor($("#listTemplate_" + htmlId).html(), { data: o }) }); $("#ulList_" + htmlId).append(htmlappend); if (forcerefresh) { pager.jqPaginator("option", { currentPage: 1, }) } pager.jqPaginator("option", { totalCounts: totalCount }); function scrollToPosition(top, times) { if (top < 0) { top = 0 } if (times-- <= 0) { return } console.log(times); var cstop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (cstop == top) { return } var newtop = Math.floor((cstop + scrollTop) / 2 + Math.random()); window.scrollTo(window.scrollX, newtop); if (cstop != top) { setTimeout(function () { scrollToPosition(top, times) }, 10) } } if ((document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop) > $("#ulList_" + htmlId).offset().top) { var scrollTop = $("#ulList_" + htmlId).offset().top - 60; scrollToPosition(scrollTop, 20) } break; case "pc_style3": case "mobile_style2": $("#smv_" + htmlId).smpreparerecompute(); var preAddHetght = $("#smv_" + htmlId + " .yibuFrameContent").height(); var htmlappend = ""; $.each(data, function (i, o) { htmlappend += kino.razor($("#listTemplate_" + htmlId).html(), { data: o }) }); if (forcerefresh) { $("#ulList_" + htmlId + " li").remove(); pager.jqPaginator("option", { currentPage: 1, }) } $("#ulList_" + htmlId).append(htmlappend); pager.jqPaginator("option", { totalCounts: totalCount }); $("#smv_" + htmlId).smautorecompute(); break }if (isExitsFunction(callback)) { var func = eval(callback); func() } $("#smv_" + htmlId).find(".pager-text span").html(totalCount) }; if (localLoad != undefined && localLoad == "1") { var localdata = $(pager).data("localdata"); if (localdata != undefined) { var data = []; var start = query.pageIndex * parseInt(query.pageSize); var end = (query.pageIndex + 1) * parseInt(query.pageSize); end = Math.min(localdata.length, end); for (var i = start; i < end; i++) { data.push(localdata[i]) } bulidHtml(data, localdata.length) } } else { $.post(url, query, function (data) { bulidHtml(data.Data, data.TotalCount) }, "json") } }; var buildItem = function (html, pagedata) { if (html) { return html.replace(/{{first}}/g, pager.attr("jp-first")).replace(/{{prev}}/g, pager.attr("jp-prev")).replace(/{{next}}/g, pager.attr("jp-next")).replace(/{{last}}/g, pager.attr("jp-last")).replace(/{{goto}}/g, pager.attr("jp-goto")).replace(/{{go}}/g, pager.attr("jp-go")).replace(/{{more}}/g, pager.attr("jp-more")) } return "" }; var style = pager.attr("jp-style"); var color = pager.attr("jp-color"); var align = pager.attr("jp-align"); if (align != "center") { pager.css("float", align) } var device = pager.attr("jp-device"); var styleTemp; if (device == "mobile") { styleTemp = GetMobileStyleTemp(style, color, align) } else { styleTemp = GetPcStyleTemp(style, color, align) } pager.addClass(styleTemp.baseClass); var options = {}; options.wrapper = styleTemp.wrapperhtml; options.first = buildItem(styleTemp.firsthtml); options.prev = buildItem(styleTemp.prevhtml); options.next = buildItem(styleTemp.nexthtml); options.last = buildItem(styleTemp.lasthtml); options.before = buildItem(styleTemp.beforehtml); options.after = buildItem(styleTemp.afterhtml); options.page = buildItem(styleTemp.pagehtml); options.totalCounts = parseInt(pager.attr("jp-totalcounts")); options.pageSize = parseInt(pager.attr("jp-pagesize")); options.currentPage = parseInt(pager.attr("jp-currentpage")); if (styleTemp.vpage) { pager.attr("jp-vpage", styleTemp.vpage) } options.visiblePages = parseInt(pager.attr("jp-vpage")); options.onPageChange = function (n, type) { if (pager.attr("jp-enable") == "false") { return } if (type == "change") { queryData(pager, n) } }; pager.jqPaginator(options); pager.data("Q", queryData) } function xFilterRefresh(a) { var b = $(".esmartMargin[ctype=listproductcategory],.esmartMargin[ctype=listproductsearch]").find(".xn-pager"); if (b.attr("jp-enable") == "false") { return } var c = b.data("Q"); console.log("QQ"); if (typeof c === "function") { c(b, a || 1, true) } } function xFilter() { return [] } function ResetHeight() { } (function (a) { a.fn.getxnresizeheight = function () { var b = 0; a(this).find(">.yibuFrameContent>.xn-resize").each(function () { b += a(this).outerHeight(true) }); return b }; a.fn.smpreparerecompute = function () { if (!a(this).data("xn-heightbefore")) { var b = a(this).getxnresizeheight(); a(this).data("xn-heightbefore", b) } }; a.fn.smautorecompute = function () { var b = a(this).getxnresizeheight(); var c = a(this).data("xn-heightbefore"); if (b == c) { return } a(this).smrecompute("recomputeTo", [b, c]); a(this).data("xn-heightbefore", b) } })(jQuery); function refreshStaticData() { var g = function (m, p) { var l = p.split(","); var k = l.length; for (var n = 0; n < k; n++) { if (l[n] == m) { return p } } l.push(m); var o = l.join(","); if (o.indexOf(",") == 0) { o = o.substring(1) } return o }; var d = $(".AR"); if (d.length == 0) { return } var b = ""; var h = []; var c = {}; d.each(function () { var i = $(this).attr("data-dt"); var k = $(this).attr("data-v"); if (!c[i]) { c[i] = [] } if (c[i].indexOf(k) < 0) { c[i].push(k) } }); var a = {}; var e = 0; for (var f in c) { a["postDatas[" + e + "].DataType"] = f; a["postDatas[" + e + "].DataKey"] = c[f].join() } $.ajax({ url: "/Common/GetIdHitDic", data: a, dataType: "json", type: "POST", success: function (i) { d.each(function () { var k = $(this); var n = $(this).attr("data-dt"); var o = $(this).attr("data-v"); for (var m = 0; m < i.length; m++) { var l = i[m].DataType; if (n == l) { var p = i[m].ListIdHits; for (j = 0; j < p.length; j++) { if (o == p[j].Id) { k.html(p[j].Hit) } } } } }) } }) } function JPlaceHolder(a) { var b = { _check: function () { return "placeholder" in document.createElement("input") }, init: function (c) { if (!this._check()) { this.fix(c) } }, fix: function (c) { jQuery(".w-placeholder > :input[placeholder]").each(function (f, h) { var e = $(this), d = e.attr("placeholder"); e.wrap($('
    ').css({})); var g = $('
    ').text(d).css({}).appendTo(e.parent()); e.val() && g.hide(); e.focusin(function (i) { g.hide() }).focusout(function (i) { if (!e.val()) { g.show() } }); g.click(function (i) { g.hide(); e.focus() }); if (typeof c === "function") { c() } }) } }; b.init(a) } window.xwezhan = (function (b, a) { return { initWz: function (c) { refreshStaticData(); this.removeEmptyLink(); this.linkToAnimate(); this.appendDialogToBody() }, removeEmptyLink: function () { $("a[href='']").removeAttr("href") }, changeRunTimeDeviceMode: function (c) { $.ajax({ cache: false, url: "/Common/ChangeRunTimeDeviceMode", type: "post", data: "type=" + c, dataType: "json", success: function (d) { if (d.IsSuccess) { var g = (top == undefined) ? window : top; var e = g.location.href; e = unescape(e); c = c.toLowerCase(); var f = c == "pc" ? "mobile" : "pc"; if (e.indexOf("deviceModel=" + f) > -1) { e.replace("deviceModel=" + f, "deviceModel=" + c) } g.location.href = e } }, error: function () { } }) }, linkToAnimate: function () { $("a[href*=#]").click(function () { if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) { if (this.hash && this.hash.indexOf("/") == -1) { var c = $(this.hash); c = c.length && c || $("[name=" + this.hash.slice(1) + "]"); if (c.length) { var d = c.offset().top; $("html,body").animate({ scrollTop: d }, 1000); return false } } } }) }, cssRule: function (n, c, l) { var e = navigator.userAgent.toLowerCase(); var m = /(msie\s|trident.*rv:)([\w.]+)/.test(e); var o = 0; if (m) { var k = e.match(/(?:msie\s([\w.]+))/); var i = e.match(/(?:trident.*rv:([\w.]+))/); if (k && i && k[1] && i[1]) { o = Math.max(k[1] * 1, i[1] * 1) } else { if (k && k[1]) { o = k[1] * 1 } else { if (i && i[1]) { o = i[1] * 1 } else { o = 0 } } } } if (m && o != 11) { var f, g; if (c === undefined || c && c.nodeType && c.nodeType == 9) { l = c && c.nodeType && c.nodeType == 9 ? c : (l || document); f = l.indexList || (l.indexList = {}); g = f[n]; if (g !== undefined) { return l.styleSheets[g].cssText } return undefined } l = l || document; f = l.indexList || (l.indexList = {}); g = f[n]; if (c === "") { if (g !== undefined) { l.styleSheets[g].cssText = ""; delete f[n]; return true } return false } if (g !== undefined) { sheetStyle = l.styleSheets[g] } else { sheetStyle = l.createStyleSheet("", g = l.styleSheets.length); f[n] = g } sheetStyle.cssText = c } else { var h, d; if (c === undefined || c && c.nodeType && c.nodeType == 9) { l = c && c.nodeType && c.nodeType == 9 ? c : (l || document); d = l.getElementById(n); return d ? d.innerHTML : undefined } l = l || document; d = l.getElementById(n); if (c === "") { if (d) { d.parentNode.removeChild(d); return true } return false } if (d) { d.innerHTML = c } else { d = l.createElement("style"); d.id = n; d.innerHTML = c; l.getElementsByTagName("head")[0].appendChild(d) } } }, cssUeditorTale: function (c) { xwezhan.cssRule("table", ".w-detail .selectTdClass{background-color:#edf5fa !important}" + ".w-detail table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}" + ".w-detail table{margin-bottom:10px;border-collapse:collapse;display:table;}" + ".w-detail td,th{padding: 5px 10px;border: 1px solid #DDD;}" + ".w-detail caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + ".w-detail th{border-top:1px solid #BBB;background-color:#F7F7F7;}" + ".w-detail table tr.firstRow th{border-top-width:2px;}" + ".w-detail .ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }" + ".w-detail td p{margin:0;padding:0;}"); if (typeof c == "function") { c() } }, getQueryString: function (c) { var d = new RegExp("(^|&)" + c + "=([^&]*)(&|$)", "i"); var e = window.location.search.substr(1).match(d); if (e != null) { return unescape(e[2]) } return null }, appendDialogToBody: function () { $("div[ctype='dialog']").each(function () { $(this).find(".w-modal-mask").appendTo($("#systemDialogLayer")) }) }, disabledMobileDesignerScoll: function () { }, enabledMobileDesignerScoll: function () { } } })(window, document); +function (b) { var a; a = function () { this.options = { controlId: "", caption: "", hideByClickMask: true, delayed: 1000, isDefault: false }; this.init = function (f) { b.extend(this.options, f || {}); var e = b("#" + this.options.controlId); var d = b("#" + this.options.controlId + "_dialog_modal_mask"); this.bindEvent(); if (this.options.direction == "None") { var g = e.width(); var c = e.height(); e.css("left", "50%"); e.css("top", "50%"); e.css("margin-top", "-" + (c / 2) + "px"); e.css("margin-left", "-" + (g / 2) + "px") } if (this.options.isDefault) { d.show(); if (e.hasClass("animated")) { setTimeout(function () { e.smanimate("replay"); e.find(".animated").each(function () { b(this).smanimate("replay") }) }, 500); e.addClass("dialogshowed"); e.show() } else { e.fadeIn(this.options.delayed, function () { e.addClass("dialogshowed"); e.find(".animated").each(function () { b(this).smanimate("replay") }) }) } e.find("div[ctype='music']").each(function () { if (b(this).find(".lz-audio").hasClass("autoFlag")) { b(this).find(".lz-audio").click() } }) } return this }; this.bindEvent = function () { var c = this; b("#" + this.options.controlId + " .w-modal").on("click", ".w-modal-close", function () { c.close() }); b("#" + this.options.controlId + "_dialog_modal_mask").on("click", function () { if (c.options.hideByClickMask) { c.close() } }); var d = b("#" + c.options.controlId).attr("cstyle"); if (d == "Style3") { b(window).on("resize", function () { var f = b(window).height(); var e = b("#" + c.options.controlId).height(); if (e < f) { b("#" + c.options.controlId).css({ height: f }) } b("#" + c.options.controlId).find(".w-modal-content").css({ height: f }) }) } }; this.close = function () { var d = this; var e = b("#" + d.options.controlId); var c = b("#" + d.options.controlId + "_dialog_modal_mask"); c.hide(); e.addClass("f-hide").removeClass("dialogshowed"); e.fadeOut(d.options.delayed, function () { e.find("div[ctype='music']").each(function () { var g = b(this).attr("id"); var f = b.getAudio("#" + g + " .music_1 .lz-audio"); if (!f.el.paused) { b(this).attr("isAutoPause", "1"); f.el.pause() } else { b(this).attr("isAutoPause", "0") } }); e.find("div[ctype='video']").each(function () { var f = b(this).find("iframe"); if (f) { var g = f.attr("src"); f.attr("src", g) } }) }); d.options.isAutoPause = true }; this.show = function () { var d = this; var e = b("#" + d.options.controlId); var c = b("#" + d.options.controlId + "_dialog_modal_mask"); e.removeClass("f-hide").addClass("dialogshowed"); c.show(); if (e.hasClass("animated")) { e.smanimate("replay"); e.show(); e.find(".animated").each(function () { b(this).smanimate("replay") }) } else { e.fadeIn(d.options.delayed, function () { e.find(".animated").each(function () { b(this).smanimate("replay") }) }) } e.find("div[ctype='music']").each(function () { if (b(this).attr("isAutoPause") == "1") { var g = b(this).attr("id"); var f = b.getAudio("#" + g + " .music_1 .lz-audio"); f.el.play() } }) } }; b.fn.smartNPwzDialogControl = function (c) { if (a[c]) { return a[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof c === "object" || !c) { return new a().init(c) } else { b.error("Method " + method + " does not exist on jQuery.smartNPwzDialogControl") } } }; window.showWZDialog = function (c) { if (window["dialog_" + c] != undefined && typeof window["dialog_" + c].show == "function") { window["dialog_" + c].show() } else { alert("该弹出窗口没有找到") } } }(jQuery); function showSlidingCode(b, d) { if (sessionStorage == undefined) { $("#" + d).parent().parent().hide() } var h = b + "-" + d; var g = sessionStorage.getItem(h); if (g != null && g != "") { var e = JSON.parse(g); var a = new Date().getTime(); var f = []; for (var c = 0; c < e.length; c++) { var k = new Date(e[c]).getTime(); if ((a - k) < (5 * 1000 * 60)) { f.push(e[c]) } } sessionStorage.setItem(h, JSON.stringify(f)); if (f.length >= 3) { $("#" + d).parent().parent().show(); $("#" + d).lzhdyz("refresh"); return false } } $("#" + d).parent().parent().hide(); return true } function hideSlidingCode(b, a) { if (sessionStorage == undefined) { $("#" + a).parent().parent().hide() } $("#" + a).parent().parent().hide() } function setSlidingCodeTime(b, a) { if (sessionStorage == undefined) { return false } var e = b + "-" + a; var f = sessionStorage.getItem(e); var d = []; if (f != null && f != "") { d = JSON.parse(f) } var c = new Date(); d.push(c); sessionStorage.setItem(e, JSON.stringify(d)); $("#" + a).parent().parent().hide() };