window.xlog = function (a) { var b = window.console || { log: function () { return } }; if (b.log) { b.log(a) } }; "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.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 m = window.location.origin; var k = document.referrer; if (k != undefined && k != "" && k.indexof(m) > -1) { var f = k.substring(m.length, k.length).tolowercase(); if (f.indexof("/") === 0) { f = f.substring(1, f.length) } if (f.indexof("?") > -1) { f = f.substring(0, f.indexof("?")) } var d = regexp(/^\w*[a-za-z]+\w*$/); var h = b("#" + this.options.controlid + " .w-crumbs").height(); var i = b("#" + this.options.controlid + " .w-crumbs-item:first").text(); if (d.test(f)) { var n = f + "_" + this.options.languageid; var l = sessionstorage.getitem(n); if (l != null && l != i) { var e = ""; var g = b("#" + this.options.controlid + " .w-crumbs i:first"); if (g.length > 0) { e += ' ' + b(g).html() + "" } e += ' ' + l + ""; b("#" + this.options.controlid + " .w-crumbs a:first").after(e); this.smrecompute(h) } } } }; 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", "/common/generateleavewordcaptcha?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 + c.emailplaceholder); 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": "", "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 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() };