function Client() { this.typeInit = function(a) { var c, d, b = a.section, e = OW.typeid.split("-"); for (c = 0; c < e.length; c++) d = OW.int(e[c]), b.find("[name='ctype'][type_id='" + d + "']").addClass("current") }, this.uploadInput = "", this.uploadDialog = "", this.upload = function(a) { OW.client.uploadInput = $("input[name='" + a.inputName + "']"), OW.client.uploadDialog = OWDialog({ follow: b }).posting("正在上传,请稍后 ... ").position(); var b = document.getElementById(a.iframeId), c = $(b.contentWindow.document.getElementById("upload_form")); c.submit() }, this.uploadCallback = function(a, b) { a ? (OW.client.uploadDialog.success("上传完毕").position().timeout(2), OW.client.uploadInput.val(b)) : OW.client.uploadDialog.error("上传失败", b).position().timeout(3) }, this.uploadNotOpen = function(a) { $("button[name='" + a + "']").hide() }, this.serviceOnline = function(a) { var b = "1" == a.open ? !0 : !1, c = a.data || "", d = "service-online", e = function() { var b, e, f, g, i, j, k, l, m, n, o, q, r, s, t, h = ""; try { b = $.parseJSON(c) } catch(p) { b = $.parseJSON("[]") } for (e = 0; e < b.length; e++) i = unescape(b[e].name || ""), j = unescape(b[e].tel || ""), k = unescape(b[e].qq || ""), l = unescape(b[e].crmqq || ""), m = unescape(b[e].wangwang || ""), n = unescape(b[e].skype || ""), o = unescape(b[e].text || ""), "" != j && (j = '
' + j + "
"), "" != k && (k = '
'), "" != l && (l = '
'), "" != m && (m = '
点击这里给我发消息
'), "" != n && (n = '
My status
'), "" != o && (o = '
' + o + "
"), g = "
" + i + "
" + j + k + l + m + n + o + "
", h = "" == g ? g: h + "" + g; f = '
' + '
' + '
' + h + "
" + "
", $("body").append(f), q = $("div." + d).find(".mini"), r = $("div." + d).find(".listpanel"), s = $("div." + d).find("a.close"), "mini" == a.initType ? (q.show(), r.hide()) : (q.hide(), r.show()), q.click(function() { q.hide(), r.show("fast") }), s.click(function() { q.show("fast"), r.hide("fast") }), t = parseInt($("div." + d).css("top")), $(window).scroll(function() { $("div." + d).css("top", parseInt(document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop) + t) }) }; b && "" != c && e() } } function ADClass() { this.count = function() {}, this.parse = function(a) { var b, c, e, d = "", f = "", g = "", h = $("#ow_ad_" + a), i = {}, j = {}, k = {}, l = {}, m = {}, n = h.attr("data"), o = h.attr("type"), p = h.attr("ad_height"), q = h.attr("ad_width"), r = OW.int(h.attr("full_screen")), s = OW.int(h.attr("switch_time")), w = -OW.int(q) / 2, x = "", y = "", z = ""; if (1 > s && (s = 6), "" != n) switch (o) { case "image": if (e = OW.JSON.parse(n), 1 == e.length) x = OW.trim(e[0].link), y = 'target="_blank"', (OW.isNull(x) || "#" == x) && (z = "cursor-default", x = "javascript:;", y = ""), h.html('
').show(), j = h.find(".ow-ad-pic").css({ height: p, width: q }), k = h.find("a").css({ height: p, width: q }), l = h.find("img").css({ height: p, width: q }), r && (h.css({ width: "100%" }), j.css({ overflow: "hidden", position: "absolute", width: "100%" }), k.css({ left: "50%", "margin-left": w, position: "absolute", width: q })); else if (e.length > 1) { for (b = '
', c = 0; c < e.length; c++) OW.isNull(e[c].link) || "#" == e[c].link ? (z = "cursor-default", x = "javascript:;", y = "") : (z = "", x = OW.trim(e[c].link), y = 'target="_blank"'), d = d + '
  • ", f = f + '' + (c + 1) + ""; b = b + '", b = b + '
    ' + f + "
    ", b += '
    ', b += "
    ", h.html(b).show(), i = h.find(".ow-pic-player").css({ height: p, width: q }), $sliders = h.find("ul[name='sliders']").css({ height: p, width: q }), l = h.find("img").css({ height: p, width: q }), m = h.find("div[name='pages']"), r && (h.css({ width: "100%" }), i.css({ width: "100%" }), $sliders.css({ left: "50%", "margin-left": w }), m.css({ left: "50%", "margin-left": -OW.int(m.width()) / 2 })), OW.ad.picPlayer({ obj: h, timer: 1e3 * s }) } break; case "flash": e = OW.JSON.parse(n), g = e.url, b = '', h.html(b).show(), h.find("embed").css({ height: p, width: h.css("width") }) } }, this.picPlayer = function(a) { var b, l, m, n, o, c = a.obj, d = a.timer, e = c.find("ul[name='sliders']"), f = c.find("div[name='pages']"), g = c.find("div[name='turner']").hide(), h = g.find("a.prev"), i = g.find("a.next"), j = f.find("a"), k = j.length; e.find("li").hide(), e.find("li:first").show(), f.find("a:first").addClass("current"), h.click(function() { o(); var a, b = parseInt(f.find("a.current").attr("i")); a = 0 == b ? k - 1 : b - 1, m(b, a) }), i.click(function() { o(); var a, b = parseInt(f.find("a.current").attr("i")); a = b == k - 1 ? 0 : b + 1, m(b, a), n() }), j.click(function() { var a, b; o(), a = parseInt(f.find("a.current").attr("i")), b = parseInt($(this).attr("i")), a != b && m(a, b), n() }), l = function() { var a, b = parseInt(f.find("a.current").attr("i")); a = b == k - 1 ? 0 : b + 1, m(b, a) }, m = function(a, b) { e.find("li:eq(" + a + ")").hide(), e.find("li:eq(" + b + ")").fadeIn("fast"), f.find("a:eq(" + a + ")").removeClass("current"), f.find("a:eq(" + b + ")").addClass("current") }, n = function() { d && (b = window.clearInterval(b), b = window.setInterval(function() { l() }, d)) }, o = function() { d && (b = window.clearInterval(b)) }, c.hover(function() { o(), g.show() }, function() { n(), g.hide() }).mouseout() } } function CMTClass() { var a = this; this.pagesize = 50, this.page = 1, this.countSection = {}, this.listSection = {}, this.pagerSection = {}, this.getCallBack = function() {}, this.init = function(b) { var f, c = b.cid, d = b.gid, e = OW.cookie.getCookie("avatar"); e = OW.iif(OW.isNull(e), OW.siteUrl + "ow-content/images/avatar.jpg", e), f = '
    发布
    ', a.postSection.html(f) }, this.get = function(b) { var c = b.cid, d = b.gid, e = b.page, f = a.countSection, g = a.listSection, h = a.pagerSection; a.page = e, g.html('
    成交记录加载中...
    '), OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.main.asp?ctl=owcmt&act=get&cid=" + c + "&gid=" + d + "&page=" + e + "&pagesize=" + a.pagesize, data: "", success: function() { var b = OW.int(OW.ajaxData.count), c = '
    ' + unescape(OW.ajaxData.list) + "
    ", d = '
    ' + unescape(OW.ajaxData.pager) + "
    "; f.html(b), g.hide().html(c).show(200), h.html(d), a.getCallBack() }, failed: function(a) { g.html("亲,很抱歉,评论数据加载失败,请刷新页面再试试!
    " + a) } }) }, this.post = function(b) { var h, c = b.cid, d = b.gid, e = b.cmtid, f = $("#ow_oscmt_comment_" + c + "_" + d + "_" + e), g = f.val(); OW.isNull(g) ? f.focus() : (h = OWDialog().posting().position(), OW.ajax({ url: OW.siteUrl + "ow-includes/ow.ajax.main.asp?ctl=owcmt&act=post&save=true", data: "cid=" + c + "&gid=" + d + "&cmtid=" + e + "&comment=" + escape(g), success: function() { h.success("已发布").position().timeout(2), OW.delay(1e3, function() { f.val(""), OW.cmt.get({ cid: c, gid: d, page: a.page }) }) }, failed: function(a) { h.error("亲,评论失败,请查看以下原因", a).position().timeout(4) } })) }, this.toReply = function(a) { var b = a.cid, c = a.gid, d = a.cmtid, e = $("#ow_owcmt_reply_post_" + d), f = '
    发布
    '; e.find("input").length > 0 ? e.slideUp().html("") : e.html(f).slideDown() } } function linkClass() { this.count = function(a) { var b = OW.sitePath + "ow-includes/ow.ajax.main.asp?ctl=link&act=count"; OW.ajax({ url: b, data: "link_id=" + a, success: function() { $dialog.close() }, failed: function(a) { $dialog.error("亲,提交失败,请查看以下错误信息", a).timeout(5) } }) } } function galleryClass() { var a, b, c, d, e, f; this.init = function(g) { var h, i, m, n, o, p, r, s, t; a = g.data || "{}", b = g.gallery, c = g.view || $(document.createElement("div")).addClass("gallery-view").attr("create", "true"), d = g.list || $(document.createElement("div")).addClass("gallery-list").attr("create", "true"), r = "", s = "", t = !1; try { a = OW.rep(a, """, '"'), i = OW.JSON.parse(a), i.length > 0 && (t = !0) } catch(u) {} if (t) { for (h = 0; h < i.length; h++) m = i[h].url, r = r + '
  • ' + i[h].name + ''; s = '', d.append(""), d.append(s), c.append('' + i[0].name + ''), "true" == d.attr("create") && (b.html(""), b.append(c), b.append(d)), e = b.find(".prev"), f = b.find(".next"), n = parseInt(b.find(".gallery-list").css("width")), o = parseInt(b.find("li").css("width")) + parseInt(b.find("li").css("margin-right")), p = parseInt(n / o), p < i.length && b.find(".gallery-list").hover(function() { "0" != e.attr("valid") && e.show(), "0" != f.attr("valid") && f.show() }, function() { e.hide(), f.hide() }), e.click(function() { var a = parseInt(b.find("li[hide='1']").length), c = parseInt(b.find("li[hide!='1']").length); a > 0 && (a -= 1), b.find("li:eq(" + a + ")").attr("hide", 0).show(100), b.find("li:eq(" + (a - 1) + ")").attr("hide", 0).show(100), c + 2 > p && f.attr("valid", 1).show(100), 2 > a ? e.attr("valid", 0).hide(100) : e.attr("valid", 1).show(100) }), f.click(function() { var a = parseInt(b.find("li[hide='1']").length), c = parseInt(b.find("li[hide!='1']").length); c > p && (b.find("li:eq(" + a + ")").attr("hide", 1).hide(100), b.find("li:eq(" + (a + 1) + ")").attr("hide", 1).hide(100)), 2 >= c - p && (f.attr("valid", 0).hide(100), e.attr("valid", 1).show(100)), a > 0 && e.attr("valid", 1).show(100) }) } }, this.click = function() { b.find(".gallery-list").find("a").click(function() { b.find(".cloud-zoom").find("img").attr("src", $(this).attr("bigimg")), $(this).parents("ul").children("li").removeClass("current"), $(this).parent("li").addClass("current") }) }, this.cloudZoom = function(a) { $(a).CloudZoom() } } function memberClass() { var a = this; this.forgetPassword = function(a) { var b = a.tab, c = a.by, d = a.form, e = a.btn, f = d.find("input[name='mobile']"), g = d.find("input[name='mobile_code']"), h = d.find("button[name='get_mobile_code']"), i = d.find("input[name='email']"), j = d.find("span[name='forget_verifycode']"), k = d.find("input[name='verifycode_value']"), l = d.attr("vcode_open"); OW.verifyCode({ boxer: j }), OW.verifyCodeValueBlur(k), OW.verifyCodeValueFocus(k, j), b.find("a").click(function() { c = $(this).attr("by"), $(this).parent().addClass("current"), b.find("a[by!='" + c + "']").parent().removeClass("current"), "mobile" == c ? (d.find("[by='mobile']").show(), d.find("[by='email']").hide()) : (d.find("[by='mobile']").hide(), d.find("[by='email']").show()) }), OW.getMobileCode({ mb: f, mc: g, getmc: h, url: OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=get_forget_mobile_code", vcodeOpen: l, vc: j, vv: k, isHide: !1 }), OW.enterClick(function() { e.click() }), e.click(function() { var q, a = !0, b = j.find("input[name='verifycode_name']"), e = OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=forget", h = OW.trim(f.val()), m = OW.trim(g.val()), n = OW.trim(i.val()), o = OW.parseVerifyCode(k.val()), p = OW.trim(b.val()); f.val(h), k.val(o), "mobile" == c ? (OW.isNull(h) && (a = !1, f.focus()), OW.isNull(m) && a && (a = !1, g.focus())) : (OW.isNull(n) && (a = !1, i.focus()), 1 == l && OW.isNull(o) && a && (a = !1, k.focus())), a && (q = OWDialog().posting().position(), OW.ajax({ url: e, data: "by=" + c + "&mobile=" + OW.encrypt.encode(h) + "&mobile_code=" + OW.encrypt.encode(m) + "&account=" + OW.encrypt.encode(n) + "&verifycode_name=" + p + "&verifycode_value=" + o, success: function() { var a, b, e; q.close(), "email" == c ? (a = unescape(OW.trim(OW.ajaxData.html)), d.html('
    ' + a + "
    ")) : (b = OW.int(OW.ajaxData.uid), e = OW.trim(OW.ajaxData.hash), OW.openPage(OW.siteUrl + "?ctl=forget_password&act=reset&hash=" + e + "&uid=" + b)) }, failed: function(a) { OW.verifyCode({ boxer: j }), k.val("").focus(), q.error("亲,提交失败,请查看以下错误信息", a).position().timeout(3) } })) }) }, this.forgetPasswordReset = function(a) { var b = a.form, c = a.btn, d = b.attr("uid"), e = b.attr("hash"), f = b.find("input[name='password']"), g = b.find("input[name='repassword']"), h = b.find("span[name='forget_verifycode']"), i = b.find("input[name='verifycode_value']"), j = b.attr("vcode_open"); OW.verifyCodeValueBlur(i), OW.verifyCodeValueFocus(i, h), OW.enterClick(function() { c.click() }), c.click(function() { var a = !0, b = !0, c = OWDialog().posting().position(); $vcodeName = h.find("input[name='verifycode_name']"), url = OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=forget_reset", pw = OW.trim(f.val()), rp = OW.trim(g.val()), vv = OW.parseVerifyCode(i.val()), vn = OW.trim($vcodeName.val()), f.val(pw), g.val(rp), i.val(vv), OW.isNull(pw) && (a = !1, f.focus()), OW.isNull(rp) && a && (a = !1, g.focus()), 1 == j && OW.isNull(vv) && a && (a = !1, i.focus()), pw != rp && a && (a = !1, b = !1, c.alert("两次输入的密码不一致,请重新输入!").position().timeout(2), g.addClass("text-err").val("").focus()), a ? OW.ajax({ url: url, data: "uid=" + OW.encrypt.encode(d) + "&hash=" + escape(e) + "&password=" + OW.encrypt.encode(pw) + "&verifycode_name=" + vn + "&verifycode_value=" + vv, success: function() { c.success("亲,您已成功设置新密码!").position().timeout(2), OW.redirect(OW.siteUrl, 2) }, failed: function(a) { OW.verifyCode({ boxer: h }), i.val("").focus(), c.error("亲,提交失败,请查看以下错误信息", a).position().timeout(3) } }) : b && c.close() }) }, this.getMyPoint = function() { var a = 0; return OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=get_my_point", async: !1, success: function() { a = OW.ajaxData.my_point } }), a }, this.isLogined = function() { return OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=is_logined", data: "", async: !1, success: function() { "true" == OW.ajaxData.logined && (OW.logined = !0) } }), OW.logined }, this.loginInit = function(a) { var b = !0, c = a.username, d = a.password, e = a.vcodeValue, f = a.verifycode, g = OW.cookie.getCookie("last_login_user") || ""; "" != g && c.val(g), "" == OW.trim(c.val()) && (b = !1, c.focus()), "" == OW.trim(d.val()) && b && (b = !1, d.focus()), "" == OW.trim(e.val()) && b && (b = !1, e.focus(), OW.verifyCode({ boxer: f })), OW.verifyCodeValueBlur(e), OW.verifyCodeValueFocus(e, f) }, this.loginSuccessCallBack = {}, this.login = function(b) { var d = OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=login", e = !0, f = {}, g = b.btnLogin, h = b.username, i = b.password, j = b.verifycode, k = b.vcodeValue, l = j.find("input[name='verifycode_name']"), m = b.remember, n = b.success ? b.success: "", o = b.vcode_open, p = OW.trim(h.val()), q = OW.trim(i.val()), r = OW.parseVerifyCode(k.val()), s = OW.trim(l.val()); k.val(r); try { f = OWDialog({ id: "d_logining" }).posting("登录中...") } catch(t) { return ! 1 } e && OW.setDisabled(g, !0), "" == p && e ? (e = !1, h.addClass("text-err").focus()) : h.removeClass("text-err"), "" == q && e ? (e = !1, i.addClass("text-err").focus()) : i.removeClass("text-err"), 1 == o && ("" == r && e ? (e = !1, k.addClass("text-err").focus()) : k.removeClass("text-err")), e ? OW.ajax({ url: d, data: "username=" + OW.encrypt.encode(p) + "&password=" + OW.encrypt.encode(q) + "&verifycode_name=" + s + "&verifycode_value=" + r, success: function() { var b = OW.cookie.getCookie("login_return_url"); if (b = OW.iif(OW.isNull(b), OW.sitePath + "ow-ucenter/", b), OW.logined = !0, 1 == m.attr("checked") && OW.cookie.setCookie("last_login_user", p), OW.isNull(n)) f.success("登陆成功,正在跳转...").position(), OW.openPage(b); else { f.close(), a.userStatus({}); try { a.loginWin.close() } catch(c) {} try { n.call() } catch(c) {} } }, failed: function(a) { OW.verifyCode({ boxer: j }), OW.setDisabled(g, !1), k.val("").focus(), f.error("亲,登陆失败,请查看以下错误信息", a).position().timeout(3) } }) : (f.close(), OW.setDisabled(g, !1)) }, this.loginWin, this.loginWindow = function() { return OW.shoppingIsNeedLogin ? OW.openPage(OW.loginUrl) : OW.cookie.setCookie("unlogin_buy", "1"), !1 }, this.loginWindowLogining = function(a) { OW.member.login({ username: $("#login_win_form").find("input[name='username']"), password: $("#login_win_form").find("input[name='password']"), verifycode: $("#login_win_form").find("span[name='verifycode']"), vcodeValue: $("#login_win_form").find("input[name='verifycode_value']"), remember: $("#login_win_form").find("input[name='remember']"), btnLogin: $("#login_win_form").find("button[name='btn_login']"), success: a.success }) }, this.regInit = function(a) { var b = a.form, c = b.find("input[name='mobile']"), d = b.find("input[name='mobile_code']"), e = b.find("button[name='get_mobile_code']"), f = b.find("span[name='reg_verifycode']"), g = b.find("input[name='verifycode_value']"), h = b.find("input[name='username']"), i = b.attr("vcode_open"); OW.objExist(h) && h.blur(function() { $(this).val(OW.parseUsername($(this).val())) }), OW.objExist(c) && OW.getMobileCode({ mb: c, mc: d, getmc: e, url: OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=get_reg_mobile_code", vcodeOpen: i, vc: f, vv: g, isHide: !0 }) }, this.reg = function(a) { var c = OW.sitePath + "ow-includes/ow.ajax.member.asp?ctl=member&act=reg", d = !0, e = !0, f = OWDialog().posting("提交注册中..."), g = a.form, h = g.find("input[name='mobile']"), i = g.find("input[name='mobile_code']"), j = g.find("input[name='username']"), k = g.find("input[name='email']"), l = g.find("input[name='password']"), m = g.find("input[name='repassword']"), n = g.find("input[name='recommend_user']"), o = a.btnReg, p = a.verifycode, q = a.vcodeValue, r = p.find("input[name='verifycode_name']"), s = a.vcode_open, t = "", u = "", v = OW.trim(j.val()), w = OW.trim(k.val()), x = OW.trim(l.val()), y = OW.trim(m.val()), z = OW.trim(q.val()), A = OW.trim(r.val()), B = OW.iif(OW.objExist(n), OW.trim(n.val()), ""); d && OW.setDisabled(o, !0), OW.objExist(h) && (t = OW.parseMobile(OW.trim(h.val())), u = OW.trim(i.val()), !OW.isValidMobile(t) && d ? (d = !1, h.addClass("text-err").focus()) : h.removeClass("text-err"), "" == u && d ? (d = !1, i.addClass("text-err").focus()) : i.removeClass("text-err")), OW.objExist(j) && ("" == v && d ? (d = !1, j.addClass("text-err").focus()) : j.removeClass("text-err")), OW.objExist(k) && ("" == w && d ? (d = !1, k.addClass("text-err").focus()) : k.removeClass("text-err")), "" == x && d ? (d = !1, l.addClass("text-err").focus()) : l.removeClass("text-err"), OW.objExist(h) || ("" == y && d ? (d = !1, m.addClass("text-err").focus()) : m.removeClass("text-err"), x != y && d && (d = !1, e = !1, f.error("两次输入的密码不一致,请重新输入!").position().timeout(2), l.addClass("text-err").val("").focus(), m.addClass("text-err").val("")), 1 == s && ("" == z && d ? (d = !1, q.addClass("text-err").focus()) : q.removeClass("text-err"))), d ? OW.ajax({ url: c, data: "mobile=" + OW.encrypt.encode(t) + "&mobile_code=" + OW.encrypt.encode(u) + "&username=" + OW.encrypt.encode(v) + "&password=" + OW.encrypt.encode(x) + "&email=" + OW.encrypt.encode(w) + "&verifycode_name=" + A + "&verifycode_value=" + z + "&recommend_user=" + OW.encrypt.encode(B), success: function() { OW.cookie.setCookie("last_login_user", v), f.success("亲,恭喜您注册成功!").position().timeout(3), window.location.href = OW.sitePath + "ow-ucenter/regboot.asp?ctl=regsuccess" }, failed: function(a) { OW.verifyCode({ boxer: p }), OW.setDisabled(o, !1), q.val("").focus(), f.error("亲,注册失败,请查看以下错误信息", a).position().timeout(3) } }) : (e && f.close(), OW.setDisabled(o, !1)) }, this.userStatusSection = "", this.userStatus = function(b) { var c = b.userStatusSection ? b.userStatusSection: a.userStatusSection; a.userStatusSection = c, OW.uid = OW.int(OW.cookie.getCookie("uid")), OW.username = OW.trim(OW.cookie.getCookie("username")), OW.nickname = OW.trim(OW.cookie.getCookie("nickname")), OW.uid > 0 && "" != OW.username && (OW.htmlCacheOpen && OW.member.isLogined(), 1 == OW.logined && c.html('' + OW.iif(OW.isNull(OW.nickname), OW.username, OW.nickname) + '退出')) }, this.wxLogin = function() { OW.openPage(OW.siteUrl + "ow-includes/module/login/weixin/") }, this.qqLogin = function(a) { var b = a.appid || "", c = OW.urlEncode(OW.siteUrl + "ow-includes/module/login/qq/index.asp"); OW.openPage("https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=" + b + "&redirect_uri=" + c + "&scope=get_user_info") } } function searchClass() { this.run = function(a) { var b = $("input[name='keywords']"), c = OW.trim(b.val()), d = OW.siteUrl + "?ctl=search&is_shop={$is_shop}&keyword={$keyword}&page={$page}"; b.val(c), "" == c ? b.focus() : (d = d.replace("{$is_shop}", a).replace("{$keyword}", c).replace("{$page}", 1), OW.redirect(d, 0)) } } function shopClass() { var a = this; this.dialog = {}, this.pid = 0, this.productSn = "", this.productStock = 0, this.productsData = "", this.goodsMyPrice = 0, this.MGPricesHtml = "", this.specCount = 0, this.cartAmountSection = {}, this.priceSection = {}, this.marketPriceSection = {}, this.myPriceSection = {}, this.pointSet = 0, this.pointPayAmount = 0, this.isBook = 0, this.bookFrontMoneyRate = 0, this.bookPriceDiscount = 0, this.bookPriceSection = {}, this.bookTimeSection = {}, this.bookMoneySection = {}, this.amountInput = {}, this.specSection = {}, this.stockTipSection = {}, this.cartGoods = {}, this.cartPriceSum = {}, this.addToCart = function(b, c, d, e) { var f, g, h, i, j = OW.shop.addToCart.arguments, k = !1, l = OW.cookie.getCookie("cart"); if (b = OW.int(b), c = OW.int(c), d = OW.int(d), e = OW.int(e), b > 0 && (e = 1), OW.isNull(l)) h = "[]", OW.cookie.setCookie("cart", h, 10368e5), a.addToCart(b, c, d, e); else { for (i = { suit_id: "" + b, gid: "" + c, pid: "" + d, m: "" + e }, g = OW.JSON.parse(l), f = 0; f < g.length; f++) if (g[f].suit_id == b && g[f].gid == c && g[f].pid == d) { g[f].m = OW.toString(OW.int(g[f].m) + e), h = OW.JSON.toString(g), k = !0; break } k ? OWDialog({ id: "dialog_add_to_cart" }).success("商品已在购物车中!").timeout(2) : (g.push(i), h = OW.JSON.toString(g), OW.cookie.setCookie("cart", h, 10368e5), OWDialog({ id: "dialog_add_to_cart" }).success("商品已成功加入购物车!").timeout(2).shadow(!1), j.length > 4 && j[4].call()) } }, this.addToFavorite = function(a) { if (a = OW.int(a), !OW.logined) return OW.member.loginWindow({ success: function() { OW.shop.addToFavorite(a) } }), !1; var b = OWDialog().posting(); OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=add_to_favorite", data: "gid=" + a, success: function() { b.success("成功添加至收藏夹!").timeout(2) }, failed: function(a) { b.error("亲,很抱歉,添加至收藏夹失败,请查看以下原因!", a).timeout(4) } }) }, this.author = function() { var a = ">l>i>n>x>i>a>o>d>o>n>g>"; return OW.rep(a, ">", "") }, this.cartInit = function(b) { var c, d, e = b.cartAmountSection || a.cartAmountSection, f = OW.cookie.getCookie("cart"); a.cartAmountSection = e, OW.isNull(f) ? c = 0 : (d = OW.JSON.parse(f), c = OW.int(d.length)), e.html(c) }, this.cartPageInit = function(b) { var c, d, e, f, g = b.cart, h = b.btn.addClass("disabled").attr("disabled", !0), i = OWDialog().loading().position(); OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_cart_goods", success: function() { return i.close(), f = OW.ajaxData.cart_json, e = OW.ajaxData.cart_html, OW.isNull(f) ? (OW.cookie.remove("cart"), !1) : (g.html(unescape(e)), d = OW.JSON.toString(f), c = g.find("input[name='check_all']"), a.cartGoods = g.find("div[name='cart_goods_list']"), a.cartPriceSum = b.cartPriceSum, a.cartPriceCount(), OW.cookie.setCookie("cart", d, 10368e5), c.click(function() { var b = a.cartGoods.find("ul[name='item']"); $checkbox = a.cartGoods.find("input[name='items[]']"), 1 == $(this).attr("checked") ? (b.addClass("current"), $checkbox.attr("checked", !0)) : (b.removeClass("current"), $checkbox.attr("checked", !1)), a.cartPriceCount() }), a.cartGoods.find("input[name='items[]']").click(function() { var b = $(this).parent().parent().parent().parent(); 1 == $(this).attr("checked") ? b.addClass("current") : b.removeClass("current"), a.cartPriceCount() }), a.cartGoods.find("input[name='amount_input']").blur(function() { var b = OW.int($(this).val()), c = OW.int($(this).attr("suit_id")); 1 > b && (b = 1), $(this).val(b), a.cartPriceCount(), a.gartGoodsAmountChange($(this).attr("gid"), $(this).attr("pid"), b), c > 0 && a.cartGoods.find("[name='suit_amount'][suit_id='" + c + "']").html(b) }), a.cartGoods.find("a[name='amount_decrease']").click(function() { var b = $(this).parent().find("input[name='amount_input']"), c = OW.int(b.attr("suit_id")), d = OW.int(b.val()) - 1; 1 > d && (d = 1), b.val(d), a.cartPriceCount(), a.gartGoodsAmountChange(b.attr("gid"), b.attr("pid"), d), c > 0 && a.cartGoods.find("[name='suit_amount'][suit_id='" + c + "']").html(d) }), a.cartGoods.find("a[name='amount_increase']").click(function() { var b = $(this).parent().find("input[name='amount_input']"), c = OW.int(b.attr("suit_id")), d = OW.int(b.val()) + 1; b.val(d), a.cartPriceCount(), a.gartGoodsAmountChange(b.attr("gid"), b.attr("pid"), d), c > 0 && a.cartGoods.find("[name='suit_amount'][suit_id='" + c + "']").html(d) }), OW.int(a.cartGoods.find("input[name='items[]']").length) > 0 && h.removeClass("disabled").attr("disabled", !1), void 0) }, failed: function(a) { i.error("亲,很抱歉,加载购物车数据失败,请刷新页面再试试!", a).timeout(4) } }), h.click(function() { var b, c, d, e, f; return OW.logined || 1 == OW.int(OW.cookie.getCookie("unlogin_buy")) ? OW.int(a.cartGoods.find("input[name='items[]']:checked").length) < 1 ? (OWDialog().alert("请至少选中一件商品!"), !1) : (a.cartGoods.find("input[name='items[]']:checked").each(function() { suitId = OW.int($(this).attr("suit_id")), b = OW.int($(this).attr("gid")), c = OW.int($(this).attr("pid")), d = OW.int($(this).parent().parent().parent().find("input[name='amount_input']").val()), f = '{"suit_id":"' + suitId + '","gid":"' + b + '","pid":"' + c + '","m":"' + d + '"}', e = OW.isNull(e) ? f: e + "," + f }), e = "[" + e + "]", a.cartOrderSubmit({ data: e }), void 0) : (OW.member.loginWindow({ success: function() { OW.refresh() } }), !1) }) }, this.cartPriceCount = function() { var b, c, d, e = 0, f = a.cartGoods.find("input[name='items[]']:checked").parent().parent().parent().find("input[name='amount_input']"); f.each(function() { b = OW.int($(this).val()), c = OW.parseFloat($(this).attr("price")), d = OW.parseFloat(c * b), e += d, $(this).parent().parent().parent().parent().find("[name='item_sum']").html(OW.parsePrice(d)) }), a.cartPriceSum.html(OW.parsePrice(e)) }, this.cartOrderSubmit = function(a) { var b, c, d = a.data, e = OW.int(a.is_book), f = OW.int(a.order_type), g = '
    '; OW.objExist($("form[name='order_data_form']")) || $("body").append(g), b = $("form[name='order_data_form']"), c = b.find("input[name='order_goods_data']").val(d), b.attr("action", OW.siteUrl + "?ctl=order&act=init").submit() }, this.invoiceEditWin, this.invoiceData, this.invoiceEdit = function(b) { var d, c = b.isInvoiceVatOpen || 0; OW.appendToString = "", OW.append('
    '), OW.append('
    • 普通发票
    • 增值税专用发票
    "), OW.append('
    '), OW.append('
    *单位名称(发票抬头)
    *发票内容
    • 明细
    • 自填
    '), OW.append('
    *纳税人识别码
    *注册地址
    *注册电话
    *开户银行
    *银行账户
    '), OW.append(''), OW.append("
    "), d = OW.appendToString, a.invoiceEditWin = OWDialog({ id: "d_login_window", title: "发票信息", content: d, padding: "0px", initialize: function() { var e, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, b = $("#order_invoice"), c = $("#invoice_edit_html"), d = b.find("input[name='invoice']"), f = d.val(); OW.isNull(f) && (f = '{"invoice_type":"1"}'), e = OW.JSON.parse(f), g = e.invoice_type || 1, h = e.invoice_title || "", i = e.invoice_content_type || 1, j = e.invoice_content || "", k = e.invoice_code || "", l = e.invoice_address || "", m = e.invoice_phone || "", n = e.invoice_bank_name || "", o = e.invoice_bank_account || "", p = $("input[name='invoice_title']").val(unescape(h)), q = $("input[name='invoice_content']").val(unescape(j)), r = $("span[name='t_invoice_content']"), s = $("input[name='invoice_code']").val(unescape(k)), t = $("input[name='invoice_address']").val(unescape(l)), u = $("input[name='invoice_phone']").val(unescape(m)), v = $("input[name='invoice_bank_name']").val(unescape(n)), w = $("input[name='invoice_bank_account']").val(unescape(o)), x = c.find("button[name='btn_submit']"), c.find("li[name='invoice_type'][value='" + g + "']").addClass("current"), 2 == g && c.find("div[name='invoice_type'][value='2']").show(), c.find("li[name='invoice_content_type'][value='" + i + "']").addClass("current"), 2 == i && c.find("dd[name='invoice_conent_type']").show(), c.find("li[name='invoice_type']").click(function() { var b = $(this).attr("value"); $(this).addClass("current"), $(this).siblings("li[name='invoice_type'][value!='" + b + "']").removeClass("current"), 2 == b ? c.find("div[name='invoice_type'][value='2']").show() : c.find("div[name='invoice_type'][value='2']").hide(), a.invoiceEditWin.position() }), c.find("li[name='invoice_content_type']").click(function() { var b = $(this).attr("value"); $(this).addClass("current"), $(this).siblings("li[name='invoice_content_type'][value!='" + b + "']").removeClass("current"), 2 == b ? c.find("dd[name='invoice_conent_type']").show() : c.find("dd[name='invoice_conent_type']").hide(), a.invoiceEditWin.position() }), x.click(function() { var h, i, j, e = c, f = c.find("li[name='invoice_type'][class='current']"), g = c.find("li[name='invoice_content_type'][class='current']"); "1" == f.attr("value") && (e = c.find("div[name='invoice_type'][value='1']")), h = OWValidForm({ form: e }), h.verify(), h.result && 2 == c.find("li[name='invoice_content_type'][class='current']").attr("value") && ("" == OW.trim(q.val()) ? (q.focus(), r.addClass("t-err").html("请填写发票内容"), h.result = !1) : r.removeClass("t-err").html("")), h.result && (i = '{"invoice_type":"' + escape(f.attr("value")) + '","invoice_title":"' + escape(p.val()) + '","invoice_content_type":"' + escape(g.attr("value")) + '","invoice_content":"' + escape(q.val()) + '","invoice_code":"' + escape(s.val()) + '","invoice_address":"' + escape(t.val()) + '","invoice_phone":"' + escape(u.val()) + '","invoice_bank_name":"' + escape(v.val()) + '","invoice_bank_account":"' + escape(w.val()) + '"}', j = OWDialog().posting().position(), OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=invoice&act=edit", data: "invoice_data=" + i, success: function() { d.val(i), a.invoiceEditWin.close(), b.find("[name='invoice_type']").html(f.find("span").html()), b.find("[name='invoice_title']").html(p.val()), 2 == g.attr("value") ? b.find("[name='invoice_content']").html(q.val()) : b.find("[name='invoice_content']").html("明细"), j.success("修改成功").position().timeout(2) }, failed: function(c) { d.val(i), a.invoiceEditWin.close(), b.find("[name='invoice_type']").html(f.find("span").html()), b.find("[name='invoice_title']").html(p.val()), 2 == g.attr("value") ? b.find("[name='invoice_content']").html(q.val()) : b.find("[name='invoice_content']").html("明细"), OW.logined ? j.error("亲,很抱歉,修改失败,请查看以下信息!", c).position().timeout(4) : j.close() } })) }) } }).position() }, this.taxrate = 0, this.costItem = 0, this.costInvoice = 0, this.costCoupon = 0, this.costFreight = 0, this.freeFreightAmount = 0, this.totalAmount = 0, this.totalAmountSection = {}, this.needInvoiceInput = {}, this.costFreightSection = {}, this.costInvoiceSection = {}, this.totalAmountCount = function() { a.costItem < a.costCoupon && (a.costCoupon = a.costItem), a.totalAmount = OW.parseMoney(a.costItem) - OW.parseMoney(a.costCoupon) + OW.parseMoney(a.costInvoice) + OW.parseMoney(a.costFreight), a.totalAmount < 0 && (a.totalAmount = 0), a.totalAmountSection.html(OW.parsePrice(a.totalAmount)) }, this.costInvoiceCount = function() { a.costItem < a.costCoupon && (a.costCoupon = a.costItem), 1 == a.needInvoiceInput.attr("checked") && (a.costInvoice = OW.parseMoney((OW.parseMoney(a.costItem) - OW.parseMoney(a.costCoupon) + OW.parseMoney(a.costFreight)) * a.taxrate / 100), a.costInvoiceSection.attr("money", a.costInvoice).html(OW.parsePrice(a.costInvoice))) }, this.orderDlyTrigger = function() { var b = $("#order_dly"), c = b.find("input[name='order_dly']"); c.length > 0 ? (1 == a.isOffline ? b.hide() : b.show(), c.click(function() { a.costFreight = OW.parseMoney($(this).attr("dly_fee")), a.costFreightSection.html(OW.parsePrice(a.costFreight)), a.costInvoiceCount(), a.totalAmountCount() })) : (b.hide(), $(".order-dly-header").hide()) }, this.isOffline = !1, this.orderOfflineTrigger = function() { var b = $("#order_offline_select"); b.click(function() { var b = OWDialog({ id: "d_offline_select", title: "选择自提点", content: '
    loading ...
    ', padding: "0px", initialize: function() {}, ok: function() { var b = $("#ow_offline").find("input:checked"), c = $("input[name='order_offline_store']"), d = $("#order_offline_info"); return $("#order_dly"), OW.objExist(b) ? (c.val(OW.int(b.val())), d.html(b.attr("store_name") + "(" + b.attr("store_address") + ")" + '取消'), a.isOffline = !0, $("#order_dly").hide(), a.costFreight = 0, a.costFreightSection.html(OW.parsePrice(a.costFreight)), a.costInvoiceCount(), a.totalAmountCount(), $("#offline_cancel").click(function() { c.val(0), d.html(""), a.isOffline = !1, $("#order_dly").show(), $("#order_dly").find("input[name='order_dly']:eq(0)").click() }), void 0) : (alert("请选择自提点"), !1) }, okValue: "确定选择", cancel: !0, cancelValue: "关闭" }); OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=order&act=get_offline_html", data: "", async: !1, success: function() { $("#ow_offline").html(unescape(OW.ajaxData.html)), b.position(), $("#ow_offline").find("input").click(function() { 1 == $(this).attr("checked") && ($(this).parent().parent().addClass("current"), $(this).parent().parent().siblings().removeClass("current")) }) } }) }) }, this.formDataTrigger = function() { $(".ow-order-formdata-list").find("ul").hide(), $("a[name='select_formdata']").click(function() { var a = $(this), b = $(this).next("ul"); OW.shop.dialog = new OWDialog({ id: "d_data_select", title: "选择收货地址", content: '
    loading ...
    ', padding: "0px", initialize: function() { $("#ow_formdata_diawin").html(b.show()) }, beforeClose: function() { a.parent().append(b.hide()) }, cancel: !0, cancelValue: "关闭" }), OW.shop.dialog.position() }) }, this.orderInit = function(b) { var c = b.order, d = b.btn, e = b.costItem, f = b.costCoupon, g = b.costFreight, h = b.costInvoiceGrid, i = "", j = $("#order_coupon").find("input[name='coupon']"), k = c.find("form"), l = $("div[name='order_dly_section']"), m = $("div[name='order_invoice_section']"), o = (OW.iif(c.find("select[is_region='1']").length > 0, !0, !1), $("#order_region_select_grid").attr("region_data")); a.needInvoiceInput = $("input[name='need_invoice']"), a.taxrate = a.needInvoiceInput.attr("taxrate"), a.costItem = OW.parseMoney(e.attr("money")), a.costFreight = OW.parseMoney(g.attr("money")), a.costFreightSection = b.costFreight, a.costInvoiceSection = b.costInvoice, a.totalAmountSection = b.totalAmount, a.orderSubmitFun = b.orderSubmitFun || "", c.find("input[name='order_formdata_select']").click(function() { var b = ($(this).val(), $(this).attr("form_id")), c = $(this).attr("region_data"), d = $(this).parent(), e = $("form[form_id='" + b + "']"); d.find("span").each(function() { var a = $(this).attr("field"), b = $(this).html(); e.find("[name='" + a + "']").val(b) }), $("#order_region_select_grid").html(""), OW.createRegionSelect($("#order_region_select_grid"), "order_region", c), OW.shop.dialog.close() }), $("#order_goods_info").find("input[name='item[goods]']").length < 1 && d.addClass("disabled").attr("disabled", !0), OW.regionSelectFinished = function(b) { var c = "goods_data=" + OW.parseVal($("input[name='order_goods_data']").val()) + "&path=" + b, d = OWDialog().loading(); OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=order&act=get_order_dly", data: c, success: function() { d.close(), l.html(unescape(OW.ajaxData.dly_html)), a.freeFreightAmount = OW.parseMoney(OW.ajaxData.shopping_free_freight_amount), a.freeFreightAmount > 0 && a.costItem >= a.freeFreightAmount ? (a.costFreight = 0, $("#order_dly").find("input[name='order_dly']").attr("dly_fee", "0"), $("#order_dly").find("em[name='freight']").html("")) : 0 == a.isOffline && (a.costFreight = OW.parseMoney(OW.ajaxData.dly_fee)), g.html(OW.parsePrice(a.costFreight)), a.orderDlyTrigger(), a.costInvoiceCount(), a.totalAmountCount() }, failed: function(a) { d.error("亲,很抱歉,获取运费失败,请重新试试!", a).position().timeout(4) } }) }, OW.objExist($("#order_region_select_grid")) && OW.createRegionSelect($("#order_region_select_grid"), "order_region", o), a.formDataTrigger(), a.orderDlyTrigger(), a.orderOfflineTrigger(), a.needInvoiceInput.attr("checked", !1), a.needInvoiceInput.click(function() { costCoupon = parseFloat(f.attr("money")), 1 == $(this).attr("checked") ? (a.costInvoiceCount(), m.show(), h.show(50)) : (a.costInvoice = 0, m.hide(), h.hide(50), a.costInvoiceSection.attr("money", 0).html(0)), a.totalAmountCount() }), $("#order_coupon").find("li[name='coupon']").click(function() { var b = OW.int($(this).attr("is_can_mix_use")), c = $(this).attr("selected"); 1 == c ? $(this).removeClass("current").attr("selected", 0) : (0 == b && $(this).siblings("li[is_can_mix_use='0']").removeClass("current").attr("selected", 0), $(this).addClass("current").attr("selected", 1)), i = "", a.costCoupon = 0, $("#order_coupon").find("li[name='coupon'][selected=1]").each(function() { i = OW.isNull(i) ? $(this).attr("coupon_code") : i + "," + $(this).attr("coupon_code"), a.costCoupon = a.costCoupon + OW.parseMoney($(this).attr("coupon_money")) }), j.val(i), a.costInvoiceCount(), a.totalAmountCount(), f.attr("money", a.costCoupon).html(OW.parsePrice(a.costCoupon)) }), d.click(function() { var b, d, e, f, g, h, i, j, l, m, n, o, p, q, r, t, u, v, w = '"region_data":""', x = !0, y = !0, z = c.find("select[is_region='1']"), A = $("span[name='t_order_region']"); z.length > 0 && (A.removeClass("t-err").html(""), z.each(function() { ! OW.int($(this).val()) > 0 && (x = !1, $(this).focus(), A.addClass("t-err").html("请先选择配送地区!")), w = '"region_data":"' + $(this).find("option:selected").attr("path") + '"' })), x ? k.each(function() { t = OWValidForm({ form: $(this) }), t.verify(), t.getFormData(), t.result || (y = !1), e = OW.isNull(e) ? t.formJsonData: e + "," + t.formJsonData }) : y = !1, "function" == typeof a.orderSubmitFun && y && (y = a.orderSubmitFun.call(this)), y && (v = (new OWDialog).posting("亲,您的的订单正在提交,请稍后...").position(), u = c.find("input[name='item[goods]']"), u.each(function() { q = '{"suit_id":"' + OW.int($(this).attr("suit_id")) + '","gid":"' + $(this).attr("gid") + '","pid":"' + $(this).attr("pid") + '","m":"' + $(this).attr("amount") + '"}', r = OW.isNull(r) ? q: r + "," + q }), e = OW.isNull(e) ? "": "," + e, h = OW.trim($("#order_invoice").find("input[name='invoice']").val()), g = 1 == $("#order_invoice").find("input[name='need_invoice']").attr("checked") ? 1 : 0, j = '"offline_store_id":"' + OW.iif(a.isOffline, OW.int($("input[name='order_offline_store']").val()), "0") + '"', l = '"order_dly_id":"' + OW.int($("#order_dly").find("input[name='order_dly']:checked").val()) + '"', h = OW.isNull(h) ? "{}": h, h = '"is_need_invoice":"' + g + '","invoice":' + h, i = OW.trim($("#order_coupon").find("input[name='coupon']").val()), i = '"coupon":"' + i + '"', m = '"remark":"' + escape(OW.trim(c.find("input[name='remark']").val())) + '"', n = OW.trim(c.find("input[name='aux_data']").val()), n = '"aux_data":"' + n + '"', f = OW.int(c.find("input[name='is_book']").val()), o = '{"is_book":"' + f + '","order_type":"0","goods":[' + r + "]" + e + "," + w + "," + j + "," + l + "," + h + "," + i + "," + m + "," + n + "}", d = "order_data=" + escape(o), b = "payment", OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=order&act=order", data: d, success: function() { p = OW.ajaxData.order_id, OW.redirect(OW.siteUrl + "?ctl=order&act=" + b + "&order_id=" + p), OW.cookie.remove("cart"), v.timeout(2) }, failed: function(a) { v.error("亲,很抱歉,订单提交失败,请查看以下信息!", a).position().timeout(4) } })) }) }, this.orderPayment = function(a) { var b = a.orderId, d = (a.isBook, parseFloat(a.costPay)), e = parseFloat(a.totalAmount), f = parseFloat(a.bookFinalMoney), g = a.$payment, h = a.$costPay, i = a.$totalAmount, j = a.$btn, k = a.$bookFinalMoney; g.find("input[name='payment']").click(function() { var a = parseFloat($(this).attr("pay_fee")), b = e - d + a; h.html(OW.parsePrice(a)), i.html(OW.parsePrice(b)), k.html(OW.parsePrice(f - d + a)) }), g.find("dd[name='pay_bank_list'] li").hover(function() { $(this).find(".bank-name").show() }, function() { $(this).find(".bank-name").hide() }), g.find("dd[name='pay_bank_list'] input:radio").click(function() { var c, f, a = $(this).parent().parent().parent().parent().parent(), b = a.find("input[name='payment']"); b.attr("checked", !0), a.find("li>label").removeClass("current"), $(this).parent().addClass("current"), c = parseFloat(b.attr("pay_fee")), f = e - d + c, h.html(OW.parsePrice(c)), i.html(OW.parsePrice(f)) }), g.find("a[name='deposit_charge']").click(function() { OWDialog({ id: OW.createDialogID(), close: !1, content: "是否已完成充值?", ok: function() { OW.refresh() }, okValue: "充值完毕", cancel: !0, cancelValue: "未充值" }) }), j.click(function() { OW.setDisabled(j, !0); var a, c, d, e; return $input = g.find("input[name='payment']:checked"), $dl = $input.parent().parent(), $dialog = OWDialog().posting(), OW.objExist($input) ? (c = OW.int($input.val()), d = OW.parseBankCode($input.attr("pay_code")), "alipay" == d && OW.objExist($dl.find("dd[name='pay_bank_list']")) && (e = OW.parseBankCode($dl.find("input[name='alipay_bank']:checked").val()), OW.isNull(e)) ? ($dialog.error("请选择银行!").position().timeout(2), OW.setDisabled(j, !1), !1) : (a = "order_id=" + b + "&pay_id=" + c + "&bank_code=" + e, OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=order&act=payment", data: a, success: function() { var a = OW.ajaxData.is_need_pay_online; a ? OW.redirect(OW.siteUrl + "ow-includes/ow.order_pay.asp?order_id=" + b) : OW.redirect(OW.siteUrl + "?ctl=order&act=finish&order_id=" + b), $dialog.close() }, failed: function(a) { $dialog.error("亲,很抱歉,支付方式提交失败,请查看以下信息!", a).position().timeout(4), OW.setDisabled(j, !1) } }), void 0)) : ($dialog.error("请选择支付方式!").position().timeout(2), OW.setDisabled(j, !1), !1) }) }, this.buyRecordInit = function(b) { a.recordTpl = b.tpl, a.recordCountSection = b.countSection, a.recordListSection = b.listSection, a.recordPagerSection = b.pagerSection, a.recordPageSize = b.pageSize ? b.pageSize: 20, a.recordPageTpl = b.pageTpl ? b.pageTpl: "", b.initGet === !1 ? !1 : !0, OW.isStaticHtml() && OW.shop.getBuyRecord(1) }, this.commentInit = function(b) { a.cmtTpl = b.tpl, a.cmtCountSection = b.countSection, a.cmtListSection = b.listSection, a.cmtPagerSection = b.pagerSection, a.cmtPageSize = b.pageSize ? b.pageSize: 20, a.cmtPageTpl = b.pageTpl ? b.pageTpl: "", b.initGet === !1 ? !1 : !0, OW.isStaticHtml() && OW.shop.getComment(1) }, this.consultationInit = function(b) { a.cstTpl = b.tpl, a.cstCountSection = b.countSection, a.cstListSection = b.listSection, a.cstPagerSection = b.pagerSection, a.cstPageSize = b.pageSize ? b.pageSize: 20, a.cstPageTpl = b.pageTpl ? b.pageTpl: "", b.initGet === !1 ? !1 : !0, $form = b.form, $vc = b.verifycode, $vv = b.vcodeValue, $submit = b.submit, $author = $form.find("input[name='consult_author']").val(OW.nickname), $authorT = $form.find("span[name='t_consult_author']"), $content = $form.find("textarea[name='consult_content']"), $contentT = $form.find("span[name='t_consult_content']"), $email = $form.find("input[name='consult_email']"), $emailT = $form.find("span[name='t_consult_email']"), $isEmail = $form.find("input[name='is_answer_to_email']"), OW.logined && ($author.val(OW.cookie.getCookie("username")), $author.parent().parent().hide()), $content.blur(function() { $(this).val(OW.left(OW.trim($(this).val()), 250)) }), $isEmail.click(function() { 1 == $(this).attr("checked") ? $email.parent().parent("dl").show(200) : $email.parent().parent("dl").hide(200) }), OW.verifyCodeValueBlur($vv), OW.verifyCodeValueFocus($vv, $vc), OW.enterClick(function() { $submit.click() }), OW.isStaticHtml() && OW.shop.getConsultation(1), $submit.click(function() { var h, i, a = !0, b = OW.trim($author.val()), c = OW.trim($content.val()), d = OW.int($form.find("input[name='consult_type']:checked").val()), e = OW.trim($email.val()), f = OW.trim($vc.find("input[name='verifycode_name']").val()), g = OW.trim($vv.val()); OW.isNull(c) ? (a = !1, $content.addClass("textarea-err").focus(), $contentT.addClass("t-err").html("请填写咨询内容")) : ($content.removeClass("textarea-err"), $contentT.removeClass("t-err").html("")), a && (OW.isNull(b) ? (a = !1, $author.addClass("text-err").focus(), $authorT.addClass("t-err").html("请填写您的称呼")) : ($author.removeClass("text-err"), $authorT.removeClass("t-err").html(""))), a && 1 == $isEmail.attr("checked") && (OW.isNull(e) ? (a = !1, $email.addClass("text-err").focus(), $emailT.addClass("t-err").html("请填写我的邮箱")) : OW.isEmail(e) ? ($email.removeClass("text-err"), $emailT.removeClass("t-err").html("")) : (a = !1, $email.addClass("text-err").focus(), $emailT.addClass("t-err").html("邮箱格式不正确,请填写正确的邮箱!"))), a && (OW.isNull(g) ? (a = !1, $vv.addClass("text-err").focus()) : $vv.removeClass("text-err")), $email.val(e), $content.val(c), $email.val(e), a && (h = OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=consult_post", i = "cst_type=" + d + "&cst_author=" + escape(b) + "&cst_content=" + escape(c) + "&cst_author_email=" + escape(e) + "&gid=" + OW.gid + "&verifycode_name=" + f + "&verifycode_value=" + g, $dialog = OWDialog().posting().follow($content), OW.ajax({ url: h, data: i, success: function() { $dialog.success("亲,恭喜,咨询提交成功,请等待客服回复!").timeout(2).removeClose(!0), OW.delay(2200, function() { $content.val("").focus(), $vc.html(""), $vv.val("") }) }, failed: function(a) { $dialog.error("亲,很抱歉,咨询提交失败,请刷新页面再试试!", a).timeout(4), $vv.val("").focus(), OW.verifyCode({ boxer: $vc }) } })) }), $("img[name='avatar'][src='']").attr("src", OW.siteUrl + "ow-content/images/avatar.jpg") }, this.copyright = function() { var a = ">o>p>e>n>w>b>s>"; return OW.rep(a, ">", "") }, this.priceDisplay = function() { if (OW.logined && (a.goodsMyPrice < a.goodsPrice ? (a.myPriceSection.show(), $("#goods_price").addClass("my-price-show")) : a.myPriceSection.hide()), 1 == a.pointSet) a.goodsMyPrice <= 0 ? (a.pointplus.hide(), OW.logined && a.myPriceSection.hide(), a.priceDefGrid.hide()) : (a.pointplus.css("display", "inline-block"), a.priceDefGrid.show()); else { var b = $("#goods_point"), c = b.attr("point_get_type"), d = b.attr("shopping_point_rate"), e = b.attr("point_get_amount"); e = OW.iif(0 == c, OW.int(a.goodsMyPrice * d), e), b.find("b[name='point']").html(e) } }, this.getGoodsInitData = function() { OW.ajax({ async: !1, data: "gid=" + escape(OW.gid) + "&pid=" + escape(a.pid), url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_goods_init_data", success: function() { if (OW.shop.productsData = OW.ajaxData.products_data, OW.logined) { var b = OW.ajaxData.my_price; a.goodsMyPrice = OW.parseMoney(b), a.myPriceSection.show(), a.myPriceSection.find("[name='my_price']").html(OW.parsePrice(b)), OW.shop.priceDisplay() } $("#suits").html(unescape(OW.ajaxData.suits_html)) }, failed: function(a) { OWDialog().error("亲,很抱歉,获取商品信息失败,请刷新页面再试试!", a).timeout(2) } }) }, this.goodsSuitInit = function() { var b = $("#goods_suit"), c = b.find("div[name='suit_header']"), d = b.find("div[name='suit_section']"), e = b.find("[name='suit_o_amount']"); $suitAmount = b.find("[name='suit_amount']"), $suitSave = b.find("[name='suit_save']"), $suitBuy = b.find("button[name='btn_suit_buy']"), $ul = d.find("ul:eq(0)"), suitId = c.find("li:eq(0)").attr("suit_id"), suitOAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_o_amount")), suitAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_amount")), suitSave = OW.parseMoney(d.find("ul:eq(0)").attr("price_save")), $suitBuy.attr("suit_id", suitId), e.html(OW.parsePrice(suitOAmount)), $suitAmount.html(OW.parsePrice(suitAmount)), $suitSave.html(OW.parsePrice(suitSave)), c.find("li:eq(0)").addClass("current"), d.find("ul:eq(0)").show(), c.find("li").click(function() { suitId = OW.int($(this).attr("suit_id")), $ul = d.find("ul[suit_id='" + suitId + "']"), suitOAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_o_amount")), suitAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_amount")), suitSave = OW.parseMoney($ul.attr("price_save")), $suitBuy.attr("suit_id", suitId), e.html(OW.parsePrice(suitOAmount)), $suitAmount.html(OW.parsePrice(suitAmount)), $suitSave.html(OW.parsePrice(suitSave)), $(this).addClass("current"), $(this).siblings().removeClass("current"), $ul.show(200), d.find("ul[suit_id!='" + suitId + "']").hide(200) }), d.find("ul").each(function() { var a = $(this).find("li"), b = a.length * (OW.int(a.css("width")) + OW.int(a.css("padding-left")) + OW.int(a.css("padding-right"))); $(this).css("width", b) }), $suitBuy.click(function() { var b = OW.int($(this).attr("is_book")); return suitId = $(this).attr("suit_id"), a.productAmount = OW.int(a.amountInput.val()), OW.logined || 1 == OW.int(OW.cookie.getCookie("unlogin_buy")) ? (!a.pid > 0 || a.pid == OW.pid && a.specCount > 0 ? a.specSection.parent().addClass("spec-un-selected") : 1 == b ? a.cartOrderSubmit({ is_book: "1", data: '[{"suit_id":"' + suitId + '","gid":"' + OW.gid + '","pid":"' + a.pid + '","m":"' + a.productAmount + '"}]' }) : (a.addToCart(suitId, OW.gid, a.pid, a.productAmount), OW.redirect(OW.cartUrl, 0)), void 0) : (OW.member.loginWindow({ success: function() { OW.refresh() } }), !1) }) }, this.goodsSuitAmountCount = function() { var a = $("#goods_suit"), b = a.find("div[name='suit_header']"), c = a.find("div[name='suit_section']"), d = a.find("[name='suit_o_amount']"); $suitAmount = a.find("[name='suit_amount']"), $suitSave = a.find("[name='suit_save']"), $li = b.find("li.current"), $ul = c.find("ul[suit_id='" + $li.attr("suit_id") + "']"), suitOAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_o_amount")), suitAmount = OW.shop.goodsMyPrice + OW.parseMoney($ul.attr("price_amount")), suitSave = OW.parseMoney($ul.attr("price_save")), d.html(OW.parsePrice(suitOAmount)), $suitAmount.html(OW.parsePrice(suitAmount)), $suitSave.html(OW.parsePrice(suitSave)) }, this.goodsInit = function(b) { var h, i, j, k, l, m, n, o, d = b.btnBook, e = b.btnBuy, f = b.btnBuyCart, g = b.btnCart; a.pid = OW.pid, a.priceSection = b.priceSection, a.marketPriceSection = b.marketPriceSection, a.myPriceSection = b.myPriceSection, a.bookPriceSection = b.bookPriceSection, a.bookMoneySection = $("[name='book_front_money']"), a.bookTimeSection = b.bookTimeSection, a.specSection = b.specSection, a.amountInput = b.amountInput, a.amountDecrease = b.amountDecrease, a.amountIncrease = b.amountIncrease, a.stockTipSection = b.stockTipSection, a.goodsPrice = OW.parseMoney(a.priceSection.html()), a.goodsMyPrice = a.goodsPrice, a.priceDefGrid = a.priceSection.parent().parent().parent(), a.isBook = OW.int(a.bookPriceSection.attr("is_book")), a.pointplus = $("#pointplus"), OW.shop.goodsSpecImagesChangeFun = b.specImagesFun || function() {}, OW.shop.goodsSpecDisplay(), OW.shop.getGoodsInitData(), OW.shop.goodsSuitInit(), OW.shop.priceDisplay(), a.productStock = a.productsData[0].stock, $("[name='stock_amount']").html(a.productStock), a.productStock <= 0 && (d.attr("disabled", !0).addClass("disabled").html(OW.stocklang), f.attr("disabled", !0).addClass("disabled").html(OW.stocklang), e.hide(), g.hide(), $("#goods_suit").find("button[name='btn_suit_buy']").attr("disabled", !0).addClass("disabled").html(OW.stocklang)), 1 == a.isBook && (h = 1, i = 1, j = 0, k = 0, l = OW.int(a.bookTimeSection.attr("book_final_pay_day")), m = OW.int(a.bookTimeSection.attr("is_book_timelimit")), n = a.bookTimeSection.attr("book_starttime"), o = a.bookTimeSection.attr("book_endtime"), a.bookFrontMoneyRate = a.bookPriceSection.attr("book_front_money_rate"), a.bookPriceDiscount = OW.parseMoney(a.bookPriceSection.attr("book_price_discount")), k = a.bookFrontMoneyRate, j = a.goodsMyPrice - a.bookPriceDiscount, 0 > j && (j = 0), j = j * k / 100, 1 == m && (OW.isValidDataime(n) && (h = OW.dateDiff("s", n, OW.now()), 0 > h && (d.addClass("disabled").attr("disabled", "disabled").html("预订时间未到"), $("#goods_suit").find("button[name='btn_suit_buy']").addClass("disabled").attr("disabled", "disabled").html("预订时间未到"))), OW.isValidDataime(o) && (i = OW.dateDiff("s", OW.now(), o), 0 > i && (d.addClass("disabled").attr("disabled", "disabled").html("已结束预订"), $("#goods_suit").find("button[name='btn_suit_buy']").addClass("disabled").attr("disabled", "disabled").html("已结束预订")))), OW.appendToString = "", OW.append(""), a.bookTimeSection.append(OW.appendToString).show(), a.bookMoneySection.html(OW.parsePrice(j)), (j > 0 || a.bookPriceDiscount > 0) && a.bookPriceSection.show()), a.amountInput.blur(function() { var b = $(this).val(); b = OW.int(b.replace(/[^0-9]*/g, "")), b > a.productStock && a.productStock > 0 && (b = a.productStock), 1 > b && (b = 1), $(this).val(b) }), a.amountDecrease.click(function() { var b = OW.int(a.amountInput.val()) - 1; 1 > b && (b = 1), a.amountInput.val(b) }), a.amountIncrease.click(function() { var b = OW.int(a.amountInput.val()) + 1; b > a.productStock && a.productStock > 0 && (b = a.productStock), a.amountInput.val(b) }), d.click(function() { if (!OW.int(a.amountInput.val()) > 0) return a.stockTipSection.html("亲,购买数量不能小于或为0!").show(100), !1; if (a.stockTipSection.html("").hide(100), !OW.logined && 1 != OW.int(OW.cookie.getCookie("unlogin_buy"))) return OW.member.loginWindow({ success: function() { OW.refresh() } }), !1; if (!a.pid > 0 || a.pid == OW.pid && a.specCount > 0) a.specSection.parent().addClass("spec-un-selected"); else { if (OW.int(a.amountInput.val()) > a.productStock) return a.stockTipSection.html("亲,您所填写的购买数量超过库存了!").show(100), !1; a.stockTipSection.html("").hide(100), a.specSection.parent().removeClass("spec-un-selected"), a.productAmount = OW.int(a.amountInput.val()), a.cartOrderSubmit({ is_book: "1", data: '[{"suit_id":"0","gid":"' + OW.gid + '","pid":"' + a.pid + '","m":"' + a.productAmount + '"}]' }) } }), e.click(function() { if (!OW.int(a.amountInput.val()) > 0) return a.stockTipSection.html("亲,购买数量不能小于或为0!").show(100), !1; if (a.stockTipSection.html("").hide(100), !OW.logined && 1 != OW.int(OW.cookie.getCookie("unlogin_buy"))) return OW.member.loginWindow({ success: function() { OW.refresh() } }), !1; if (!a.pid > 0 || a.pid == OW.pid && a.specCount > 0) a.specSection.parent().addClass("spec-un-selected"); else { if (OW.int(a.amountInput.val()) > a.productStock) return a.stockTipSection.html("亲,您所填写的购买数量超过库存了!").show(100), !1; a.stockTipSection.html("").hide(100), a.specSection.parent().removeClass("spec-un-selected"), a.productAmount = OW.int(a.amountInput.val()), a.cartOrderSubmit({ data: '[{"suit_id":"0","gid":"' + OW.gid + '","pid":"' + a.pid + '","m":"' + a.productAmount + '"}]' }) } }), f.click(function() { if (!OW.int(a.amountInput.val()) > 0) return a.stockTipSection.html("亲,购买数量不能小于或为0!").show(100), !1; if (a.stockTipSection.html("").hide(100), !OW.logined && 1 != OW.int(OW.cookie.getCookie("unlogin_buy"))) return OW.member.loginWindow({ success: function() { OW.refresh() } }), !1; if (!a.pid > 0 || a.pid == OW.pid && a.specCount > 0) a.specSection.parent().addClass("spec-un-selected"); else { if (OW.int(a.amountInput.val()) > a.productStock) return a.stockTipSection.html("亲,您所填写的购买数量超过库存了!").show(100), !1; a.stockTipSection.html("").hide(100), a.specSection.parent().removeClass("spec-un-selected"), a.productAmount = OW.int(a.amountInput.val()), a.addToCart(0, OW.gid, a.pid, a.productAmount), OW.redirect(OW.cartUrl, 0) } }), g.click(function() { if (!OW.int(a.amountInput.val()) > 0) return a.stockTipSection.html("亲,购买数量不能小于或为0!").show(100), !1; if (a.stockTipSection.html("").hide(100), !OW.logined && 1 != OW.int(OW.cookie.getCookie("unlogin_buy"))) return OW.member.loginWindow({ success: function() { OW.refresh() } }), !1; if (!a.pid > 0 || a.pid == OW.pid && a.specCount > 0) a.specSection.parent().addClass("spec-un-selected"); else { if (OW.int(a.amountInput.val()) > a.productStock) return a.stockTipSection.html("亲,您所填写的购买数量超过库存了!").show(100), !1; a.stockTipSection.html("").hide(100), a.specSection.parent().removeClass("spec-un-selected"), a.productAmount = OW.int(a.amountInput.val()), a.addToCart(0, OW.gid, a.pid, a.productAmount), a.cartInit({}) } }) }, this.removeCartGoods = function(a, b, c) { var d, e, f, g = OW.cookie.getCookie("cart"), h = new OWDialog({ id: OW.createDialogID(), content: "确定要删除吗?", ok: function() { if (!OW.isNull(g)) for (e = OW.JSON.parse(g), d = 0; d < e.length; d++) if (e[d].suit_id == a && e[d].gid == b && e[d].pid == c) { e = OW.JSON.del(d, e), f = OW.JSON.toString(e), OW.cookie.setCookie("cart", f, 10368e5); break } return h.success("亲,商品已从购物车删除!"), OW.refresh(), !1 }, cancel: !0, close: !1 }).position() }, this.gartGoodsAmountChange = function(a, b, c) { var d, e, f, g = OW.cookie.getCookie("cart"); if (!OW.isNull(g)) for (e = OW.JSON.parse(g), d = 0; d < e.length; d++) if (e[d].gid == a && e[d].pid == b) { e[d].m = OW.toString(OW.int(c)), f = OW.JSON.toString(e), OW.cookie.setCookie("cart", f, 10368e5); break } }, this.goodsSpecImagesChangeFun, this.goodsSpecDisplay = function() { var b, c, d, e, f, g, h, i, j, k, l, m = a.specSection, n = OW.trim(m.attr("data")), o = '
    {$spec_name}
    {$spec_value}
    ', p = ""; if ("" == n) a.specSection.parent().hide(); else { for (n = OW.JSON.parse(n), a.specCount = n.length, e = 0; e < n.length; e++) { for (g = n[e].spec_id, h = unescape(n[e].spec_name), d = o.replace("{$spec_name}", h).replace("{$spec_id}", g), b = n[e].spec_value, c = "", f = 0; f < b.length; f++) i = b[f].value_id, j = unescape(b[f].value_name), k = unescape(b[f].value_image), l = b[f].value_images, c = "" != k ? c + '
  • ' + j + "
  • ": c + '
  • ' + j + "
  • "; "" != c && (c = '"), d = d.replace("{$spec_value}", c), p += d } m.html(p), m.find("a").click(function() { var b, e, f, i, j, k, l, n, o, p; if (a.pid = 0, "true" == $(this).parent().attr("disabled")) return ! 1; if (e = !1, f = $(this).attr("spec_id"), $(this).attr("value_id"), $(this).attr("value_image"), i = $(this).attr("value_images"), j = !0, k = $("div[name='selected_spec_display']"), l = k.find("[name='selected_spec_value']"), n = OW.shop.productsData, $(this).parent().parent().find("li").removeClass("current").attr("selected", !1), $(this).parent().addClass("current").attr("selected", !0), m.find("dl[spec_id!='" + f + "']").find("li").removeClass("disabled").attr("disabled", !1), o = a.getSelectValueId(), o.split(",").length == a.specCount) { for (a.productStock = 0, b = 0; b < n.length; b++) if (o == n[b].spec_value_id) { e = !0, a.pid = n[b].pid, a.productSn = n[b].product_sn, a.productStock = n[b].stock, a.priceSection.html(OW.parsePrice(n[b].price)), a.myPriceSection.find("[name='my_price']").html(OW.parsePrice(n[b].my_price)), a.marketPriceSection.html(OW.parsePrice(n[b].market_price)), 1 == a.isBook && (p = n[b].my_price - a.bookPriceDiscount, 0 > p && (p = 0), a.bookMoneySection.html(OW.parsePrice(p * a.bookFrontMoneyRate / 100))), a.goodsPrice = OW.parseMoney(n[b].price), a.goodsMyPrice = OW.parseMoney(n[b].my_price), a.MGPricesHtml = "", a.specSection.parent().removeClass("spec-un-selected"), OW.shop.priceDisplay(), $("#goods_product_sn").html(a.productSn); break } a.productStock > 0 ? $("[name='stock_amount']").html(a.productStock) : (j = !1, $("[name='stock_amount']").html(a.productStock), $(this).parent().removeClass("current").attr("selected", !1).addClass("disabled").attr("disabled", !0)) } e ? (OW.shop.goodsSuitAmountCount(), $("#goods_suit").find("[name='suit_goods_spec']").html(unescape(n[b].spec_value)), l.html(unescape(n[b].spec_value)), k.show(200)) : (l.html(""), k.hide(200)), j && (OW.isNull(i) || (i = unescape(i), OW.shop.goodsSpecImagesChangeFun(i))) }) } }, this.getSelectValueId = function() { var b = "", c = a.specSection.find("li[selected='true']"); return c.each(function() { b = OW.isNull(b) ? $(this).attr("value_id") : b + "," + $(this).attr("value_id") }), b }, this.getMGPrices = function() { var d, b = OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_mg_prices", c = $("div[name='member_group_prices']"); OW.isNull(OW.shop.MGPricesHtml) ? (d = OWDialog().loading("正在获取价格...").follow(c).shadow(!1), OW.ajax({ url: b, data: "gid=" + escape(OW.gid) + "&pid=" + escape(a.pid), success: function() { var a, f, g, b = '{$group}' + OW.moneySb + "{$price}", c = "", e = "", h = ""; for (f = OW.ajaxData.mgp, g = OW.ajaxData.msgp, (void 0 == g || "undefined" == g) && (g = []), h = '', a = 0; a < f.length; a++) c += b.replace("{$group}", unescape(f[a].group_name)).replace("{$price}", OW.parsePrice(f[a].price)); for (a = 0; a < g.length; a++) e += b.replace("{$group}", unescape(g[a].group_name)).replace("{$price}", OW.parsePrice(g[a].price)); "" != c && (c = '' + c + ""), "" != e && (e = '' + e + ""), h = h + c + e + "
    会员价格
    ", d.padding("0px").content(h), OW.shop.MGPricesHtml = h }, failed: function(a) { d.error("获取会员组价格数据失败!", a).timeout(2) } })) : d = OWDialog().content(OW.shop.MGPricesHtml).padding("0px").follow(c).shadow(!1) }, this.recordTpl = "", this.recordCountSection = "", this.recordListSection = "", this.recordPagerSection = "", this.recordPageSize = 20, this.recordPageTpl = "", this.getBuyRecord = function(b) { var c = a.recordCountSection, d = a.recordListSection, e = a.recordPagerSection; b = OW.int(b), d.html('
    成交记录加载中...
    '), OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_buy_record", data: "gid=" + escape(OW.gid) + "&page=" + b + "&tpl=" + escape(a.recordTpl) + "&pagesize=" + a.recordPageSize + "&pagetpl=" + escape(a.recordPageTpl), success: function() { var a = OW.int(OW.ajaxData.count), b = OW.ajaxData.list, f = OW.ajaxData.pager; c.html(a), d.hide().html(unescape(b)).show(200), e.html(unescape(f)) }, failed: function(a) { d.html("亲,很抱歉,成交记录数据加载失败,请刷新页面再试试!
    " + a) } }) }, this.cmtTpl = "", this.cmtCountSection = "", this.cmtListSection = "", this.cmtPagerSection = "", this.cmtPageSize = 20, this.cmtPageTpl = "", this.getComment = function(b) { var c = a.cmtCountSection, d = a.cmtListSection, e = a.cmtPagerSection; b = OW.int(b), d.html('
    评论加载中...
    '), OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_comment", data: "gid=" + escape(OW.gid) + "&page=" + b + "&tpl=" + escape(a.cmtTpl) + "&pagesize=" + a.cmtPageSize + "&pagetpl=" + escape(a.cmtPageTpl), success: function() { var a = OW.int(OW.ajaxData.count), b = OW.ajaxData.list, f = OW.ajaxData.pager; c.html(a), d.hide().html(unescape(b)).show(200), e.html(unescape(f)), $("img[name='avatar'][src='']").attr("src", OW.siteUrl + "ow-content/images/avatar.jpg"), $("[name='comment_data_reply']").each(function() { OW.isNull($(this).find("[name='reply_content']").html()) && $(this).remove() }), $("[name='cmt_type']").each(function() { $(this).html(commentType($(this).attr("cmt_type"))) }) }, failed: function(a) { d.html("亲,很抱歉,评论数据加载失败,请刷新页面再试试!
    " + a) } }) }, this.cstTpl = "", this.cstCountSection = "", this.cstListSection = "", this.cstPagerSection = "", this.cstPageSize = 20, this.cstPageTpl = "", this.getConsultation = function(b) { var c = a.cstCountSection, d = a.cstListSection, e = a.cstPagerSection; b = OW.int(b), d.html('
    咨询加载中...
    '), OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=goods&act=get_consultation", data: "gid=" + escape(OW.gid) + "&page=" + b + "&tpl=" + escape(a.cstTpl) + "&pagesize=" + a.cstPageSize + "&pagetpl=" + escape(a.cstPageTpl), success: function() { var a = OW.int(OW.ajaxData.count), b = OW.ajaxData.list, f = OW.ajaxData.pager; c.html(a), d.hide(50).html(unescape(b)).show(200), e.html(unescape(f)), $("img[name='avatar'][src='']").attr("src", OW.siteUrl + "ow-content/images/avatar.jpg"), $("[name='consult_data_reply']").each(function() { OW.isNull($(this).find("[name='reply_content']").html()) && $(this).remove() }) }, failed: function(a) { d.html("亲,很抱歉,咨询数据加载失败,请刷新页面再试试!
    " + a) } }) } } function couponClass() { this.get = function(a) { var b = OWDialog().loading("正在获取优惠券..."); OW.ajax({ url: OW.sitePath + "ow-includes/ow.ajax.shop.asp?ctl=coupon&act=get_coupon", data: "coupon_id=" + escape(a), success: function() { b.success("成功获取优惠券") }, failed: function(a) { b.error("获取优惠券失败", a).position() } }) } } OW.client = new Client, OW.ad = new ADClass, OW.cmt = new CMTClass, OW.link = new linkClass, OW.gallery = new galleryClass, OW.member = new memberClass, OW.search = new searchClass, OW.shop = new shopClass, OW.coupon = new couponClass;