index.js 214 KB
define("index",["jquery","handlebars","source-map","index","lazyload","dot","jquery.placeholder","jquery-pjax"],function(e,t,a){var n;e("js/common"),e("js/header"),e("js/simple-header"),e("js/product/entry"),e("js/index/index"),e("js/brand/index"),e("js/passport/entry"),e("js/cart/cart"),e("js/guang/entry"),e("js/home/entry"),e("js/help/entry"),e("js/order/ensure"),e("js/shopping/pay"),e("js/pay/wechatqrcode"),a.exports=n}),define("js/common",["jquery"],function(e,t,a){function n(e){var t=new RegExp(e+"=([^;$]*)","i"),a="$1";return t.test(decodeURIComponent(document.cookie))?RegExp[a]:""}function i(e,t,a){var n,i,o,s,r="";"undefined"!=typeof t&&(a=a||{},null===t&&(t="",a.expires=-1),a.expires&&("number"==typeof a.expires||a.expires.toUTCString)&&("number"==typeof a.expires?(s=new Date,s.setTime(s.getTime()+24*a.expires*60*60*1e3)):s=a.expires,r="; expires="+s.toUTCString()),n=a.path?"; path="+a.path:"",i=a.domain?"; domain="+a.domain:"",o=a.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,n,i,o].join(""))}function o(){var e,t=n("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function s(){var e=o();return 0===e?0:e[1]}function r(){var e=n("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function d(){var e,t,a={},n=window.location.search,i=n?decodeURIComponent(n).slice(1).split("&"):[];for(t=0;t<i.length;t++)e=i[t].split("="),a[e[0]]=e[1];return a}var l=e("jquery"),c=l("body");e("js/footer"),function(e,t,a,n,i){var o=t.createElement(a),s=t.getElementsByTagName(a)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[i].p=arguments},o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js","_yas"),function(){var e=s();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.14","yohobuy_web",e,"","")}(),l(window).on("resize",function(){var e=l(this).width();1360>e?l(".return-top").addClass("min"):l(".return-top").removeClass("min"),1180>e?c.addClass("min-screen"):c.removeClass("min-screen")}).trigger("resize"),function(){l(window).load(function(){var e,t=document.getElementById("user-thumb");t&&(e=new Image,e.src=t.src,e.onerror=function(){l(t).parent().append('<div class="default-user-thumb"></div>').end().remove()})})}(),window.cookie=n,window.setCookie=i,window.getUser=o,window.getUid=s,window.getShoppingKey=r,window.queryString=d}),define("js/footer",["jquery"],function(e,t,a){function n(){var e=s("#subscriber-box"),t=s("#subscriber-btn"),a=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,n={mail:"&#xe61b;",tick:"&#xe61a"};e.focus(function(){s(this).val("").css("color",""),t.removeClass("done").html(n.mail)}),t.click(function(){var i=s.trim(e.val());if(""!==i&&a.test(i))try{s.ajax({url:"http://new.yohobuy.com/common/emailsubscriber",dataType:"jsonp",data:{email:i,tmp:Math.random(),uid:window.getUid()},success:function(a){1===a.data.result?(e.val("已订阅到:"+i),t.addClass("done").html(n.tick)):e.css("color","red")}})}catch(o){console.log(o.message)}else e.css("color","red")})}function i(){var e=s(".vote"),t=s("#feed-back-page"),a=e.children("li").length;t.on("click","span",function(){var t=s(this);t.hasClass("cur")||(t.siblings(".cur").removeClass("cur"),t.addClass("cur"),e.children().not(".hide").addClass("hide").end().eq(t.index()).removeClass("hide"))}),e.on("click",".feed-back-btn",function(){var n=s(this),i=n.closest("li"),o=i.index(),r=[],d=i.find(".feedback-answer").val(),l=i.find(".feedback-id").val(),c=i.find(".question-id").val();i.find(":checked").each(function(){r.push(s(this).val())}),s.ajax({url:"http://new.yohobuy.com/common/suggestfeedback",dataType:"jsonp",data:{feedback_id:l||0,question_id:c||0,answer:d||"",solution:r.join(",")},success:function(n){var s=o+1;if(1===~~n.data.result){if(o===a-1)return void alert("感谢您的参与!");i.addClass("hide"),e.children(":eq("+(o+1)+")").removeClass("hide"),t.children(".cur").removeClass("cur"),t.children(":eq("+s+")").addClass("cur")}}})})}function o(){s(window).height()>s(document).height()&&r.addClass("hide")}var s=e("jquery"),r=s(".return-top");r.click(function(){s("html,body").animate({scrollTop:0},500)}),s(window).scroll(function(){0===s(window).scrollTop()?r.addClass("hide"):r.removeClass("hide")}),r.hasClass("hide")&&s("img").load(o),n(),i(),window.rePosReturnTop=o}),define("js/header",["jquery","handlebars","source-map","index"],function(e,t,a){function n(e,t,a){try{te.push({louceng:e,weizhi:t,event:a})}catch(n){}}function i(){var e=G("#nav_keyword").text(),t="vans",a=G("#query_key");""!==e?(a.css({color:"#000"}),a.val(e)):(a.css({color:"#e0e0e0"}),a.val(t),a.on("focus",function(e){a.css({color:"#000"}),a.val("")}))}function o(){var e={cookie:"_g",cartNum:""},t="",a="",n=0,i=0,o=0,s=0,r="";G.fn.miniCart=function(n){if(t=G.extend(e,n),"undefined"==typeof window.cookie(t.cookie))a=null;else if(t.cookie)try{a=X.parse(window.cookie(t.cookie))}catch(i){}null!==a&&""!==a&&(s=parseInt(a._nac)+parseInt(a._ac),0===s?G("#icart-num").attr("class","icart-num icart-none"):G("#icart-num").attr("class","icart-num"),G(t.cartNum).html(s))},G.fn.search=function(e){function t(t){var a=G.trim(G(t).val());return a=a.replace(new RegExp("'","gm"),""),""===a?(G(".search-list").hide(),!1):(a=encodeURI(a),void G.get(e+"?query="+a,function(e){G(".search-list").html(e.data),n=G(".search-list").children("li").length,i=-1,n>0?G(".search-list").show():G(".search-list").hide(),G(".search-list").find("a").hover(function(){G(this).css("background-color","#eee")},function(){G(this).css("background-color","#fff")})},"jsonp"))}function a(e){G(".search-list li:eq("+o+")").children("a").css("background-color","#fff"),G(".search-list li:eq("+i+")").children("a").css("background-color","#eee"),r=G(".search-list li:eq("+i+")").children("a").attr("title"),G("#query_key").val(r)}return this.each(function(){G(this).keyup(function(e){if(38===e.which){if(0===n)return!1;-1===i&&(i=0),o=i,i=(i-1+n)%n,a(this)}else if(40===e.which){if(0===n)return!1;o=i,i=(i+1)%n,a(this)}else 13===e.which?window.submitSearch():t(this)})})},G.extend({getData:function(e,t,a){var n={page:1,method:"",v:1,return_type:"jsonp",open_key:"12345",tmp:Math.random()},i="";if(void 0===typeof e||""===e)return!1;if(i=G.extend(n,t),i.page=i.page||1,""===i.method)return!1;try{G.getJSON(e+"/?callback=?",i,function(e){return""!==a?("undefined"!=typeof a(e.data)&&X.parse(a(e.data)),!1):void 0})}catch(o){console.log(o.message)}},getShoppingKey:function(){var e,t=window.cookie("_g"),a=X.parse(t);return"undefined"==typeof t||null===t?(e=window.cookie("_SPK"),e?e:""):a._k}})}function s(e){var t;200===+e.code&&"object"==typeof e.data&&(t=""!==e.data.url?'<a target="_blank" href="'+e.data.url+'" class="page-top-banner"style="height:36px;border:none;background-image:url('+window.unescape(e.data.src)+');background-position: center;display:block;">&nbsp;</a>':'<div class="noticewrapper"><div class="noticecontainer"><h1 class="noticetitle">关于系统升级的公告</h1><div class="noticecontent"><p class="tips">尊敬的顾客:</p><p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p><p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常</p><p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p></div></div></div>',G("body").prepend(t))}function r(e){var t=document.createElement("script");t.src=le+e+"&client_type=web&callback=JsonPCallBack",document.getElementsByTagName("head")[0].appendChild(t)}function d(e,t){var a,n;G(e).hover(function(e){e.preventDefault(),a=G(this),n=G(t)[0],""===n.style.display?(a.addClass("acttags"),n.style.display="block"):(a.removeClass("acttags"),n.style.display="")})}function l(){var e,t,a=[{sourceClass:".myyoho",targetClass:".myyoho-info"},{sourceClass:".phone",targetClass:".qr"}];for(t=0;t<a.length;t++)e=a[t],d(e.sourceClass,e.targetClass)}function c(){var e;G(".yohogroup").mouseenter(function(){e=G(this),e.text(e.attr("cn"))}),G(".yohogroup").mouseleave(function(){e=G(this),e.text(e.attr("en"))})}function u(){var e,t,a=["webkit","moz","ms"];for(t=0;t<a.length;t++)return e=a[t]+"RequestAnimationFrame",window[e]?!0:!1}function h(){var e=["webkit","moz","ms"],t=e[0]+"RequestAnimationFrame",a=e[1]+"RequestAnimationFrame",n=e[2]+"RequestAnimationFrame";return window[t]?function(e){requestAnimationFrame(e)}:window[a]?function(e){window[a](e)}:window[n]?function(e){window[n](e)}:function(e){window.setTimeout(e,67)}}function p(){ne+=10,ie.css({transform:"rotateX("+ne+"deg)","-webkit-transform":"rotateX("+ne+"deg)","-moz-transform":"rotateX("+ne+"deg)"}),ne/90%2===1&&(oe?(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo1.png)"),oe=!1):(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),oe=!0)),ne/90%2===0&&ne%360!==0?window.setTimeout(p,3e3):ne%360===0?window.setTimeout(p,6e4):ae(function(){p()})}function f(){R&&window.clearTimeout(R),ie.fadeOut(se,function(){oe=!1,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo.png)"),ie.fadeIn(se,function(){H=window.setTimeout(function(){ie.fadeOut(se,function(){window.clearTimeout(H),oe=!0,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ie.fadeIn(se,function(){R=window.setTimeout(f,6e4)})})},3e3)})})}function m(){u()?(ae=h(),window.setTimeout(p,3e3)):window.setTimeout(f,3e3)}function v(e){var t=G(e);t.find(".thirdnavbar").each(function(){var e=G(this),t=e.find("a"),a=t.attr("href"),n="hot"===t.attr("hot")?!0:!1,i={};i=e.hasClass("category-title")?{type:"title",height:49,content:e.text(),index:window.valueIndex,href:a,hot:!1}:{type:"catlist",height:36,content:t.text(),index:window.valueIndex,href:a,hot:n},window.valueIndex++,window.newArr.push(i)})}function g(){var e=window.newArr.length,t=0,a=[],n=[],i=[],o=[],s="",r="",d="",l=0,c=0,u=0;for(t;e>t;t++){if(a=window.newArr[t],0===window.gindex&&(window.oh1=window.oh1+a.height,window.oh1>=340&&t!==e-1&&(window.targetArr1=window.newArr.slice(0,a.index+1),window.nowIndex=a.index+1,window.gindex++),t===e-1)){window.targetArr1=window.newArr.slice(0,e+1);break}if(1===window.gindex&&(window.oh2=window.oh2+a.height,window.oh2>=340&&t!==e-1&&(window.targetArr2=window.newArr.slice(window.nowIndex,a.index+1),window.nowIndex=a.index+1,window.gindex++),t===e-1)){window.targetArr2=window.newArr.slice(window.nowIndex,e+1);break}if(2===window.gindex){if(window.oh3=window.oh3+a.height,window.oh3>=340&&t!==e-1){window.targetArr3=window.newArr.slice(window.nowIndex,a.index+1),window.nowIndex=a.index+1,window.gindex++;break}if(t===e-1){window.targetArr3=window.newArr.slice(window.nowIndex,e+1);break}}}for(l;l<window.targetArr1.length;l++)n=window.targetArr1[l]||{},"title"===n.type?window.inner1=window.inner1+'<li class="cattitle"><h3><a  href="'+n.href+'">'+n.content+"</a></h3></li>":n.hot===!0?window.inner1=window.inner1+'<li class="catdetail"><a  class="thirdcatelink hot" href="'+n.href+'">'+n.content+"</a></li>":window.inner1=window.inner1+'<li class="catdetail"><a  class="thirdcatelink" href="'+n.href+'">'+n.content+"</a></li>";for(c;c<window.targetArr2.length;c++)i=window.targetArr2[c]||{},"title"===i.type?window.inner2=window.inner2+'<li class="cattitle"><h3><a  href="'+i.href+'">'+i.content+"</a></h3></li>":i.hot===!0?window.inner2=window.inner2+'<li class="catdetail"><a  class="thirdcatelink hot" href="'+i.href+'">'+i.content+"</a></li>":window.inner2=window.inner2+'<li class="catdetail"><a  class="thirdcatelink" href="'+i.href+'">'+i.content+"</a></li>";for(u;u<window.targetArr3.length;u++)o=window.targetArr3[u]||{},"title"===o.type?window.inner3=window.inner3+'<li class="cattitle"><h3><a  href="'+o.href+'">'+o.content+"</a></h3></li>":o.hot===!0?window.inner3=window.inner3+'<li class="catdetail"><a  class="thirdcatelink hot" href="'+o.href+'">'+o.content+"</a></li>":window.inner3=window.inner3+'<li class="catdetail"><a  class="thirdcatelink" href="'+o.href+'">'+o.content+"</a></li>";""!==window.inner1&&(s='<ul class="cate_row1 cate_row">'+window.inner1+"</ul>"),""!==window.inner2&&(r='<ul class="cate_row2 cate_row">'+window.inner2+"</ul>"),""!==window.inner3&&(d='<ul class="cate_row3 cate_row">'+window.inner3+"</ul>"),window.finalresult=s+r+d,G("#"+window.wrapperindex).empty().append(window.finalresult)}function y(){G(".categorywrapper").each(function(e){window.wrapperindex=G(this).attr("id"),window.newArr=[],window.gindex=0,window.targetArr1=[],window.targetArr2=[],window.targetArr3=[],window.oh1=0,window.oh2=0,window.oh3=0,window.valueIndex=0,window.nowIndex=0,window.inner1="",window.inner2="",window.inner3="",v(G(this).find(".category")),g()})}function b(){var e={},t="",a="",n="",i="",o="";G(document).on("mouseenter",".sub-nav-item",function(){t=G(this).find(".showdetail").attr("data-code"),t&&(e[t]||(e[t]=t,a=G(this).find(".showdetail").find("img"),n=G(this).find(".showdetail").find(".title"),i=G(this).find(".showdetail").find("a"),G.get(le+t+"&width=337&height=250&client_type=web",function(e){a.attr("src",e.data.src),i.attr("href",e.data.url),n.text(e.data.title)},"jsonp")))}),o=G(".cure").find(".name-cn").find("a").attr("href"),G(".main-link").attr("href",o)}function w(){var e=G("#cover");e.remove()}function C(){var e,t=window.cookie("_Gender"),a="",i="",o="",s="";"http://www.yohobuy.com/"!==window.location.href||"undefined"!=typeof t&&""!==t&&null!==t||G.get("http://www.yohobuy.com/index/guide",function(t){a=document.createElement("div"),a.id="cover",a.innerHTML=t,document.body.appendChild(a),i=G(window).height(),o=G(".guide-box").height(),e=i/2-o/2,s=G(".guide-box .clear").find("li").length,G(".guide-box").css({width:200*s+"px",top:e+"px"}),G("#cover").bind("click",function(e){window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),w()}),G("#cover .guide-box .close").bind("click",function(e){n("弹窗","CLOSE","homepage_man"),window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),w()}),G(".boys img , .boys .go").bind("click",function(e){n("弹窗","BOYS","homepage_man"),window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),w()}),G(".girls img, .girls .go").bind("click",function(e){n("弹窗","GIRLS","homepage_woman"),window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})}),G(".lifestyle img, .lifestyle .go").bind("click",function(e){window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),n("弹窗","LIEFSTYLE","homepage_lifestyle")}),G("#cover .guide-box").bind("click",function(e){e.stopPropagation()})})}function i(){var e=G("#nav_keyword").text(),t=G("#defaultsearch").val(),a=G("#query_key");""!==e?(a.css({color:"#000"}),a.val(e)):(a.css({color:"#e0e0e0"}),a.val(t),a.on("focus",function(e){a.css({color:"#000"}),a.val("")})),G(document).click(function(e){G(e.target).closest(".searchspan, .search-list").length||G(".search-list").hide()})}function x(){var e=window.cookie("_Gender"),t=G(".cure");"undefined"!=typeof e&&""!==e&&window.setCookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===t.find(".name-cn a").text()&&(window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===t.find(".name-cn a").text()&&window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),"创意生活"===t.find(".name-cn a").text()&&window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===t.find(".name-cn a").text()&&window.setCookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})}function k(){G(".first-nav-item").click(function(){var e=window.cookie("_Gender");"undefined"!=typeof e&&""!==e&&window.setCookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===G(this).find(".name-cn a").text()&&(window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===G(this).find(".name-cn a").text()&&(window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})),"创意生活"===G(this).find(".name-cn a").text()&&window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===G(this).find(".name-cn a").text()&&window.setCookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})})}function j(){var e,t,a,n=document.cookie,i=n.split(";");for(e=0;e<i.length;e++)t=i[e].split("="),"undefined"!=typeof t[0]&&(a=t[0].replace(/\s/g,""),de[a]=t[1])}function _(){G("#miniCartBox").miniCart({cartNum:".ic-infomation"})}function q(){var e,t,a;G.getData(Q,{method:"open.Shoppingcart.getCartData",shopping_key:G.getShoppingKey()},function(n){""===Z&&(Z=Y.compile(G("#mini-cart-tpl").html())),G("#miniCartBox").children(".gobuy-wrapper").html(Z({carData:n})),0===parseInt(G(".ic-infomation").html())&&G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'),G("#miniCartBox .goods-list li").length<1&&(e=window.cookie("_g"),t=X.parse(e),null!==t&&(a='{"_k":"'+t._k+'","_nac":0,"_ac":0,"_r":0}',window.setCookie("_g",a,{path:"/",domain:".yohobuy.com"})),G(".ic-infomation").html(0),G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'))})}function T(e,t){G.getData(Q,{method:"open.Shoppingcart.delone",shopping_key:G.getShoppingKey(),id:e,isreduce:t},function(e){var t=window.cookie("_g"),a=X.parse(t),n='{"_k":"'+a._k+'","_nac":'+e.total_goods_num+',"_ac":0,"_r":0}';window.setCookie("_g",n,{path:"/",domain:".yohobuy.com"}),q(),_()})}function I(){var e,t,a;G(document).on("click",".goodscardelete",function(n){e=G(this),t=e.attr("goodsid"),a=e.attr("cheapest"),T(t,a)})}function A(){var e;G(document).on("click",".mycart_i_down",function(t){e=G(this),e.toggleClass("mycart_i_up"),G("#mycartmore").slideToggle(300)})}function E(){var e,t="http://www.yohobuy.com/shopping/cart";G("#miniCartBox").on("click",function(a){e=G(a.target),e.hasClass("gobuy")&&(window.location.href=t)})}function D(e){1===e?(G("#miniCartBox").addClass("list-cur"),G(".gobuy-wrapper").show(),0!==parseInt(G(".ic-infomation").html())?(G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-loading"><h3 class="information">加载中,请稍后</h3></div>'),q()):G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>')):(G("#miniCartBox").removeClass("list-cur"),G(".gobuy-wrapper").hide())}function S(){var e;G("#miniCartBox").mouseenter(function(t){e=G(t.target),("miniCartBox"===e.attr("id")||"ic-infomation"===e.attr("class"))&&D(1)}),G("#miniCartBox").mouseleave(function(e){D(0)})}function P(){var e,t="indexkids",a="indexlifestyle",n="indexboys",i="indexgirls",o="uniquebrand",s=window.location.href,d=window.location.host,l="";-1!==s.indexOf("search")&&(l=re["search"+de._Channel]),-1!==s.indexOf("list")&&(l=re["list"+de._Channel]),-1!==s.indexOf("brands")&&(l=re["brands"+de._Channel]),-1!==s.indexOf("new")&&(l=re["new"+de._Channel]),-1!==s.indexOf("sale")&&(l=re["sale"+de._Channel]),-1!==s.indexOf("home")&&(l=re["home"+de._Channel]),-1!==s.indexOf("kids")&&(l=re[t]),(-1!==s.indexOf("woman")||-1!==s.indexOf("girls"))&&(l=re[i]),-1!==s.indexOf("lifestyle")&&(l=re[a]),-1!==s.indexOf("www.yohobuy.com")&&"/"===window.location.pathname&&(l=re[n]),e=d.split(".")[0],"list"!==e&&"search"!==e&&"www"!==e&&"new"!==e&&"item"!==e&&"guang"!==e&&(l=re[o+de._Channel]),r(l)}function $(e){G(".hot-brands").find("ul").stop().animate({opacity:0,"z-index":1},200).eq(e).animate({opacity:1,"z-index":2},200)}function L(){var e,t=0;G(".hot-brands").size()>0&&(e=G(".hot-brands").find("ul").size(),G(".hot-brands").find("ul").eq(0).css({opacity:1,"z-index":2}),G(".brands-control").on("click",".next",function(){t===e-1?t=0:t++,$(t)}),G(".brands-control").on("click",".prev",function(){0===t?t=e-1:t--,$(t)}))}function z(){setInterval(_,2e3)}function O(){var e=G("#goodcartempwarpper"),t="";e&&e.html()&&(t=G("#goodcartempwarpper").html().replace(/\\/g,""),G("#goodcartempwarpper").html(t),W=Y.compile(G("#tmpl-my-login-new").html()))}function N(){var e="http://search.yohobuy.com/api/suggest";G("#query_key").search(e)}function B(e){var t=(new Date).getTime(),a='<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">请登录</a>]&nbsp;[<a href="http://www.yohobuy.com/reg.html" class="list-a login-out" onclick="">免费注册</a>]',n='<span>Hi~<a href="http://www.yohobuy.com/home?t='+t+'">{{user_name}}</a></span>&nbsp;{{#if islogin}}[<a href="{{logout}}" class="list-a login-out">退出</a>]{{/if}}{{#unless islogin}}[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out">请登录</a>]&nbsp;[<a href="http://www.yohobuy.com/reg.html" onclick="" class="list-a login-out">免费注册</a>]{{/unless}}',i=G("#loginBox"),o=window.cookie("_UID"),s=e.data.profile_name,r=0,d=0,l="",c=o.split("::"),u=c[0]||" ",h="http://www.yohobuy.com/logout_",p="1",f=0,m={user_name:s,logout:h+e.data.token+".html",random:Math.random()};if(J=Y.compile(n),"undefined"==typeof o||null===o)return i.html(a),!1;if("undefined"==typeof c||c.length<4)return i.html(a),!1;for(d;d<u.length;d++)l=u.substr(d,1),r+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1;if(10>=r)s=u;else{for(f=0,d;d<u.length;d++)10>f&&(l=u.substr(d,1),"*"!==l&&(f+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1),s+=l);s.length<u.length&&(s+="...")}h=/http:\/\//.test(c[3])?c[3].replace("www.yohobuy.com","www.yohobuy.com"):"http://www.yohobuy.com/logout_"+c[3]+".html",-1===e.result&&(p="-1"),m.islogin=p,i.html(J(m))}function M(e){var t=e.data,a="";if(1===e.result){if(void 0===typeof t||t.length<1)return!1;"3"===t.vip.curVipInfo.curLevel&&(t.vip3=!0),G("#myYohoBox").mouseenter(function(){return G(this).addClass("acttags"),G("#myYohoBox .myyoho-info").show().html(W(t)),a=G(".myyoho-photo img").attr("data-url"),1===G._checkUrlState?void G(".myyoho-photo").show().find("img").attr("src",a):void(""!==a&&""===G._checkUrl&&G.ajax({url:a,type:"GET",complete:function(e){(200===e.status||0===e.status)&&(G(".myyoho-photo").show().find("img").attr("src",a),G._checkUrlState=1),G._checkUrl=a}}))}),G("#myYohoBox").mouseleave(function(){G(this).removeClass("acttags"),G("#myYohoBox .myyoho-info").hide()})}}function F(){var e={method:"open.passport.get"};G.getData(Q,e,function(e){-1!==e.result?(B(e),M(e)):window.setCookie("_UID","",{path:"/",domain:".yohobuy.com",expires:-1})})}function U(){y(),b(),O(),C(),x(),k(),j(),o(),c(),l(),m(),P(),L(),S(),_(),z(),N(),E(),I(),A(),F(),i()}var R,H,G=e("jquery"),Y=e("handlebars"),X=e("index"),W=null,J=null,Q=G("#api-domain").val(),Z="",K=/^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/]{0,}$/g,V="",ee="",te=[],ae=null,ne=0,ie=G(".icon-logo"),oe=!0,se=500,re={listboys:"4f78b0f418fc42314d8b6e791cfb7fa8",listgirls:"00c1f025a51b6b597dc37925951ea27d",listkids:"b02df11184727701ade1b6de9737d08c",listlifestyle:"fd35c52dced0c880976ba858346d1fc5",searchboys:"9fb8986ea700cc27a8057361c3924394",searchgirls:"e3e207a1443ca60c8037fe52a5560c18",searchkids:"620fc77f479da8feaeb06f2324e5d0bb",searchlifestyle:"a3c93301c6ffaf3ed0f36a4a451be36d",uniquebrandboys:"2ebb0810c0d1a67e5229149c9c3aba7d",uniquebrandgirls:"99e23385f4ba4b65f406b7e2968ac821",uniquebrandkids:"a74ebc9b17840c91b9ea46568111fe6b",uniquebrandlifestyle:"0e8c81ead53f56302baa4d0ad967f527",brandsboys:"77b352db07129c76a9d532acad149f9f",brandsgirls:"bf047f16e52ebc38be5ce9c7623831e6",brandskids:"e3ae1ce9b5e13c6d271ef3eccb831652",brandslifestyle:"e4ac8029c30f65d7f1af030980d140fe",newboys:"869d3c5f3b450fb52101d00a61ce87cb",newgirls:"d953b6dfdac02483d1dcce8d96055954",newkids:"0874cb6d75df8e0e78f2d475e53ecc08",newlifestyle:"43e8fc8e178115c262bbce2bd0012db7",saleboys:"c846e3165c994769b4201d8c32f3ae9b",salegirls:"52b1d389edcbc62d65de71b80c4d6ad0",salekids:"ad8b1703c761ba00973868ab5199cc27",salelifestyle:"7acc64905c70ac91846f43fb2cec4bbd",homeboys:"b0856a771ef1b59ab1234c74688fa42d",homegirls:"2bd61fa12e4933211518f70fe5ce3c48",homekids:"895c59e8c64b40399c9533509507320c",homelifestyle:"2e037d4e25d2767352ca3e0a4627f7bd",indexboys:"0c911d3000f52e8ca7cffb74f5864c29",indexgirls:"b645b8980c423ab30485e0a9d08c2ef7",indexkids:"17f6d5d5d454d2c507bc5fcbc90f7756",indexlifestyle:"735cd393e841762af8793c346abbbc36"},de={},le="http://new.yohobuy.com/common/getbanner?content_code=";G("#api-domain").remove(),window.submitSearch=function(){var e,t,a=G("#query_key").val(),i=G("#defaultsearch").val(),o="Search",s="Head Search",r="Search";if(e=G.trim(V.toLowerCase()),t=G.trim(a.toLowerCase()),n(o,s,r),""!==ee&&""!==V&&e===t)location.href=ee.replace("'","");else{if(!K.test(a)||""===a)return""===a&&G("#query_key").val(i),G("#searchForm").submit(),!1;location.href="http://search.yohobuy.com/error?query="+a+"&result=error"}},Y.registerHelper("timestamp",function(){return(new Date).getTime()}),Y.registerHelper("headerimg",function(e){return""===e?"http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100":e}),Y.registerHelper("equallevelthree",function(e,t){return"3"===e?t.fn(this):t.inverse(this)}),Y.registerHelper("notzero",function(e,t){return"0"!==e?t.fn(this):t.inverse(this)}),window.JsonPCallBack=s,window.newArr=[],window.wrapperindex=0,window.gindex=0,window.targetArr1=[],window.targetArr2=[],window.targetArr3=[],window.oh1=0,window.oh2=0,window.oh3=0,window.valueIndex=0,window.nowIndex=0,window.inner1="",window.inner2="",window.inner3="",window.finalresult="",U()}),define("js/simple-header",["jquery"],function(e,t,a){function n(e){var t,a,n,i=0,o=0;for(n=0;n<e.length;n++)a=e.substr(n,1),o+=/.*[\u4e00-\u9fa5]+.*$/.test(a)?2:1;if(10>=o)t=e;else{for(i=0,t="",n=0;n<e.length;n++)10>i&&(a=e.substr(n,1),"*"!==a&&(i+=/.*[\u4e00-\u9fa5]+.*$/.test(a)?2:1),t+=a);t.length<e.length&&(t+="...")}return t}function i(e){var t,a,i=e.data;-1!==e.result?(a=n(i.profile_name),t='<span>Hi~</span><a href="http://www.yohobuy.com/home?t='+i.random+'">'+a+'</a>&nbsp;<a href="http://www.yohobuy.com/logout_'+i.token+'.html">[退出]</a>'):t='<span>Hi~</span>&nbsp;<a href="http://www.yohobuy.com/signin.html">[请登录]</a>&nbsp;<a href="http://www.yohobuy.com/reg.html">[免费注册]</a>',s(".header-tool li").eq(0).html(t)}function o(){var e={return_type:"jsonp",method:"open.passport.get"};s.getJSON(d+"/?callback=?",e,function(e){e&&e.data&&i(e.data)})}var s=e("jquery"),r=s("#api-domain"),d=r.val();r.remove(),s(".simple-header").size()>0&&s(".tool-options").on("mouseenter",function(){s(this).find(".tool-select").fadeIn()}).on("mouseleave",function(){s(this).find(".tool-select").fadeOut()}),o()}),define("js/product/entry",["jquery","handlebars","source-map","lazyload","index"],function(e,t,a){e("js/product/list"),e("js/product/brand"),e("js/product/hotrank"),e("js/product/item")}),define("js/product/list",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery");e("js/product/filter"),e("js/product/sort-pager"),e("js/product/latest-walk"),e("js/product/product"),function(){var e,t=n(".banner-img");0!==t.length&&(e=new Image,e.onload=function(){e.height&&t.height(e.height),e=null},e.src=t.css("background-image").replace(/"/g,"").slice(4,-1))}()}),define("js/product/filter",["jquery","handlebars","source-map"],function(e,t,a){function n(e,t){e.each(function(){v(this).closest(".attr").hasClass("checked")||v(this).removeClass("checked").html(y.unchecked)}),t.find(".checkbox").addClass("checked").html(y.checked)}function i(){w.addClass("hide"),x.removeClass("hide")}function o(){x.addClass("hide"),w.removeClass("hide"),q.children("span").removeClass("hover")}function s(e,t){var a,n=window.queryString();n[e]=t,delete n.page,a="?"+decodeURIComponent(v.param(n)),window.location.href=a}function r(e){E.children(".senior-sub:eq("+m+")").addClass("hide"),D.children(".attr:eq("+m+")").removeClass("hover"),m=-1}var d,l,c,u,h,p,f,m,v=e("jquery"),g=e("handlebars"),y={unchecked:"&#xe635;",checked:"&#xe636;"},b={up:"&#xe610;",down:"&#xe600;"},w=v(".brand .default"),C=v("#brand-search-input"),x=v(".brand .brand-panel"),k=x.find(".attr"),j=v("#brand-more"),_=v("#brand-multi"),q=v(".brands-index"),T=v(".ud-price-range"),I=/^\d+$/,A=v(".sort-sub-wrap"),E=v(".senior-sub-wrap"),D=v(".senior-attr-wrap"),S='{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',P={},$=v(".filter-box .size");S=g.compile(S),v(".filter-box").on("selectstart",".attr, .brands-index span",function(){return!1}),v(".sort-pre").on("click","li",function(){var e=v(this),t=e.index(),a=e.data("id");return e.hasClass("active")?(e.removeClass("active"),A.children(":eq("+t+")").addClass("hide"),void $.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),A.children(":not(.hide)").addClass("hide"),A.children(":eq("+t+")").removeClass("hide"),void($.data("load")||(P[a]?($.find(".attr-content").html(P[a]),$.removeClass("hide")):v.ajax({url:"/product/search/sortSize",data:{msort:a}}).then(function(e){"array"===v.type(e)&&e.length?(P[a]=S({size:e}),$.find(".attr-content").html(P[a]),$.removeClass("hide")):$.addClass("hide")}))))}),j.length>0&&(d=j.children("em"),l=j.children(".iconfont")),_.click(function(){"none"===x.css("display")&&j.trigger("click"),i(),x.removeClass("hide").addClass("multi"),v(this).addClass("hide"),j.addClass("hide")}),j.click(function(){var e=v(this);e.hasClass("more")?(o(),d.text("更多"),l.html(b.down),C.val("").trigger("keyup")):(i(),d.text("收起"),l.html(b.up)),v(this).toggleClass("more")}),q.on("mouseenter","span",function(){var e=v(this),t=e.data("index");e.hasClass("hover")||setTimeout(function(){e.siblings("span.hover").removeClass("hover"),e.addClass("hover"),0===e.index()?k.removeClass("hide"):k.addClass("hide").filter("[data-index="+t+"]").removeClass("hide")},120)}),C.keyup(function(){var e=v(this).val().toLowerCase();""===e?k.removeClass("hide"):k.addClass("hide").filter('[data-key*="'+e+'"]').removeClass("hide")}),v("#brand-multi-ok").click(function(){var e=[];v(this).hasClass("dis")||(x.find("span.checked").each(function(){e.push(v(this).data("id"))}),s("brand",e.join(",")))}),v(".multi-select-cancel").click(function(){var e=v(this).closest(".multi");e.hasClass("brand-panel")&&(_.removeClass("hide"),j.trigger("click"),j.removeClass("hide"),C.val("").trigger("keyup"),o()),e.addClass("hide").removeClass("multi"),n(e.find(".checkbox.checked"),e.find(".attr.checked")),v(this).siblings(".multi-select-ok").addClass("dis")}),v(".check-container").on("click",".attr",function(){var e=v(this),t=e.find(".checkbox"),a=e.closest(".brand-panel, .senior-sub").find(".multi-select-ok");t.toggleClass("checked"),t.hasClass("checked")?t.html(y.checked):t.html(y.unchecked),t.hasClass("checked")||e.siblings(".attr").find(".checked").length>0?a.removeClass("dis"):a.addClass("dis")}),v(".brand, .senior").on("click",".attr > a",function(e){v(this).closest(".multi").length>0&&e.preventDefault()}),v(".filter-box").on("click","li.checked, a.checked",function(e){e.preventDefault()}),T.length>0&&(c=T.find(".limit"),u=c.filter(".min"),h=c.filter(".max"),p=T.find(".price-sure"),c.keyup(function(){var e,t,a,n=v.trim(v(this).val()),i=I.test(n);i||(e=parseInt(n,10),v(this).val(isNaN(e)?"":e)),t=v.trim(u.val()),a=v.trim(h.val()),""!==t||""!==a?p.removeClass("hide"):p.addClass("hide")}),p.click(function(){var e,t=v.trim(u.val()),a=v.trim(h.val());""!==t&&""!==a&&+t>+a&&(e=a,a=t,t=e),s("price",t+","+a)})),D.on("mouseenter",".attr",function(){var e=v(this),t=e.index();e.hasClass("no-sub")||(e.addClass("hover").siblings().removeClass("hover"),E.children(".senior-sub:eq("+t+")").removeClass("hide").siblings().addClass("hide"))}).on("mouseleave",".attr",function(){
var e=v(this),t=e.index();e.hasClass("no-sub")||(m=t,f=setTimeout(function(){r()},100))}),v(".senior-sub").on("click",".multi-select",function(){v(this).closest(".senior-sub").addClass("multi")}).on("click",".multi-select-ok",function(){var e=v(this),t=e.closest(".senior-sub"),a=[];e.hasClass("dis")||(t.find("span.checked").each(function(){a.push(v(this).data("id"))}),s(t.data("attr"),a.join(",")))}).on("mouseenter",function(){clearTimeout(f)}).on("mouseleave",function(){r()})}),define("js/product/sort-pager",["jquery"],function(e,t,a){var n=e("jquery"),i=n("#count-per-page"),o=i.next("ul"),s=200;n(document).click(function(e){n(e.target).closest(".page-count").length>0||o&&o.slideUp(s)}),i.click(function(){"none"===o.css("display")?o.slideDown(s):o.slideUp(s)})}),define("js/product/latest-walk",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload"),s=n("#latest-walk-count");!function(){var e;0!==s.length&&(e=i.compile(n("#latest-walk-tpl").html()),n.ajax({url:"http://itemapi.yohobuy.com/item/item/recentreview",dataType:"jsonp",data:{limit:s.val()},success:function(t){var a,i,s,r=[];if(200===t.code){if(a=t.data,0===a.length)return void n(".latest-walk").addClass("hide");for(i=0;i<a.length;i++)s=a[i],r.push({href:s.url,img:s.pic_url,name:s.product_name,salePrice:s.price,marketPrice:s.market_price});r.length>0&&(n("#latest-walk-goods").html(e({latestWalk:r})),o(n("#latest-walk-goods .lazy")))}}}))}()}),define("js/product/product",["jquery","lazyload","handlebars","source-map"],function(e,t,a){var n,i=e("jquery"),o=e("lazyload"),s=e("handlebars"),r=e("js/common/product-event"),d=i(".goods-container"),l=d.find(".good-info"),c=d.find(".good-item-wrapper"),u=d.find(".good-info-main"),h=d.find(".good-select-color"),p=i(".product-list-nav");o(i("img.lazy")),t.init=function(e){function t(e,t){var a,n,i,o="",s=e.length,r=4,d=Math.ceil(s/r),l=0;for(a=0;d>a;a++)for(o+="<ul>",n=0;r>n&&(i=a*r+n,i!==s);n++)o+='<li><a target="_blank" href="'+e[a*r+n].url+t+'"><img src="'+e[a*r+n].src+'" data-cover="'+e[a*r+n].coverImg+'" /></a></li>',n===r-1&&(o+="</ul>",l++);return d>l&&(o+="</ul>"),{colorListStr:o,ulNum:d}}function a(){u.html(""),h.html(""),c.css({display:"none"})}n=null,l.unbind(),n=r(l,e),n.addHandler("MouseEnter",function(e){var n,o,s,r,l,p,f,m,v=10,g=35,y="",b=e.target.attr("data-from")||"";i.ajax({type:"POST",url:"/product/list/getProductPic",dataType:"jsonp",jsonp:"callback",data:{skn:e.target.attr("data-skn"),skc:e.target.attr("data-skc")}}).then(function(w){var C=w.data,x=t(C.pics,b);a(),y=x.colorListStr,n=x.ulNum,u.append(e.targetDuplicate),h.append(i(y)),p=c.css("paddingLeft"),f=c.css("paddingTop"),m=d.css("paddingTop"),o=10+65*n+e.targetWidth,r=(e.targetX-1)*(e.targetWidth+v)-(parseInt(p)+1),l=(e.targetY-1)*(e.targetHeight+g)+parseInt(m)-(parseInt(f)+1),s=e.offsetR-(65*n+25),0>=s&&(r=r+s-25),c.css({width:o,left:r,top:l,display:"inline-block"}),C.pics[0]&&C.pics[0].src&&u.find(".good-thumb img").attr("src",C.pics[0].src)})}),n.addHandler("MouseLeave",function(){a()}),c.mouseleave(function(){a()})},i(document).on("hover",".good-select-color li",function(){var e=i(this).find("img").attr("data-cover"),t=i(this).closest(".good-item-wrapper").find(".good-detail-img").find("img");t.attr("src",e)}),p.find("h3").click(function(e){var t=i(this).closest(".product-list-nav");t.hasClass("active")?t.find(".sort-child-list").stop(!0,!0).slideUp():t.find(".sort-child-list").stop(!0,!0).slideDown(),t.toggleClass("active")}),function(){var e,t=i("#brand-card"),a=i("#brand-favor");t.length&&i.ajax({type:"POST",url:"/product/index/getNodeContent",data:{node:t.data("node")}}).then(function(e){t.html(e)}),a.length&&(e=i("#pic-link-tpl").html(),i.ajax({type:"POST",url:"/product/index/getAdnav",data:{brandId:a.data("id")}}).then(function(t){t&&i("#brand-ad").html(s.compile(e)({picLink:t}))}))}()}),define("js/common/product-event",["jquery"],function(e,t,a){function n(){this.handlers={}}var i=e("jquery");n.prototype={constructor:n,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,a;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],a=0;a<t.length;a++)t[a](e)},removeHandler:function(e,t){var a,n;if(this.handlers[e]instanceof Array){for(a=this.handlers[e],n=0;n<a.length&&a[n]!==t;n++);a.splice(n,1)}}},a.exports=function(e,t){function a(e){var a,n=0,u=0,h=t,p=0,f="",m=0,v=0;switch(e.type){case"mouseenter":a=i(this),o=setTimeout(function(){s=!0,f=a.clone(),p=a.index()+1,n=p%h===0?h:p%h,u=Math.ceil(p/h),m=a.offset().left,v=c-(m+d),r.fire({type:"MouseEnter",target:a,targetWidth:d,targetHeight:l,targetX:n,targetY:u,rowWidth:h,activeIndex:p,targetDuplicate:f,offsetL:m,offsetR:v})},150);break;case"mouseleave":s||(o&&clearTimeout(o),r.fire({type:"MouseLeave"})),s=!1}}var o,s,r=new n,d=e.eq(0).width(),l=e.eq(0).height(),c=i(window).width();return e.bind({mouseenter:a,mouseleave:a}),r}}),define("js/product/brand",["jquery"],function(e,t,a){var n=e("jquery"),i=n("#brand-favor"),o=i.data("id");i.on("click",function(){n.ajax({type:"post",url:"/product/index/favoriteBrand",data:{brandId:o}}).then(function(e){200===e.code?"add"===e.message?i.find("i").addClass("coled"):i.find("i").removeClass("coled"):403===e.code&&(location.href="http://www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})}),n.ajax({type:"POST",url:"/product/index/isFavoriteBrand",data:{brandId:o}}).then(function(e){200===e.code?i.find("i").addClass("coled"):404===e.code&&i.find("i").removeClass("coled")})}),define("js/product/hotrank",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload");e("js/common/slider"),e("js/common/logo-brand"),o(n("img.lazy")),n(".slide-container").slider(),n(".logo-brand").logoBrand({showNum:10,url:n(".logo-brand").data("url")}),function(e){function t(t,a){var d={};d=a?{sid:t,page:a}:{sid:t},e.ajax({type:"GET",dataType:"json",url:"/product/index/getdata",data:d,success:function(t){var d;200===t.code&&(d={list:t.data},s=i.compile(n),a?(e(".hot-week-list").append(s(d)),r.css({position:"fixed",marginTop:-r.height()/2,top:"50%"})):e(".hot-week-list").html(s(d)),o(e("img.lazy")),c=!1)}})}var a,n,s,r=e(".hot-week").find(".floatlayer"),d=(e(".hot-cate").find("li").eq(0).data("sid"),1),l=0,c=!1;n='{{# list}}<div class="good-info"><div class="item-img"><a class="good-thumb" target="_blank" href="{{url}}"><img class="lazy" data-original="{{thumb}}"></a></div><div class="good-detail-text"><a target="_blank" href="{{url}}">{{name}}</a><p class="price">{{# marketPrice}}<span class="market-price">¥{{.}}</span>{{/ marketPrice}} <span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">¥{{salePrice}}</span></p></div></div>{{/ list}}',e(window).on("scroll",function(){var n,i=a+e(".hot-week").outerHeight();a=e(".hot-week").offset().top,e(this).scrollTop()>=a-e(window).height()/2?r.offset().top+r.outerHeight()>=i?r.css({position:"absolute",marginTop:0,top:e(".hot-week").outerHeight()-r.outerHeight()}):r.css({marginTop:-r.height()/2}).stop().animate({opacity:1},200,function(){r.show()}):r.stop().animate({opacity:0},200,function(){r.hide()}),r.offset().top>=e(this).scrollTop()+(e(window).height()-r.outerHeight())/2&&r.css({position:"fixed",marginTop:-r.height()/2,top:"50%"}),e(this).scrollTop()>=a+e(".hot-week").height()-e(window).height()&&(c||(n=e(".hot-cate").find("li.current").data("sid"),d++,c=!0,t(n,d)))}),e(".hot-cate").find("li").each(function(t){var a=e(".hot-cate").width();a>=l&&(l+=e(this).width(),l>=a&&e(".floatlayer").find("li").eq(t).hide().nextAll().hide())}),e(".hot-cate").on("click","li",function(){var n=e(this).index(),i=e(this).data("sid");e(this).hasClass("current")||(e(this).addClass("current").siblings().removeClass("current"),e(".floatlayer").find("li").removeClass("current").eq(n).addClass("current"),e("body,html").stop().animate({scrollTop:a-110},500),t(i),d=1)}),e(".floatlayer").on("click","li",function(){var t=e(this).index();e(this).hasClass("current")||(e(".hot-cate").find("li").eq(t).trigger("click"),e(this).addClass("current").siblings().removeClass("current"),e(".hot-cate").find("li").removeClass("current").eq(t).addClass("current"))}),e(".hot-cate").find("li").eq(0).addClass("current"),e(".floatlayer").find("li").eq(0).addClass("current")}(n)}),define("js/common/slider",["jquery","lazyload"],function(e,t,a){var n=e("jquery"),i=e("lazyload");!function(e){var t=function(t,a){this.$element=e(t),this.options=e.extend({},e.fn.slider.defaults,a),this.bigItem=this.$element.find(".slide-wrapper").find("li"),this.smallItem=null,this.len=this.bigItem.size(),this.index=0,this.timer=null,this.init()};t.prototype={init:function(){if(this.$element){if(this.len<=1)return void i(this.$element.find("img.lazy"));this.options.pagination?this.smallItem=e(this.options.pagination).find("li"):this._createPage(),this.options.orient&&this._createOrient(),this._slideShow(),this._bindEvent(),this._autoplay()}},_createOrient:function(){var e='<div class="slide-switch"><a class="prev" href="javascript:;"><span class="iconfont">&#xe60c;</span></a><a class="next" href="javascript:;"><span class="iconfont">&#xe60b;</span></a></div>';this.$element.find(".slide-switch").length>0||this.$element.append(e)},_createPage:function(){var t='<div class="slide-pagination"><div class="slide-pagination-inner"><div class="slide-shade"></div><div class="slide-pagination-last">',a=0;if(!(this.len<=1)){for(a=0;a<this.len;a++)t+="<span></span>";t+="</div></div></div>",this.$element.append(e(t)),this.smallItem=this.$element.find(".slide-pagination-inner span")}},_bindEvent:function(){var t=this;this.$element.find(".slide-switch").on("click",".next",function(){t._nextSlide(),clearInterval(t.timer),t.timer=setInterval(function(){t._nextSlide()},t.options.time)}).on("click",".prev",function(){t._prevSlide(),clearInterval(t.timer),t.timer=setInterval(function(){t._nextSlide()},t.options.time)}),this.smallItem.on("mouseenter",function(){t.index=e(this).index(),clearInterval(t.timer),t._slideShow()}).on("mouseleave",function(){t._autoplay()}),this.$element.on("mouseenter",function(){e(this).find(".slide-switch").addClass("show")}).on("mouseleave",function(){e(this).find(".slide-switch").removeClass("show")})},_nextSlide:function(){this.index===this.len-1?this.index=0:this.index++,this._slideShow()},_prevSlide:function(){0===this.index?this.index=this.len-1:this.index--,this._slideShow()},_slideShow:function(){var t=this.bigItem.eq(this.index).find("img.lazy");t.attr("src")!==t.data("original")&&(i(t,{event:"sporty"}),t.trigger("sporty")),this.smallItem.eq(this.index).addClass("focus").siblings().removeClass("focus"),this.bigItem.eq(this.index).show().stop().animate({opacity:1},function(){e(this).find(".slide-tips > p").removeClass("hide")}).siblings().stop().animate({opacity:0},function(){e(this).hide().find(".slide-tips > p").addClass("hide")})},_autoplay:function(){var e=this;clearInterval(this.timer),this.timer=setInterval(function(){e._nextSlide()},this.options.time)}},e.fn.slider=function(a){return this.each(function(){var n=e(this),i=n.data("Slider"),o="object"==typeof a&&a;i||n.data("Slider",i=new t(this,o)),"string"==typeof a&&i[a]()})},e.fn.slider.Constructor=t,e.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(n)}),define("js/common/logo-brand",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload");!function(e){var t=function(t,a){this.$element=e(t),this.options=e.extend({},e.fn.logoBrand.defaults,a),this.init()};t.prototype={init:function(){this.$element.addClass("logos-"+this.options.showNum),this._sendRequest()},_createHelper:function(){var e=this.options.showNum;i.registerHelper("brandList",function(t,a){var n="<ul>",i=0,o=null,s=0;if(t.length%e!==0)for(s=e-t.length%e,i=0;s>i;i++)t.push({href:"javascript:;",img:""});for(i=0;i<t.length;i++)o=a.fn(t[i]),n=i%e===5||5===i?n+'<li class="logo-brand-switch" data-page="'+Math.floor(i/e)+'"><a class="prev iconfont" href="javascript:;">&#xe60f;</a><a class="next iconfont" href="javascript:;">&#xe60e;</a></li><li data-page="'+Math.floor(i/e)+'">'+o+"</li>":0!==i&&i%e===0?n+'<li class="brand-more" data-page="'+Math.floor(i/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li><li data-page="'+Math.floor(i/e)+'">'+o+"</li>":n+'<li data-page="'+Math.floor(i/e)+'">'+o+"</li>";return n+'<li class="brand-more" data-page="'+Math.floor(i/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li></ul>'})},_sendRequest:function(){var t=this;e.ajax({type:"GET",url:t.options.url,dataType:"json",success:function(e){var a,n;e&&0!==e.length&&(t._createHelper(),n='{{#brandList logoBrand}}<a href="{{href}}" target="_blank"><img class="lazy" data-original="{{img}}" alt=""></a>{{/brandList}}',a=i.compile(n),t.$element.html(a(e)),t.$element.find(".brand-more a").attr("href",e.moreBrand),o(t.$element.find("img.lazy")),t._bindEvent())}})},_brandShow:function(t,a){var n=this;o(e("li[data-page="+a+"]").find("img.lazy").trigger("appear")),n.$element.find("li[data-page="+t+"]").find("img").fadeOut("normal",function(){n.$element.find("li").hide(),n.$element.find("li[data-page="+a+"]").show().find("img").fadeIn()})},_bindEvent:function(){var t=this;t.$element.on("click",".next",function(){var a=e(this).parent().data("page"),n=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;n=a===i?0:a+1,t._brandShow(a,n)}),t.$element.on("click",".prev",function(){var a=e(this).parent().data("page"),n=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;n=0===a?i:a-1,t._brandShow(a,n)})}},e.fn.logoBrand=function(a){return this.each(function(){var n=e(this),i=n.data("LogoBrand"),o="object"==typeof a&&a;i||n.data("LogoBrand",i=new t(this,o)),"string"==typeof a&&i[a]()})},e.fn.logoBrand.Constructor=t,e.fn.logoBrand.defaults={showNum:16,url:"/boys/getBrand"}}(n)}),define("js/product/item",["jquery","lazyload","handlebars","source-map","index"],function(e,t,a){function n(e){h.attr("src",e)}function i(){return+y.text()}function o(){y.text("1"),1===A||0===A?(b.addClass("dis"),w.addClass("dis")):(b.removeClass("dis"),w.addClass("dis"))}function s(e){0!==j.length&&(0===A||e&&0===~~e.data("total")?(j.addClass("hide"),x.removeClass("hide")):(j.removeClass("hide"),x.addClass("hide")))}function r(){m.not(".hide").children(".size-warn").removeClass("hide")}var d=e("jquery"),l=e("lazyload"),c=e("handlebars"),u=e("index"),h=d("#img-show"),p=d("#thumbs > .thumb-wrap"),f=d("#sizes"),m=f.children(".size"),v=f.find(".size-warn"),g=f.children(".color-size-tip"),y=d("#num"),b=d("#plus-num"),w=d("#minus-num"),C=d("#add-to-cart"),x=d("#sold-out"),k=d(".lc-container"),j=d(".item-buy"),_=d("#desc-color"),q={},T=d(".main"),I=T.data("id"),A=-1,E=200,D={def:"收藏商品",coled:"已收藏",hover:"取消收藏"},S=e("js/common/dialog").Alert;e("js/product/latest-walk"),e("js/common/share"),function(){var e,t=d("#size-title-json"),a=t.html();""!==a&&(e=u.parse(a),t.remove(),m.children("li").each(function(){var t=d(this),a=t.data("name");t.data("title",e[a])}))}(),q[d(".colors .focus").index()]=!0,d("#brand-favour").click(function(){var e=d(this);d.ajax({type:"POST",url:"/product/index/favoriteBrand",data:{brandId:e.data("id")}}).then(function(t){200===t.code?e.toggleClass("coled"):403===t.code&&(location.href=t.data.url)})}),d(".colors").on("click","li",function(){var e,t=d(this),a=t.index();g.addClass("hide"),v.addClass("hide"),A=-1,t.hasClass("focus")?m.eq(a).children("li").removeClass("focus"):(t.siblings(".focus").removeClass("focus"),t.addClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(a).removeClass("hide").find("img"),"undefined"==typeof q[a]&&(l(e,{event:"sporty"}),e.trigger("sporty"),q[a]=!0),n(e.first().data("shower")),_.text(t.data("color")),m.not(".hide").addClass("hide").children("li").removeClass("focus"),m.eq(a).removeClass("hide")),o(),s(t)}),d("#thumbs").on("mouseenter",".thumb",function(){n(d(this).data("shower"))}),f.on("click","li",function(){var e=d(this);e.hasClass("focus")||(A=+e.data("num"),e.siblings(".focus").removeClass("focus"),e.addClass("focus"),g.html(e.data("title")).removeClass("hide"),v.addClass("hide"),s(),o())}).on("click",".size-ruler",function(){d("body,html").animate({scrollTop:d(".size-info").offset().top},300)}),b.click(function(){var e=i();if(!d(this).hasClass("dis"))return-1===A?void r():void(0!==A&&(e===A-1&&d(this).addClass("dis"),1===e&&w.removeClass("dis"),y.text(e+1>A?A:e+1)))}).on("selectstart",function(){return!1}),w.click(function(){var e=i();d(this).hasClass("dis")||(2===e&&d(this).addClass("dis"),e===A&&b.removeClass("dis"),y.text(0>e-1?0:e-1))}).on("selectstart",function(){return!1}),d(".get-lc:not(.dis)").hover(function(){k.removeClass("hide")},function(){k.addClass("hide")}),C.click(function(){return-1===A?void r():void d.ajax({type:"POST",url:"/cart/index/add",data:{productSku:d(".size:not(.hide) li.focus").data("sku"),buyNumber:i()}}).then(function(e){var t=e.code;200===t&&(d("#type-chose").slideUp(E),d("#balance").slideDown(E),d("#cart-num").text(e.data.goods_count))})}),d("#collect-product").click(function(){var e,t=d(this);t.hasClass("coled")&&(e=!0),d.ajax({type:"POST",url:"/product/item/togglecollect",data:{productId:I,type:e?"cancel":"add"}}).then(function(a){var n=a.code;200===n?(t.toggleClass("coled"),e?t.find("em").text(D.def):t.find("em").text(D.coled)):403===n&&(location.href=a.data.url)})}).hover(function(){var e=d(this);e.hasClass("coled")&&e.find("em").text(D.hover)},function(){var e=d(this);e.hasClass("coled")&&e.find("em").text(D.coled)}),d("#keep-shopping").click(function(){d("#type-chose").slideDown(E),d("#balance").slideUp(E)}),d("#buy-now").click(function(){var e,t,a;if(-1===A)return void r();if(!d(this).hasClass("dis")){if(t=d(this).data("base"),!t)return a=new S("打开APP可抢购该商品哦~~"),void a.show();e=m.find(".focus").data("sku"),e&&t&&(location.href=t+"?product_sku="+e)}}),d(".buy-btn").mouseover(function(){d(this).hasClass("dis")||d(this).addClass("hover")}).mouseleave(function(){d(this).removeClass("hover")}),d(".description-material").on("click",".title",function(){var e=d(this),t=e.index(),a=d(".description-content"),n=d(".material-content");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(a.slideDown(E),n.slideUp(E)):(a.slideUp(E),n.slideDown(E)))}),d(".after-service-switch").click(function(){var e=d(this),t=e.next(".after-service-content"),a={def:"&#xe604;",spread:"&#xe603;"};"none"===t.css("display")?(t.slideDown(E),e.find(".triangle").html(a.spread)):(t.slideUp(E),e.find(".triangle").html(a.def))}),d.ajax({type:"GET",url:"/product/item/hotarea",data:{productId:I}}).then(function(e){d("#details-html").prepend(e),d(".hot-point-wrap > img").load(function(){d(this).parent(".hot-point-wrap").width(d(this).width())}),d(".hot-point").hover(function(){d(this).addClass("hover")},function(){d(this).removeClass("hover")})}),l(d("#details-html img")),function(){var e,t=!0;for(e=0;e<m.length;e++)if(1!==m.eq(e).find("li").length){t=!1;break}t&&m.eq(d(".colors .focus").index()).find("li").click()}(),function(){function e(){a||(a=!0,d.ajax({type:"GET",url:"/product/item/comments",data:{productId:I,page:i}}).then(function(e){var t;if(200===e.code){if(t=e.data,0===t.length)return void l.next(".more-wrap").addClass("hide");h.text(t[0].total),l.append(s({comments:t})),i++}}).always(function(){a=!1}))}function t(){n||(n=!0,d.ajax({type:"GET",url:"/product/item/consults",data:{productId:I,page:o}}).then(function(e){var t;if(200===e.code){if(t=e.data,0===t.length)return void u.next(".more-wrap").addClass("hide");p.text(t[0].total),u.append(r({consults:t})),o++}}).always(function(){n=!1}))}var a,n,i=1,o=1,s=c.compile(d("#comments-tpl").html()),r=c.compile(d("#consults-tpl").html()),l=d("#comments-ul"),u=d("#consults-ul"),h=d(".comment-num"),p=d(".consult-num");d(".consult-comment").on("click",".title",function(){var e=d(this),t=e.index(),a=d(".comments"),n=d(".consults");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(n.slideDown(E),a.slideUp(E)):(n.slideUp(E),a.slideDown(E)))}).on("click",".load-more",function(){var a=d(this);a.hasClass("load-more-comments")?e():t()}),d("#consults-btn").click(function(){d(".new-consult").removeClass("hide"),d(".consult-success").addClass("hide")}),d("#submit-consult").click(function(){var e=d(this),t=e.closest(".new-consult"),a=t.find(".my-consult"),n=d.trim(a.val()),i=t.find(".consult-warn"),o=!0;""===n?(a.addClass("error"),i.removeClass("hide"),o=!1):(a.removeClass("error"),i.addClass("hide")),o!==!1&&d.ajax({type:"POST",url:"/product/item/addconsult",data:{productId:I,content:n}}).then(function(e){var n=e.code;200===n?(t.addClass("hide"),t.siblings(".consult-success").removeClass("hide"),a.val("")):403===n&&(location.href=e.data.url)})}),e(),t()}()}),define("js/common/dialog",["jquery","handlebars","source-map"],function(e,t,a){function n(){return 0===d(".body-mask").length&&d("body").append('<div class="body-mask hide"></div>'),d(".body-mask").css({height:d(document).height(),width:d(document).width()})}function i(e){return d("body").append(h(e)),d(".yoho-dialog")}function o(e){function t(e){s.$el.find("#dialog-"+o.btns[e].id).on("click",function(){o.btns[e].cb&&o.btns[e].cb()})}var a,o=d.extend({},c,e),s=this;if(o.inherit)return this;if(o.mask&&(s.$mask=n()),s.$el=i(o),s.$el.find(".close").click(function(){s.close()}),o.btns)for(a=0;a<o.btns.length;a++)t(a)}function s(e){var t=this,a={content:e,className:"alert-dialog",btns:[{id:"alert-sure",btnClass:["alert-sure"],name:"确定",cb:function(){t.close()}}]};o.call(this,a)}function r(e){var t=this,a={content:e.content,className:"confirm-dialog",btns:[{id:"confirm-sure",btnClass:["confirm-sure"],name:"确定",cb:e.cb},{id:"confirm-cancel",btnClass:["confirm-cancel"],name:"取消",cb:function(){t.close()}}]};o.call(this,a)}var d=e("jquery"),l=e("handlebars"),c={mask:!0,closeIcon:!0},u='<div class="yoho-dialog {{className}} hide">{{#if closeIcon}}<span class="close"><i class="iconfont">&#xe602;</i></span>{{/if}}<div class="content">{{{content}}}</div><div class="btns">{{# btns}}<span {{#if id}}id="dialog-{{id}}"{{/if}} class="btn{{#each btnClass}} {{.}}{{/each}}">{{name}}</span>{{/ btns}}</div></div>',h=l.compile(u);o.prototype.close=function(){this.$mask&&this.$mask.addClass("hide"),this.$el.remove()},o.prototype.show=function(){this.$mask&&this.$mask.removeClass("hide"),this.$el.removeClass("hide").css({"margin-top":-this.$el.height()/2,"margin-left":-this.$el.width()/2})},t.Dialog=o,s.prototype=new o({inherit:!0}),s.prototype.constructor=s,t.Alert=s,r.prototype=new o({inherit:!0}),r.prototype.constructor=r,t.Confirm=r}),define("js/common/share",["jquery"],function(e,t,a){function n(e){var t,a="",n={title:"",url:window.location.href,weixinUrl:"",image:"",desc:"",channel:""},i=["weibo","tweibo","qzone","renren","qq","douban","weixin"],s="<em><i></i></em>";if(n=o.extend(n,e),-1===o.inArray(n.channel,i))return alert("不存在的分享平台!"),!1;switch(n.channel){case"weibo":a="http://service.weibo.com/share/share.php?url="+n.url+"&title="+n.title+"&appkey=3739328910&searchPic=true&pic="+n.image;break;case"tweibo":a="http://share.v.t.qq.com/index.php?c=share&a=index&url="+n.url+"&title="+n.title+"&appkey=c0af9c29e0900813028c2ccb42021792&pic="+n.image;break;case"qzone":a="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+n.url+"&title="+n.title+"&desc=&summary="+n.desc+"&site=YOHO!有货&pics="+n.image;break;case"renren":a="http://widget.renren.com/dialog/share?resourceUrl="+n.url+"&srcUrl="+n.url+"&desc="+n.desc+"&title="+n.title+"&description="+n.desc+"&pic="+n.image;break;case"qq":a="http://connect.qq.com/widget/shareqq/index.html?url="+n.url+"&desc="+n.desc+"&title="+n.title.replace("%","")+"&desc=&summary="+n.desc+"&site=YOHO!有货&pics="+n.image;break;case"weixin":a="http://s.jiathis.com/qrcode.php?url="+n.weixinUrl+"&desc="+n.desc+"&title="+n.title+"&description="+n.desc+"&pic="+n.image;break;case"douban":a="http://www.douban.com/share/service?href="+n.url+"&text="+n.desc+"&image="+n.image+"&title="+n.title+"&comment="}if("weixin"===n.channel){if(!n.self)return;t=n.self.closest(".share-to").find(".weixin-share-box"),t.length>0&&(s+='<div class="con"><h2>分享到微信朋友圈</h2><p class="pic"><img src="'+a+'" /></p><p class="w">打开微信,点击底部得“发现”,使用<br/>“扫一扫“即可将网页分享到我的朋友圈。</p><a href="javascript:void(0)" class="close">x</a></div>',t.find("div").length>0?t.show():t.html(s).show(),t.find(".close").click(function(){o(this).closest(".weixin-share-box").hide()}))}else window.open(encodeURI(a))}function i(e,t){var a=document.title.replace(/(^\s*)|(\s*$)/g,""),i=o("#share-desc").val(),s=o("#share-img").val(),r=o("#weixin-url").val();n("weibo"===e||"tqq"===e?{channel:e,title:a,image:s}:{channel:e,title:a,desc:i,image:s,self:t,weixinUrl:r})}var o=e("jquery");o(".share-wrapper").on("click","i",function(){var e=o(this),t=e.data("type");"weixin"===t?i(t,e):i(t)})}),define("js/index/index",["jquery","lazyload","handlebars","source-map"],function(e,t,a){var n=e("jquery"),i=e("lazyload"),o=n(".home-page").data("page"),s=n(".logo-brand").data("url");e("js/common/slider"),e("js/common/slider2"),e("js/common/logo-brand"),e("js/common/accordion"),n(document).on("mouseenter",".imgopacity a img",function(){n(this).css("opacity",.8)}),n(document).on("mouseout",".imgopacity a img",function(){n(this).css("opacity",1)}),n.inArray(o,["boys","girls","kids","lifestyle"])>-1&&(e("js/common/new-arrivls")({type:o,url:"/common/getNewArrival",count:"boys"===o||"lifestyle"===o?5:4,rows:[5,3]}),window.setCookie("_Channel",o,{domain:".yohobuy.com",path:"/",expires:365})),i(n("img.lazy")),"boys"===o?n(".slide-container").slider({pagination:".thumb-pagination"}):(n(".center-col").slider(),n(".slide-container").slider()),"boys"===o?(n(".logo-brand").logoBrand({url:s}),n(".img-brand").slider2()):(n(".logo-brand").logoBrand({showNum:10,url:s}),n(".img-slider-wrapper").slider2())}),define("js/common/slider2",["jquery"],function(e,t,a){var n=e("jquery");!function(e){e.fn.slider2=function(t){function a(t,a,i){i===!0?(e(".next").trigger("click"),t===a-3?n(--t,a,!1):n(++t,a,!0)):(e(".prev").trigger("click"),0===t?n(++t,a,!0):n(--t,a,!1))}function n(t,n,i){window.setTimeout(a,e.fn.slider2.defaults.delaytime,t,n,i)}function i(t,a,n){var i=-(t*a);e(".img-list").animate({"margin-left":i+"px"},"slow",n)}return e.fn.slider2.defaults={index:0,shownum:3,autoplay:!1,delaytime:3e3},this.each(function(){var a=e.extend({},e.fn.slider2.defaults,t),o=parseInt(e(".img-item").css("margin-right")),s=e(".img-item"),r=[],d=s.outerWidth()+o,l=s.length,c=0;if(3>=l)return void e(this).find(".img-brand-switch").hide();for(c=0;c<s.length;c++)r.push(s[c]);l=r.length,e(this).find(".img-list").css({width:d*l}),e(this).find(".next").on("click",function(t){var a=0,n=null;t.preventDefault(),i(3,d,function(){for(a=0;3>a;a++)n=r.shift(),e(".img-item").parent().append(n.outerHTML),r.push(n);e(".img-item").first().remove(),e(".img-item").first().remove(),e(".img-item").first().remove(),e(".img-list").css({"margin-left":"0"})})}),e(this).find(".prev").on("click",function(t){var a=0,n=null,o="";for(t.preventDefault(),a=0;3>a;a++)n=r.pop(),e(".img-item").parent().prepend(n.outerHTML),r.unshift(n);o=3*d,e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-list").css({"margin-left":-o+"px"}),i(0,d)}),a.autoplay===!0&&n(a.index,l,!0)})}}(n)}),define("js/common/accordion",["jquery"],function(e,t,a){function n(e){d.each(function(t){s(this).css("zIndex",t),e>=t?s(this).stop().animate({left:t*c},400):s(this).stop().animate({left:e*c+l+c*(t-e-1)},400)})}var i,o=e("js/common/yohoui/YH.slide"),s=e("jquery"),r=s(".slide-accordion"),d=r.find("li"),l=d.width(),c=1150===parseInt(s(".home-page").width())?125:107;n(0),i=new o({length:5,loop:!1,auto:!1,timeout:2,index:0}),i.on("change",function(e){n(e.to)}),d.mouseover(function(){i.go(s(this).index())}),i.init()}),define("js/common/yohoui/YH.slide",[],function(e,t,a){var n=e("js/common/yohoui/YH.base"),i=function(e){this.__lastTime=null,this.__isStop=!1,e=n.extend(this.defaults,e),i.superclass.constructor.call(this,e)};n.inherit(i,n.assembly),i.prototype.oninit=function(){var e=this,t=e.options;return t.auto&&e.play(),e.go(t.index),this},i.prototype.go=function(e,t){var a,n,i,o,s,r,d,l,c=this,u=c.options;c.__lastTime&&(clearTimeout(c.__lastTime),c.__lastTime=null),t="undefined"==typeof t?u.index:t,a=e===t?0:e>t?1:-1,n=u.loop,o=u.length-1,s=e,e=n?e>o?e-o-1:0>e?e+o+1:e:e>o?o:0>e?0:e,i=u.index=e,r={from:t,to:e,originalto:s,direction:a};for(d in c.registerEvent)if(c.registerEvent[d].length>0)for(l in c.registerEvent[d])c.registerEvent[d].hasOwnProperty(l)&&c.registerEvent[d][l](r);i!==o||e?!c.__isStop&&u.auto&&c.play():c.__lastTime&&clearTimeout(c.__lastTime)},i.prototype.play=function(){var e=this,t=e.options;return e.__lastTime=setTimeout(function(){e.next()},1e3*t.timeout),this},i.prototype.next=function(){var e=this,t=e.options,a=t.index,n=a+t.step;e.go(n,a)},i.prototype.prev=function(){var e=this,t=e.options,a=t.index,n=a-t.step;e.go(n,a)},i.prototype.pause=function(){var e=this;e.__lastTime&&clearTimeout(e.__lastTime),e.__isStop=!0},i.prototype.resume=function(){var e=this;e.__isStop=!1,e.play()},i.prototype.defaults={index:0,timeout:5,step:1,per:1,auto:!1,loop:!1},a.exports=i}),define("js/common/yohoui/YH.base",[],function(e,t,a){var n,i={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object String]":"string"},o={__Index:0,list:[],get:function(e){return void 0===e?this.list:this.list[e]},fn:function(){},inherit:function(e,t){var a=o.fn;a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e,e.superclass=t.prototype,e.prototype.constructor===Object.prototype.constructor&&(e.prototype.constructor=t)},extend:function(e,t){var a;for(a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e},copy:function(e,t,a){var n,i,s;if("object"!=typeof t)return t;if(n=t.valueOf(),t!==n)return new t.constructor(n);if(t instanceof t.constructor&&t.constructor!==Object){i=e?new e:o.clone(t.constructor.prototype);for(s in t)(e||t.hasOwnProperty(s))&&(i[s]=t[s])}else{i={};for(s in t)i.hasOwnProperty(s)&&(i[s]=t[s])}if(a)for(s in a)i.hasOwnProperty(s)&&(i[s]=a[s]);return i},clone:function(e){return o.__cloneFunc.prototype=e,new o.__cloneFunc},__cloneFunc:function(){},delegate:function(e,t){var a;return t=t||window,arguments.length>2?(a=Array.prototype.slice.call(arguments,2),function(){return e.apply(t,a)}):function(){return e.call(t)}},dom:function(e,t){var a,n,i=e,o={wrap:i},s=i[0].getElementsByTagName("*"),r=s.length;for(n=0;r>n;n++)a=s[n].className,a.indexOf(t)>-1&&(a=a.split(t)[1]),a&&(o[a]=i.find(s[n]));return o},template:function(){var e,t,a,n,i=arguments;if(i.length>0&&o.isString(i[0]))if(e=i[0],2===i.length&&o.isObject(i[1]))for(t in i[1])void 0!==i[1][t]&&(a=new RegExp("({"+t+"})","g"),e=e.replace(a,i[1][t]));else for(n=1;n<i.length;n++)void 0!==i[n]&&(a=new RegExp("({["+(n-1)+"]})","g"),e=e.replace(a,i[n]));return e},__type:function(e){return null==e?String(e):i[Object.prototype.toString.call(e)]||"object"},isObject:function(e){return this.isFunction(e)||!(!e||"object"!=typeof e)},isFunction:function(e){return"function"===this.__type(e)},isArray:Array.isArray||function(e){return"array"===this.__type(e)},isNum:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},isString:function(e){return"string"===this.__type(e)},each:function(e,t,a){var n,i;if(o.isArray(e))for(n=0,i=e.length;i>n&&t.call(e[n],n,e[n],a)!==!1;n++);else for(n in e)if(t.call(e[n],n,e[n],a)===!1)break},funManager:{__loadList:{},__loadFun:function(e,t,a){e.methord&&o.isFunction(e.methord())&&(a=a||window,e.methord()(e,function(){t()},a))},
load:function(e,t,a,n){n=n||0,e[n]&&o.funManager.__loadFun(e[n],function(){o.funManager.load(e,t,a,n+1)},a),t(n,a)},get:function(e){return this.__loadList[e]}},log:function(e){var t=window.console||{log:function(){}};t.log(e)},Event:{mousewheel:function(e){var t=e.originalEvent,a=t.detail?-1*t.detail:t.wheelDelta/40,n=0>a?-1:1;return{direction:n,unit:a}},__:function(e,t,a,n){var i;for(i in e)if(window[e[i].validator]){t[e[i].validator](e[i].prefix+a,n,!1);break}},add:function(e,t,a){var n=[{validator:"addEventListener",prefix:""},{validator:"attachEvent",prefix:"on"}];this.__(n,e,t,a)},remove:function(e,t,a){var n=[{validator:"removeEventListener",prefix:""},{validator:"detachEvent",prefix:"on"}];this.__(n,e,t,a)}},getUid:function(e){return o.template("me-{0}{1}-{2}",e,(new Date).getTime(),o.__Index++)},Browser:{isTouch:function(){var e=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture;return"ontouchstart"in window||e||window.DocumentTouch?!0:!1},Prefix:function(){var e,t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],a=document.createElement("div");for(e in t)if(void 0!==a.style[t[e]])return o.template("-{0}-",t[e].replace("Perspective","").toLowerCase())},parseURL:function(e){var t,a,n,i,o,s=document.createElement("a");return s.href=e,{source:e,protocol:s.protocol.replace(":",""),host:s.hostname,port:s.port,query:s.search,params:function(){for(t={},a=s.search.replace(/^\?/,"").split("&"),n=a.length,i=0,o;n>i;i++)a[i]&&(o=a[i].split("="),t[o[0]]=o[1]);return t}(),file:(s.pathname.match(/\/([^\/?#]+)$/i)||[null,""])[1],hash:s.hash.replace("#",""),path:s.pathname.replace(/^([^\/])/,"/$1"),relative:(s.href.match(/tps?:\/\/[^\/]+(.+)/)||[null,""])[1],segments:s.pathname.replace(/^\//,"").split("/")}}},Array:{indexOf:function(e,t){var a;for(a=0;a<e.length;a++)if(this[a]===t)return a;return-1},remove:function(e,t){var a=this.indexOf(e,t);return a>-1&&e.splice(a,1),e}}};n=function(e){this.initialized=!1,this.registerEvent={before:[],change:[],after:[]},this.options=e,this.init(e)},n.output=function(){o.log(o.list)},n.prototype.oninit=o.fn,n.prototype.init=function(e){this.initialized=!0,this.__Uid=o.getUid("me"),this.oninit(e),o.list[this.__Uid]=this},n.prototype.destory=function(){this.initialized=!1,delete o.list[this.__Uid]},n.prototype.getUid=function(){return this.__Uid},n.prototype.getOptions=function(){return this.options},n.prototype.config=function(){if(!(arguments.length>0))return this.options;if("string"==typeof arguments[0]){if(!(arguments.length>1))return this.options[name];this.options[arguments[0]]=arguments[1]}},n.prototype.on=function(e,t){var a=this,n=a.registerEvent[e];return n&&n.push(t),n},n.prototype.off=function(e,t){var a=this,n=a.registerEvent[e],i=[];o.each(n,function(e,a){a===t&&i.push(e)}),o.each(i.reverse(),function(e,t){n.splice(t,1)})},o.assembly=n,a.exports=o}),define("js/common/new-arrivls",["jquery","lazyload","handlebars","source-map"],function(e,t,a){function n(e){var t={index:0,isload:!0,isrun:!0,offset:{height:null,width:null}};return this.registerEvent={before:[],change:[],after:[]},this.options=i.extend(!0,{},t,e),this}var i=e("jquery"),o=e("lazyload"),s=e("handlebars");n.prototype.on=function(e,t){var a=this,n=a.registerEvent[e];return n&&n.push(t),n},n.prototype.exect=function(e,t){var a,n=this;if(n.registerEvent[e]&&n.registerEvent[e].length>0)for(a in n.registerEvent[e])n.registerEvent[e].hasOwnProperty(a)&&n.registerEvent[e][a](t)},n.prototype.init=function(){function e(){a.isrun&&a.isload&&t.__directionCalculation()&&(a.isload=!1,a.index++,t.exect("after",a)),t.exect("change",a)}var t=this,a=this.options;t.exect("before",a),i(window).scroll(e)},n.prototype.emit=function(){var e=this.options;e.isload=!0},n.prototype.stop=function(){var e=this.options;e.isrun=!1,e.isload=!1},n.prototype.__directionCalculation=function(){var e=this.options;return e.offset.height&&e.offset.height()>0&&i(window).scrollTop()+i(window).height()>=e.offset.height()?!0:!1},a.exports=function(e){var t,a=i("#newarrivals .goods-container"),r=i(".loading a"),d=new n({index:1,isload:!1,offset:{height:function(){return parseFloat(a.offset().top)+parseFloat(a.height())-200}}}),l=e.url,c=e.count,u=e.rows;e.pageIndex=0,delete e.url,delete e.count,delete e.rows,t=function(e,t,n){var l={type:"POST",url:e,success:function(e){var i,l,c,u=e.code;200===u?(l=e.goods.length%n,c=e.goods.length-l-1,e.goods.splice(c,l),i=s.compile(d.tpl),a.append(i(e.goods)),t.pageIndex=t.pageIndex+e.goods.length,o(a.find("img.lazy")),d.emit()):(d.stop(),r.html("查看更多"))},error:function(){d.stop(),r.html("网络断开连接了~")}};l.data=t,i.ajax(l)},d.on("after",function(a){e.pageCount=c*u[1],t(l,e)}),d.on("before",function(a){d.tpl="{{#each this}}",d.tpl+='<div class="good-info imgopacity" data-skn="{{skn}}">',d.tpl+='    <div class="tag-container clearfix">',d.tpl+="        {{# tags}}",d.tpl+="            {{# isNew}}",d.tpl+='                <span class="good-tag new-tag">NEW</span>',d.tpl+="            {{/ isNew}}",d.tpl+="            {{# isReNew}}",d.tpl+='                <span class="good-tag renew-tag">再到着</span>',d.tpl+="            {{/ isReNew}}",d.tpl+="            {{# isSale}}",d.tpl+='                <span class="good-tag sale-tag">SALE</span>',d.tpl+="            {{/ isSale}}",d.tpl+="            {{# isNewFestival}}",d.tpl+='                <span class="good-tag new-festival-tag">新品节</span>',d.tpl+="            {{/ isNewFestival}}",d.tpl+="            {{# isLimit}}",d.tpl+='                <span class="good-tag limit-tag">限量商品</span>',d.tpl+="            {{/ isLimit}}",d.tpl+="            {{# isYearEndPromotion}}",d.tpl+='                <span class="good-tag yep-tag">年终大促</span>',d.tpl+="            {{/ isYearEndPromotion}}",d.tpl+="            {{# isYearMidPromotion}}",d.tpl+='                <span class="good-tag ymp-tag">年中热促</span>',d.tpl+="            {{/ isYearMidPromotion}}",d.tpl+="        {{/ tags}}",d.tpl+="    </div>",d.tpl+='    <div class="good-detail-img">',d.tpl+='        <a class="good-thumb" href="{{url}}" target= "_blank">',d.tpl+='            <img class="lazy" data-original="{{thumb}}">',d.tpl+="        </a>",d.tpl+="        {{# isFew}}",d.tpl+='            <p class="few-tag">即将售罄</p>',d.tpl+="        {{/ isFew}}",d.tpl+="        {{#if showColBtn}}",d.tpl+='            <span class="col-btn iconfont{{#if coled}} coled{{/if}}">&#xe616;</span>',d.tpl+="        {{/if}}",d.tpl+="    </div>",d.tpl+='    <div class="good-detail-text">',d.tpl+='        <a href="{{url}}" target= "_blank">{{name}}</a>',d.tpl+='        <p class="price">',d.tpl+='            <span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">',d.tpl+="                ¥{{salePrice}}",d.tpl+="            </span>",d.tpl+="            {{# marketPrice}}",d.tpl+='                <span class="market-price">¥{{.}}</span>',d.tpl+="            {{/ marketPrice}}",d.tpl+="        </p>",d.tpl+="    </div>",d.tpl+="</div>",d.tpl+="{{/each}}",e.pageCount=c*u[0],t(l,e,e.count)}),d.init()}}),define("js/brand/index",["jquery","lazyload","handlebars","source-map","dot"],function(e,t,a){var n=e("jquery"),i=e("lazyload");e("js/common/slider"),e("js/brand/brands"),i(n("img.lazy")),n(".slide-container").slider({orient:!0})}),define("js/brand/brands",["jquery","handlebars","source-map","dot"],function(e,t,a){function n(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),a=window.location.search.substr(1).match(t);return null!=a?window.unescape(a[2]):null}function i(e,t,a){var n,i=e,o={width:i.width(),left:i.offset().left,right:parseFloat(l(window).width())-parseFloat(i.offset().left)-parseFloat(i.width())},s=i.parent("li");p.find(".brands-dialog").remove(),n=c.compile(a),s.append(n(t)),u(s.find(".right")),o.right-350<0&&s.find(".brands-layer").addClass("brands-layer-right").css("left",-330-o.width)}function o(){g.unbind("mouseenter").unbind("mouseleave").hover(function(){var e=l(this),t=e.attr("data-key"),a={url:"/brands/brandinfo",type:"get",data:{brandId:t},success:function(t){200===t.code&&t.brand&&(_.hasOwnProperty(t.brand.key)||(_[t.brand.key]=t.brand),i(e,_[t.brand.key],q))}};clearTimeout(r),r=setTimeout(function(){_.hasOwnProperty(t)?i(e,_[t],q):l.ajax(a)},200)},function(){clearTimeout(r),p.find(".brands-dialog").remove()})}var s,r,d,l=e("jquery"),c=e("handlebars"),u=e("dot"),h=l(".brands-tabs"),p=l(".brands-list"),f=l(".brands-category"),m=l(".news-txt ul"),v=p.find("dl.clearfix"),g=p.find("li>a"),y=f.find("a"),b=h.find("li>a"),w=h.find(".hoverarr"),C=y.height(),x=y.offset()?y.offset().top:0,k=m.height(),j=m.offset()?m.offset().top:0,_={},q='<div class="brands-dialog">';q+='    <div class="brands-layer">',q+='        <div class="layer-content">',q+='            <div class="title">{{title}}</div>',q+='            <div class="clearfix desc">',q+='                <img src="{{icon}}">',q+='                <p class="right">{{content}}</p>',q+="            </div> ",q+='            <div class="featured">',q+="                <p>{{subtitle}}</p> ",q+='                <div class="clearfix"> ',q+="                    {{#each imgs}}",q+='                    <img src="{{src}}">',q+="                    {{/each}}",q+="                </div>",q+="            </div>",q+="        </div>",q+="    </div>",q+="</div>",u(l(".brand-desc")),l.easing.easeOutQuint=function(e,t,a,n,i){return n*((t=t/i-1)*t*t*t*t+1)+a},m.length&&m.find("li").each(function(){var e=l(this),t=e.offset().top-j+e.height();t>k&&e.hide()}),b.eq(0).parent("li").find(".brands-content").css("z-index","1"),d=n("id")?n("id"):0,s=b.eq(d),s.find(".g-mask").addClass("g-mask-on"),d&&s.length&&w.css({left:parseFloat(s.offset().left)-parseFloat(h.offset().left)}),b.hover(function(){var e=l(this);clearTimeout(r),r=setTimeout(function(){var t=parseFloat(e.offset().left)-parseFloat(h.offset().left);w.animate({left:t},200,"easeOutQuint")},50),h.find(".brands-content").removeAttr("style"),e.parent("li").find(".brands-content").css("z-index","1")},function(){clearTimeout(r)}),l(window).scroll(function(){l(this).scrollTop()>=x?f.addClass("category-fix"):f.removeClass("category-fix")}),y.click(function(){var e=l(this).attr("href").split("#")[1],t=p.find("[name="+e+"]").offset().top-C;return f.hasClass("category-fix")||(t-=C),l("html,body").animate({scrollTop:t},200),!1}),v.length<26&&l.ajax({url:"/brands/brandList",type:"POST",data:{start:v.length?v.length+1:1},success:function(e){e&&(p.append(e),g=p.find("li>a"),o())}}),o()}),define("js/passport/entry",["jquery","jquery.placeholder"],function(e,t,a){e("js/passport/reg"),e("js/passport/back"),e("js/passport/login"),e("js/passport/reset"),e("js/passport/vertification"),e("js/passport/thirdlogin"),e("js/passport/third-pwd"),e("js/passport/relate")}),define("js/passport/reg",["jquery","jquery.placeholder"],function(e,t,a){function n(){var e=new Date,t=m(".captcha-img"),a=t.attr("src").split("?")[0];t.attr("src",a+"?t="+e.getTime())}function i(e,t){var a,i;"reg"===e?(a="/passport/register/checkmobile",i={mobile:A.val(),area:O.text().split("+")[1]}):"third"===e&&(a="/passport/autouserinfo/bindCheck",i={mobile:A.val(),area:O.text().split("+")[1],openId:m("#open-id").val(),sourceType:m("#source-type").val()}),I[0].message="err",I[0].status=!1,m.ajax({url:a,type:"POST",data:i}).then(function(e){if(e){switch(e.code){case 200:A.val()!==F&&""!==F&&(n(),q.addClass("disable").attr("disabled","disabled"),I[1].message="图形验证码错误",I[1].status=!1),F=A.val(),I[0].message="",I[0].status=!0;break;case 400:n(),I[0].message=e.message,I[0].status=!1}t()}})}function o(e,t){var a;"reg"===e?a="/passport/register/piccaptcha":"third"===e&&(a="/passport/autouserinfo/checkPicCode"),m.ajax({type:"POST",url:a,data:{verifyCode:P.val()}}).then(function(e){if(e){switch(e.code){case 200:I[1].message="",I[1].status=!0;break;case 400:n(),I[1].message="图形验证码错误",I[1].status=!1}t()}})}function s(e,t){var a;"reg"===e?a="/passport/register/msgcaptcha":"third"===e&&(a="/passport/autouserinfo/checkBindMsg"),m.ajax({type:"POST",url:a,data:{code:E.val(),mobile:A.val(),area:O.text().split("+")[1]}}).then(function(e){if(e){switch(e.code){case 200:I[2].message="",I[2].status=!0;break;case 400:I[2].message="短信验证码错误",I[2].status=!1}t()}})}function r(e,t,a){var n,r=m.trim(t.val());t.hasClass("phone-num")?(n=O.text(),""===r?(I[0].message="请输入手机号码",I[0].status=!1,a()):v.phoneRegx[n].test(r)?i(e,a):(I[0].message="手机号码格式不正确,请重新输入",I[0].status=!1,a())):t.hasClass("captcha")?""===r?(I[1].message="请输入图形验证码",I[1].status=!1,a()):r.length<=3?(I[1].message="图形验证码为4位",I[1].status=!1,a()):I[0].status?o(e,a):(I[1].message="图形验证码错误",I[1].status=!1,a()):t.hasClass("msg-captcha")?""===r?(I[2].message="请输入短信验证码",I[2].status=!1,a()):r.length<=3?(I[2].message="短信验证码错误",I[2].status=!1,a()):I[1].status?s(e,a):(I[2].message="短信验证码错误",I[2].status=!1,a()):t.hasClass("pwd")?(""===r?(I[3].message="请输入密码",I[3].status=!1):r.length<6||r.length>20?(I[3].message="密码只支持6-20位字符",I[3].status=!1):M.test(t.val())?(I[3].message="",I[3].status=!0):(I[3].message="密码须字母和数字组合",I[3].status=!1),a()):t.hasClass("repwd")&&(""===r?(I[4].message="请输入密码确认",I[4].status=!1):D.val()!==r?(I[4].message="与密码不一致,请重新输入",I[4].status=!1):(I[4].message="",I[4].status=!0),a())}function d(){var e=f.offset();return C.css({top:e.top-40,left:e.left})}function l(){var e,t=!1,a=I.length;for(e=0;a>e;e++)t||(I[e].message&&"err"!==I[e].message?(C.find("span").text(I[e].message),f=m("#"+I[e].id),d().removeClass("hide"),t=!0):C.addClass("hide"))}function c(){var e,t,a=I.length;for(t=0;a>t;t++)I[t].message?(e=m("#"+I[t].id),e.addClass("error")):(e=m("#"+I[t].id),e.removeClass("error"))}function u(e){var t=e.val(),a=g(t),n=0;switch(n=0===a?0:10>=a?1:20>=a?2:3){case 0:z.removeClass("red yellow green"),L.removeClass("color");break;case 1:z.addClass("red").removeClass("yellow green"),L.filter(".low").addClass("color"),L.filter(".mid,.high").removeClass("color");break;case 2:z.addClass("yellow").removeClass("red green"),L.filter(".low,.mid").addClass("color"),L.filter(".high").removeClass("color");break;case 3:z.addClass("green").removeClass("yellow red"),L.addClass("color")}""===t?w.removeClass("red yes no").addClass("default"):t.length<6||t.length>20?w.removeClass("default yes").addClass("no red"):w.removeClass("default no red").addClass("yes")}var h,p,f,m=e("jquery"),v=e("js/passport/mail-phone-regx"),g=e("js/passport/pwd-strength"),y=m(".register-page"),b=m("#pwd-tips"),w=b.find("#pwd-tip1"),C=m("#err-tip"),x=m("#register-btn"),k=m("#count-down"),j=m(".success-btn"),_=5,q=m("#send-captcha"),T=4,I=[],A=m("#phone-num"),E=m("#msg-captcha"),D=m("#pwd"),S=m("#repwd"),P=m("#captcha"),$=0,L=m(".pwd-intensity"),z=L.closest(".pwd-intensity-container"),O=m("#country-code"),N=m("#region"),B=!1,M=v.pwdValidateRegx,F="";e("jquery.placeholder"),setTimeout(function(){A.val(""),E.val(""),D.val(""),S.val(""),P.val("")},0),P.attr("maxlength",T),D.focus(function(e){b.removeClass("hide"),B=!0,p=m(this).val()}).blur(function(){b.addClass("hide"),B=!1}),m("[placeholder]").placeholder(),I=[{id:"phone-num",message:"",status:!1},{id:"captcha",message:"",status:!1},{id:"msg-captcha",message:"",status:!1},{id:"pwd",message:"",status:!1},{id:"repwd",message:"",status:!1}],m(window).resize(function(){C.hasClass("hide")||d()}),t.init=function(e){m("#agree-terms").click(function(){var e,t=m(this),a=0;if(t.attr("notchecked")){for(t.removeAttr("notchecked"),e=0;e<I.length;e++)I[e].status&&a++;4===a&&x.removeClass("disable").removeAttr("disabled")}else x.addClass("disable").attr("disabled","disabled"),t.attr("notchecked","notchecked")}),y.on("keydown",function(e){var t=e.which;13===t&&x.click()}),y.find(".va").keyup(function(){var t,a=0,n=I.length,i=m(this);r(e,m(this),function(){for(l(),c(),t=0;n>t;t++)I[t].status&&a++;4!==a||m("#agree-terms").attr("notchecked")?x.addClass("disable").attr("disabled","disabled"):x.removeClass("disable").removeAttr("disabled"),I[1].status&&0>=$?q.removeClass("disable").removeAttr("disabled"):q.addClass("disable").attr("disabled","disabled")}),i.hasClass("pwd")&&u(i)}).blur(function(){}),N.change(function(){O.text(m("#region").val()),r(e,A,l)}),q.click(function(){var t,a;m(this).hasClass("disable")||($=60,m("#msg-tip").removeClass("hide"),q.addClass("disable").attr("disabled","disabled"),q.val("60秒可重新发送"),t=setInterval(function(){return 0>=$?(q.removeClass("disable").removeAttr("disabled").val("获取短信验证码"),void clearInterval(t)):void q.val($--+"秒可重新发送")},1e3),"reg"===e?a="/passport/register/sendBindMsg":"third"===e&&(a="/passport/autouserinfo/sendBindMsg"),m.ajax({type:"POST",url:a,data:{area:O.text().split("+")[1],mobile:A.val(),verifyCode:P.val()}}))}),m(".success-box").length<=0&&(D[0].onpaste=function(){return!1}),x.click(function(){var t;"reg"===e?t="/passport/register/mobileregister":"third"===e&&(t="/passport/autouserinfo/bindMobile"),m(this).hasClass("disable")||m.ajax({type:"POST",url:t,data:{area:O.text().split("+")[1],mobile:A.val(),verifyCode:P.val(),code:E.val(),password:D.val()}}).then(function(e){var t,a,n=0;200===e.code?(a=e.data.href,t=setTimeout(function(){n++},1e3),m.ajax({type:"GET",url:e.data.session}).then(function(e){200===e.code&&3>t&&(clearInterval(t),location.href=a)}),t>=3&&(clearInterval(t),location.href=a)):console.log("网络超时~")})}),m(".change-captcha").click(function(){n()}),m(".success-box").length>0&&(h=setInterval(function(){0===_&&(window.location.href=j.attr("data-url"),clearInterval(h)),k.text(_--)},1e3))}}),define("js/passport/mail-phone-regx",[],function(e,t,a){var n={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789]{1}[0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/},i=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,o=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;t.phoneRegx=n,t.emailRegx=i,t.pwdValidateRegx=o}),define("js/passport/pwd-strength",[],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t,a,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),a=n(e,c),l===a&&i(t,d,a)||(s+=a+o(a,l)),d=t,l=a;return s}a.exports=s}),define("js/passport/back",["jquery","jquery.placeholder"],function(e,t,a){function n(){var e=new Date,t=d("#captcha-img"),a=t.attr("src").split("?")[0];d("#captcha-img").attr("src",a+"?t="+e.getTime())}function i(){x&&k?y.removeClass("disable").prop("disabled",!1):y.addClass("disable").prop("disabled",!0)}function o(){return x&&k?void d.ajax({type:"POST",url:"/passport/back/authcode",data:{verifyCode:d.trim(m.val()),phoneNum:f.val(),area:p.val()}}).then(function(e){200===e.code?k=!0:402===e.code?(x=!1,k=!0,b.removeClass("hide").find("em").text("该账号不存在"),f.addClass("error")):400===e.code&&(k=!1,n()),i()}):void i()}function s(e){var t=!0,a="";return e=d.trim(e),""!==e?/^[0-9]+$/.test(e)?u[p.val()].test(e)?t=!0:(a="手机号码格式不正确, 请重新输入",t=!1):c.test(e)?t=!0:(a="邮箱格式不正确, 请重新输入",t=!1):(a="账户名不能为空",t=!1),x=t,o(),{pass:t,errTxt:a}}function r(){var e=d.trim(m.val());return""===e||e.length<C?(k=!1,void i()):(k=!0,void o())}var d=e("jquery"),l=e("js/passport/mail-phone-regx"),c=l.emailRegx,u=l.phoneRegx,h=e("js/passport/ac-email"),p=d("#country-code-hide"),f=d("#phone-num"),m=d("#captcha"),v=d("#country-code-list"),g=d("#country-code"),y=d("#find-btn"),b=d("#account-err"),w=d("#captcha-err"),C=4,x=!1,k=!1;e("jquery.placeholder"),h(f,function(){var e=s(f.val());e.pass?(b.addClass("hide"),f.removeClass("error")):(b.removeClass("hide").find("em").text(e.errTxt),f.addClass("error"))}),m.attr("maxlength",C),d("input").placeholder(),d("#change-captcha, #captcha-img").on("click",function(){n()}),g.on("click",function(e){e.stopPropagation(),"block"===v.css("style")?v.slideUp("fast"):v.slideDown("fast")}),v.delegate("li","click",function(e){var t,a=d(this),n=a.data("cc");e.stopPropagation(),p.val(n),g.find("em").html(a.text()),""!==d.trim(f.val())&&(t=s(f.val()),i(),x?(b.addClass("hide"),f.removeClass("error")):(b.removeClass("hide").text(t.errTxt),f.addClass("error"))),v.slideUp("fast")}),d(document).click(function(){"block"===v.css("display")&&v.slideUp()}),f.keyup(function(){s(d.trim(d(this).val()))}).focus(function(){d(this).removeClass("error"),b.addClass("hide")}),m.blur(function(){var e=""===d.trim(m.val())?"验证码不能为空":"验证码不正确";k?(w.addClass("hide"),m.removeClass("error")):(w.removeClass("hide").find("em").text(e),m.addClass("error"),m.val()<C&&n())}).focus(function(){d(this).removeClass("error"),w.addClass("hide")}).keyup(function(){r()}),d("#find-btn").click(function(e){return/^[0-9]+$/.test(d.trim(f.val()))&&d("#find-form").attr("action","/passport/back/mobile"),d(this).hasClass("disable")?void 0:k&&x?void 0:(e.preventDefault(),!0)})}),define("js/passport/ac-email",["jquery"],function(e,t,a){var n,i=e("jquery"),o={num:["qq.com","163.com","126.com","sina.com","gmail.com","sohu.com","hotmail.com","139.com","189.com"],other:["gmail.com","qq.com","163.com","126.com","sina.com","sohu.com","hotmail.com","139.com","189.com"]};a.exports=function(e,t){var a,s='<ul id="email-autocomplete" class="email-autocomplete hide"></ul>';e.parent().append(s),a=i("#email-autocomplete"),e.on("keyup",function(){var e,t,n,s,r=i.trim(i(this).val()),d="";if(r.indexOf("@")>0){for(e=r.match(/^[0-9]+@(.*)/),e?(n=o.num,t=e[1]):(n=o.other,t=r.match(/@(.*)/)[1]),s=0;s<n.length;s++)n[s].indexOf(t)>-1&&(d+="<li>"+r.slice(0,r.indexOf("@"))+"@"+n[s]+"</li>");""!==d&&/.com$/.test(r)===!1?a.html(d).removeClass("hide"):a.html("").addClass("hide")}}).on("blur",function(){n=setTimeout(function(){a.addClass("hide"),t&&t()},200)}),a.on("click","li",function(){clearTimeout(n),e.val(i(this).text()).focus(),a.addClass("hide"),t&&t()})}}),define("js/passport/login",["jquery","jquery.placeholder"],function(e,t,a){function n(){var e,t=!1,a=c.trim(u.val());return""!==a?/^[0-9]+$/.test(a)?x.phoneRegx[y.val()].test(a)?t=!0:(t=!1,e="手机号码不正确,请重新输入"):x.emailRegx.test(a)?t=!0:(t=!1,e="邮箱格式不正确,请重新输入"):e="请输入账户名",t?(f.addClass("hide"),u.removeClass("error")):(f.removeClass("hide").children("em").text(e),u.addClass("error")),t}function i(){var e,t=!1,a=c.trim(h.val());return""!==a?a.length<6?e="请输入长度为6-20字符的密码":t=!0:e="请输入密码",t?(m.addClass("hide"),h.removeClass("error")):(m.removeClass("hide").children("em").text(e),h.addClass("error")),t}function o(){var e,t=!1,a=c.trim(p.val());return q.is(":hidden")?!0:(""!==a?4!==a.length?e="请输入长度为4字符的验证码":t=!0:e="请输入验证码",t?(v.addClass("hide"),p.removeClass("error")):(v.removeClass("hide").children("em").text(e),p.addClass("error")),t)}function s(){var e=!0,t=c.trim(u.val()),a=c.trim(h.val());return""!==t?e=n()&&i()&&o():(e=!1,u.addClass("error"),""===a?(f.addClass("both-error").removeClass("hide").children("em").text("请输入账户名和密码"),m.addClass("hide"),h.addClass("error")):f.removeClass("hide").children("em").text("请输入账户名")),e}function r(){T.attr("src",_+c.now()),p.val(""),q.removeClass("hide")}function d(){var e=s();e&&A===!1&&(A=!0,c.ajax({url:"/passport/login/auth",type:"POST",data:{areaCode:y.val().replace("+",""),account:c.trim(u.val()),password:c.trim(h.val()),captcha:c.trim(p.val()),isRemember:j.hasClass("checked")?!0:!1},success:function(e){200===e.code?e.data&&(location.href=e.data.session):("captcha"===e.data.errorType?(v.removeClass("hide").children("em").html(e.message),p.addClass("error").val("")):(m.removeClass("hide").children("em").html(e.message),h.addClass("error").val("")),e.data&&e.data.needCaptcha&&r())},complete:function(){A=!1}}))}var l,c=e("jquery"),u=c("#account"),h=c("#password"),p=c("#captcha"),f=u.siblings(".err-tip"),m=h.siblings(".err-tip"),v=p.siblings(".err-tip"),g=c("#caps-lock"),y=c("#country-code-hide"),b=c("#country-code > em"),w=c("#country-list"),C=c("#email-autocomplete"),x=e("js/passport/mail-phone-regx"),k=e("js/passport/ac-email"),j=c(".remember-me"),_="/passport/images?t=",q=c(".captcha-wrap"),p=q.find("#captcha"),T=q.find("#captcha-img"),v=q.find(".err-tip"),I={checked:"&#xe612;",unchecked:"&#xe613;"},A=!1;e("jquery.placeholder"),k(u,function(){n()&&c.ajax({url:"/passport/login/account",type:"GET",data:{account:c.trim(u.val())}}).then(function(e){e.data&&e.data.needCaptcha&&r()})}),c("[placeholder]").placeholder(),c("#country-code").on("click",function(){"none"===w.css("display")&&w.slideDown()}),w.on("click","li",function(){var e=c(this),t=e.data("cc");b.html(e.html()),y.val(t),w.slideUp()}),c(document).on("click",function(e){c(e.target).closest("#country-code").length>0||"block"===w.css("display")&&w.slideUp()}),h.on("blur",function(){i(),g.hasClass("hide")||g.addClass("hide")}).on("keypress",function(e){var t=e.which;return t>=65&&90>=t?void g.removeClass("hide"):void g.addClass("hide")}),p.on("blur",function(){o()}),C.on("click","li",function(){clearTimeout(l),u.val(c(this).text()).focus(),C.addClass("hide")}),j.on("click",function(){var e=c(this);e.toggleClass("checked"),e.hasClass("checked")?e.children("i").html(I.checked):e.children("i").html(I.unchecked)}),c(".va").on("focus",function(){var e=c(this);e.removeClass("error"),e.siblings(".err-tip").addClass("hide")}),q.on("click",".change-captcha, .captcha-img",function(){T.attr("src",_+c.now())}),c("#login-btn").on("click",d),c("input.va").on("keypress",function(e){13===e.which&&d()}),""===u.val()&&u.val()!==u.attr("placeholder")||""!==h.val()||h.focus()}),define("js/passport/reset",["jquery","jquery.placeholder"],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t,a,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),a=n(e,c),l===a&&i(t,d,a)||(s+=a+o(a,l)),d=t,l=a;return s}function r(){var e=l.val(),t=s(e),a=0;switch(a=0===t?0:10>=t?1:20>=t?2:3){case 0:g.removeClass("red yellow green"),v.removeClass("color");break;case 1:g.addClass("red").removeClass("yellow green"),v.filter(".low").addClass("color"),v.filter(".mid,.high").removeClass("color");break;case 2:g.addClass("yellow").removeClass("red green"),v.filter(".low,.mid").addClass("color"),v.filter(".high").removeClass("color");break;case 3:g.addClass("green").removeClass("yellow red"),v.addClass("color")}""===e?y.removeClass("red yes no").addClass("default"):e.length<6||e.length>20?y.removeClass("default yes").addClass("no red"):y.removeClass("default no red").addClass("yes"),m=b.test(e)?!0:!1}var d=e("jquery"),l=d("#pwd"),c=d("#re-input"),u=d("#reset-pwd-btn"),h=d("#pwd-err"),p=d("#repwd-err"),f=d("#pwd-tips"),m=!1,v=d(".pwd-intensity"),g=v.closest(".pwd-intensity-container"),y=d("#pwd-tip1"),b=e("js/passport/mail-phone-regx").pwdValidateRegx;e("jquery.placeholder"),d("input").placeholder(),d(".va").keyup(function(){var e=!0;d(this).hasClass("pwd")?r():""===d(this).val()&&(e=!1),e=e&&m&&l.val()===c.val()?!0:!1,e?u.removeClass("disable").prop("disabled",!1):u.addClass("disable").prop("disabled",!0)}).blur(function(){var e=d(this),t=e.val();e.hasClass("pwd")?""===t?(e.addClass("error"),h.removeClass("hide").find("em").text("请输入密码")):t.length<6||t.length>20?(e.addClass("error"),h.removeClass("hide").find("em").text("密码只支持6-20位")):b.test(t)?(h.addClass("hide"),""!==c.val()&&(t!==c.val()?(c.addClass("error"),p.removeClass("hide").find("em").text("两次密码输入不一致,请重新输入")):(c.removeClass("error"),p.addClass("hide")))):(e.addClass("error"),h.removeClass("hide").find("em").text("密码须字母和数字组合")):""===t?(e.addClass("error"),p.removeClass("hide").find("em").text("请输入密码确认")):""!==l.val()&&t!==l.val()?(e.addClass("error"),p.removeClass("hide").find("em").text("两次密码输入不一致,请重新输入")):(e.removeClass("error"),p.addClass("hide"))}).focus(function(){d(this).removeClass("error"),d(this).hasClass("pwd")?h.addClass("hide"):p.addClass("hide")}),l.focus(function(){h.addClass("hide"),f.removeClass("hide")}).blur(function(){f.addClass("hide")}),d("#pwd, #repwd").keydown(function(e){var t=e.keyCode||e.which;return 32===t?void e.preventDefault():void 0})}),define("js/passport/vertification",["jquery"],function(e,t,a){var n,i,o=e("jquery"),s=o("#send-captcha"),r=o("#captcha-tip"),d=o("#err-tip"),l=o("#next-step");s.click(function(){o.post("/passport/back/sendbackmobile",{mobile:o("#mobile").val(),area:o("#area").val(),verifyCode:o("#captchaPic").val()},function(e){if(200===e.code){if(d.hide(),o(this).hasClass("disable"))return;n=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(n--+"秒后可重新操作"),i=setInterval(function(){0===n?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(n--+"秒后可重新操作")},1e3)}else o(this).addClass("error"),d.removeClass("hide").text("发送失败")})}),n=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(n--+"秒后可重新操作"),i=setInterval(function(){0===n?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(n--+"秒后可重新操作")},1e3),o("#captcha").keyup(function(){var e=o.trim(o(this).val()),t=this;4===e.length?o.ajax({type:"POST",url:"/passport/back/backmobile",dataType:"json",data:{code:o("#captcha").val(),verifyCode:o("#captchaPic").val(),area:o("#area").val(),mobile:o("#mobile").val()},success:function(e){200===e.code?(l.removeClass("disable").attr("href",e.data),d.addClass("hide"),o(t).removeClass("error")):(l.addClass("disable"),d.removeClass("hide").find("em").text("验证码输入错误"),o(t).addClass("error"))}}):l.addClass("disable").attr("href","javascript:;")}).blur(function(){var e=o.trim(o(this).val());""===e&&(o(this).addClass("error"),d.removeClass("hide").text("请输入验证码"))}).focus(function(){o(this).removeClass("error")})}),define("js/passport/thirdlogin",["jquery"],function(e,t,a){function n(){b(".choosetag").on("change",function(){var e="#f02200";"checked"===b(this).attr("checked")?b(".choosewrapper").css({"background-image":'url("'+q+'")'}):(b(".choosewrapper").css({"background-image":"none"}),e="#CCCCCC"),A.css({"background-color":e})})}function i(){return"checked"===b(".choosetag").attr("checked")}function o(){b(".optionshow").on("click",function(){b(".optionslist").toggleClass("hide")})}function s(){var e="";b(document).on("keyup","#validatenum",function(){e=b(this).val(),4===e.length&&(j||(j=!0,b.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:b("#mobile").val(),area:b("#areacode").val()}}).then(function(e){j=!1,200===e.code?_=!0:alert(e.message)})))}),b("#validatenum").focus(function(){b(this).removeAttr("placeholder")}).blur(function(){b(this).attr("placeholder","验证码")})}function r(){b(".optionitem").on("click",function(){var e=b(this),t=e.attr("areanum"),a=e.text();b("#areaname").text(a),b("#areanum").text(t),b("#areacode").val(t),b(".optionslist").addClass("hide")})}function d(){b(document).on("click","body",function(e){var t=b(e.target);t.hasClass("yohoselectarea")||t.hasClass("areaname")||t.hasClass("righttag")||t.hasClass("optionslist")||t.hasClass("optionitem")||b(".optionslist").addClass("hide")})}function l(){var e="",t="";b(".optionitem").each(function(){e=b(this),t=e.attr("areanum").replace(/\+/g,""),e.attr("areanum",t)})}function c(){var e;b(document).on("click","#alreayregist",function(t){e=b(t.target),(e.hasClass("mask")||e.hasClass("backdrop"))&&(b("#alreayregist").hide(),b(".backdrop").hide())}),b(document).on("click","#bindconfirm",function(t){e=b(t.target),(e.hasClass("mask")||e.hasClass("backdrop"))&&(b("#bindconfirm").hide(),b(".backdrop").hide())})}function u(){b(document).on("click","#yohobindbtn",function(e){b(".phonenum").val(""),b("#bindconfirm").hide(),b(".backdrop").hide()}),b(document).on("click","#yohobindbtn2",function(e){b(".phonenum").val(""),
b("#alreayregist").hide(),b(".backdrop").hide()})}function h(){return k-=1,0>k?(k=60,void b(".validatewrapper").html(x)):(b(".second").text(k),void window.setTimeout(h,1e3))}function p(e){b(".validatewrapper").html(C),window.setTimeout(h,1e3)}function f(){b(document).on("click","#sendmessage",function(){"disabled"!==b("#sendmessage").attr("disabled")&&(p(b("#mobile").val()),b.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:b("#mobile").val(),area:b("#areacode").val()}}).then(function(e){200!==e.code&&alert(e.message)}))})}function m(){var e="",t="";t=b("#areacode").val(),e=b("#mobile").val(),b.ajax({type:"POST",url:"/passport/autouserinfo/bindMobile",data:{area:t,openId:b("#openId").val(),sourceType:b("#sourceType").val(),mobile:e,code:b("#validatenum").val()}}).then(function(e){200===e.code?e.data&&e.data.refer?window.location.href=e.data.refer:window.location.href="/passport/thirdlogin/bindsuccess":alert(e.message)})}function v(){b(document).on("click","#gotobindphone",function(){_===!0?(b("#inarea").val(b("#areacode").val()),b("#inmobile").val(b("#mobile").val()),m()):alert("请输入正确验证码")})}function g(){var e="",t="",a="",n="",o="",s="";b("#bindfirststep").on("click",function(r){var d;if(r.preventDefault(),a=b(".phonenum").val(),n=b("#areanum").text(),d=w["+"+n],i()){if(""===a||!d||!d.test(a))return I.find("em").text("手机格式错误"),void I.removeClass("hide");e=b("#openId").val()||"29803EC6D4AAC3AAB8ABDB6AE829D579",t=b("#sourceType").val()||"qq",b.ajax({type:"post",url:"/passport/autouserinfo/bindCheck",data:{mobile:a,area:n,openId:e,sourceType:t},dataType:"json",success:function(e){var t=b(window).height();200===e.code?(b("#bindmobileform").attr("action",e.data.next),b("#bindmobileform").submit()):201===e.code?(o=e.data.user.username,s=e.data.user.headImg,b("#registphone").text(a),b("#username").text(o),""===s?b("#userphoto").attr("src","http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100"):b("#userphoto").attr("src",s),b("#logindirectly2").attr("href",e.data.user.bindLogin),b(".backdrop").show(),b("#sendmessage").click(),b("#alreayregist .mask").css({"padding-top":t>440?t/2:217}),b("#alreayregist").show()):203===e.code?(b("#bindmobileform").attr("action",e.data.next),b("#bindmobileform").submit()):400===e.code||402===e.code?(I.find("em").text("手机格式错误"),I.removeClass("hide")):e&&e.message&&alert(e.message)}})}})}function y(){l(),f(),n(),r(),o(),d(),g(),c(),u(),v(),s()}var b=e("jquery"),w=e("js/passport/mail-phone-regx").phoneRegx,C=b("#nopermissionmessage").html(),x=b(".validatewrapper").html(),k=+b(".second").text(),j=!1,_=!1,q="http://cdn.yoho.cn/yohobuy/assets/img/passport/choosed.png",T=b(".bindwrapper"),I=T.find(".phone-err-tip"),A=T.find(".yohobindbtn");y()}),define("js/passport/third-pwd",["jquery"],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t=0,a=e.length,s="",r=0,d=0,l="",c="";for(d;a>d;d++)l=e.charAt(d),c=n(e,d),r===c&&i(l,s,c)||(t+=c+o(c,r)),s=l,r=c;return t}function r(e,t){e.find("em").text(t),e.removeClass("hide")}function d(){return _-=1,0>_?(_=60,void C(".validatewrapper").html(T)):(C(".second").text(_),void window.setTimeout(d,1e3))}function l(){C(".validatewrapper").html(q),window.setTimeout(d,1e3)}function c(){C(document).on("click","#sendmessage",function(){l(),C.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:L,area:z}}).then(function(e){200!==e.code&&alert(e.message)})})}function u(){var e="";C(document).on("keyup","#validatenum",function(){C("#err-info").hide(),e=C(this).val(),4===e.length&&(x||(x=!0,C.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:L,area:z}}).then(function(e){x=!1,200!==e.code?C("#err-info").show():k=!0})))})}function h(){var e=g.val(),t=s(e),a=0;switch(a=0===t?0:10>=t?1:20>=t?2:3){case 0:y.removeClass("red yellow green"),w.removeClass("color");break;case 1:y.addClass("red").removeClass("yellow green"),w.filter(".low").addClass("color"),w.filter(".mid,.high").removeClass("color");break;case 2:y.addClass("yellow").removeClass("red green"),w.filter(".low,.mid").addClass("color"),w.filter(".high").removeClass("color");break;case 3:y.addClass("green").removeClass("yellow red"),w.addClass("color")}""===e?(j=!1,b.removeClass("red yes no").addClass("default")):(e.length<6||e.length>20?(j=!1,b.removeClass("default yes").addClass("no red")):(j=!0,b.removeClass("default no red").addClass("yes")),/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/.test(e)?S.removeClass("default no red").addClass("yes"):S.removeClass("default yes").addClass("no red"))}function p(){C(document).on("keyup",".pwdcontent",function(){h(C(this))}),C(document).on("focus",".pwdcontent",function(){C("#pwd-tips").removeClass("hide")}),C(document).on("blur",".pwdcontent",function(){C("#pwd-tips").addClass("hide")})}function f(){var e="",t="";I||(I=!0,setTimeout(function(){I=!1},5e4),e=C("#pwd").val(),t=C("#validatenum").val(),C.ajax({type:"POST",url:"/passport/autouserinfo/bindMobile",data:{area:z,openId:C("#openId").val(),sourceType:C("#sourceType").val(),mobile:L,password:e,code:t}}).then(function(e){I=!1,200===e.code?e.data&&e.data.refer?window.location.href=e.data.refer:window.location.href="/passport/thirdlogin/bindsuccess":alert(e.message)}))}function m(){var e="",t="";C("#confirmsubmit").on("click",function(){var a=!0;e=C("#validatenum").val(),t=C("#pwd").val(),""===e?(r(E,"短信验证码不能为空"),a=!1):k===!1&&(r(E,"请输入正确的验证码"),a=!1),""===t?(r(D,"密码不能为空"),a=!1):t.length<6||t.length>20?(r(D,"密码只支持6-20位字符"),a=!1):$.test(t)?j===!1&&(r(D,"请输入符合强度的密码"),a=!1):(r(D,"密码须由字母和数字组合"),a=!1),a&&f()})}function v(){g=C("#pwd"),y=C(".safelevel"),w=C(".pwd-intensity"),b=C("#pwd-tip1"),c(),u(),p(),m(),L&&z&&P.click()}var g,y,b,w,C=e("jquery"),x=!1,k=!1,j=!1,_="",q="",T="",I=!1,A=C(".bindwrapper"),E=A.find(".code-err-tip"),D=A.find(".pwd-err-tip"),S=C("#pwd-tip2"),P=C("#sendmessage"),$=e("js/passport/mail-phone-regx").pwdValidateRegx,L=C("#mobile").val(),z=C("#area").val();q=C("#nopermissionmessage").html(),T=C(".validatewrapper").html(),_=+C(".second").text(),v()}),define("js/passport/relate",["jquery"],function(e,t,a){function n(){p.init(),o.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:h.mobile,area:h.area}}).then(function(e){e&&200!==e.code&&(p.clearTime(),alert(e.message))})}function i(){var e=l.val();e&&o.ajax({type:"POST",url:"/passport/autouserinfo/relateMobile",data:{mobile:h.mobile,area:h.area,openId:h.openid,sourceType:h.source,code:e}}).then(function(e){200===e.code?window.location.href=e.data.refer:alert(e.message)})}var o=e("jquery"),s=o("#relate-main"),r=o("#code-validate"),d=r.find(".validate-wrapper"),l=r.find(".msg-code"),c=r.find(".count-down span"),u=o("#hide-info"),h={},p={};h=u.data(),u.remove(),p={init:function(){this.timer&&window.clearTimeout(this.timer),this.second=60,d.addClass("waiting"),this.changeTime()},changeTime:function(){var e=this;this.second&&this.second>0?(c.text(this.second),this.second--,this.timer=window.setTimeout(function(){e.changeTime()},1e3)):this.clearTime()},clearTime:function(){this.timer&&window.clearTimeout(this.timer),d.removeClass("waiting")}},o("#next-step-btn").click(function(){n(),s.addClass("hide"),r.removeClass("hide")}),r.on("click",".get-code",function(){n()}),r.on("click",".perv-step",function(){p.clearTime(),s.removeClass("hide"),r.addClass("hide"),l.val("")}),o("#relate-btn").click(function(){i()})}),define("js/cart/cart",["jquery","handlebars","source-map"],function(e,t,a){function n(e){M.ajax({type:"POST",dataType:"json",url:"/cart/index/select",data:e,beforeSend:function(){M(".loading").css({top:M(document).scrollTop()+200}),M(".loading").show()}}).then(function(e){200===e.code&&window.history.go(0)})}function i(e,t){te=[],j={},w=e.attr("checked")?"Y":"N",M("."+t).each(function(){oe=M(this).data("promotionid")?!0:!1,M(this).data("id")&&te.push({product_sku:M(this).data("id"),selected:w,buy_number:M(this).data("productnum"),goods_type:M(this).data("goodstype"),promotion_id:M(this).data("promotionid")?M(this).data("promotionid"):0})}),j={skuList:JSON.stringify(te),hasPromotion:oe},n(j)}function o(e,t,a){M.ajax({type:"GET",dataType:"json",url:t,data:a}).then(function(t){200===t.code&&t.data.item&&t.data.item.length>0&&(e.html(" "),m=f(t.data),e.append(M(m)),M("#orderProduct li:last").addClass("end"),M(".gift").removeClass("none"))})}function s(e){M.ajax({type:"GET",dataType:"html",url:"/cart/index/getProductInfo",data:e}).then(function(e){V=0,W.html(" "),W.append(e),W.show(),M(".detail-bigpic:not(.none) .con li:first").addClass("active"),M(".showSizeBox:not(.none) span").length<2&&M(".showSizeBox:not(.none) span:first").addClass("atcive"),1!==Number(M("#addToCart").val())&&M(".showSizeBox span").data("num",0),M.each(M(".showSizeBox span"),function(){M(this).data("num")<=0&&(M(this).addClass("null-atcivec"),console.log(M(".showSizeBox:not(.none) span:first")),M(".showSizeBox:not(.none) span:first").removeClass("atcive"))}),"undefined"!=typeof I&&(N=M(".detail-info .oldprice del").html()?M(".detail-info .oldprice del").html():B,z='<span class="oldprice">现价:<del>'+N+'</del></span><span class="newprice">活动价:<b class="promotion-price">'+I+"</b></span>",M(".detail-info .price").html(z)),M(".detail-bigpic:not(.none) .bigpic:gt(0)").hide(),M(".showSizeBox:not(.none)").find("span").each(function(){return M(this).hasClass("null-atcivec")?(M(".addcart").addClass("none"),void M(".btn_sellout").removeClass("none")):(M(".addcart").removeClass("none"),M(".btn_sellout").addClass("none"),!1)})})}function r(){W.html(" "),W.css({top:M(document).scrollTop()+30,left:M(document).width()/2-W.width()/2})}function d(e){e.addClass("none").siblings("i").removeClass("none"),e.parents(".cart-product-num").siblings("div").toggleClass("fold"),e.siblings(".unfold-color").toggleClass("none"),e.siblings(".cart-page").toggleClass("none")}function l(e,t,a){M.ajax({type:"POST",dataType:"json",url:t,data:j,beforeSend:function(){M(".loading").css({top:M(document).scrollTop()+200}),M(".loading").show()}}).then(function(e){200===e.code?(a&&window.setCookie("cart-del-list",JSON.stringify(a),{domain:".yohobuy.com",path:"/"}),window.history.go(0)):300===e.code?(M(".loading").hide(),new H(e.message).show()):403===e.code&&e.data.url&&(window.location=e.data.url)})}function c(e){se=!0,M.ajax({type:"POST",dataType:"json",url:"/cart/index/modify",data:e}).then(function(e){200===e.code&&window.history.go(0),se=!1})}function u(e,t){M.ajax({type:"POST",url:"/cart/index/add",data:e}).then(function(e){200===e.code?(window.history.go(0),t&&window.setCookie("cart-del-list",JSON.stringify(t),{domain:".yohobuy.com",path:"/"})):500===e.code&&new H(e.message).show()})}function h(){M(".gift-wrapper .fold").show(),M(".pre-sell-box input:checked").length===M('.pre-sell-box input[type="checkbox"]').length&&M('.per-list input[type="checkbox"]').attr("checked",!0),M(".common-sell-box input:checked").length===M('.common-sell-box input[type="checkbox"]').length&&M('.common-list input[type="checkbox"]').attr("checked",!0),M('.common-list input[type="checkbox"]').attr("checked")&&(ie=!0),M('.per-list input[type="checkbox"]').attr("checked")&&(ne=!0),0!==M(".per-list").length&&0!==M(".common-list").length?ie&&ne&&M('.batch_div input[type="checkbox"]').attr("checked",!0):(ie||ne)&&M('.batch_div input[type="checkbox"]').attr("checked",!0),M(".cart-page").each(function(){1===M(this).data("pageall")?(M(".cart-btn-pre",this).hide(),M(".cart-btn-next",this).hide()):M(".cart-btn-pre",this).hide()}),M(".pre-sell-box input:checked").length>0&&M(".common-sell-box input:checked").length>0?(M(".go_cash_tips").show(),M(".btn_account_disabled").show(),M(".btn_account").hide()):(M(".go_cash_tips").hide(),M(".btn_account").show(),M(".btn_account_disabled").hide()),M(".pay-wapper tr").each(function(){M(this).data("pid")&&te.push(M(this).data("pid")+"")}),M.ajax({type:"POST",url:"/cart/index/checkFav",data:{pidList:JSON.stringify(te)}}).then(function(e){A='<span class="cart-yetremove-btn">已收藏</span>',E='<a href="javascript:void(0);" class="cart-remove-btn"><span>移入收藏</span></a>',M.each(e.data,function(e,t,a){M(".pay-wapper tr").each(function(){Number(M(this).data("pid"))===Number(e)&&(t?M(this).find(".cart-operation").append(A):M(this).find(".cart-operation").append(E))})})})}var p,f,m,v,g,y,b,w,C,x,k,j,_,q,T,I,A,E,D,S,P,$,L,z,O,N,B,M=e("jquery"),F=e("handlebars"),U=e("js/common/dialog"),R=U.Confirm,H=U.Alert,G=M(".cartnew-sum"),Y=M(".cartnew-tips"),X=M(".pay-wapper"),W=M(".goods-detail"),J=M(".histroy"),Q=M(".together"),Z=M(".shop-cart"),K=1,V=0,ee=1,te=[],ae=[],ne=!1,ie=!1,oe=!1,se=!1;Y.find(".btn_close").click(function(){Y.fadeOut()}),X.one("click",'.common-sell-box input[type="checkbox"], .pre-sell-box input[type="checkbox"]',function(){w=M(this).attr("checked")?"Y":"N",te=[],te.push({product_sku:M(this).parents("tr").data("id"),selected:w,buy_number:M(this).parents("tr").data("productnum"),goods_type:M(this).parents("tr").data("goodstype"),promotion_id:M(this).parents("tr").data("promotionid")?M(this).parents("tr").data("promotionid"):0}),oe=M(this).parents("tr").promotion_id?!0:!1,j={skuList:JSON.stringify(te),hasPromotion:oe},n(j)}),G.one("click",'input[type="checkbox"]',function(){te=[],O={},j={},w=M(this).attr("checked")?"Y":"N",M(".pay-wapper:first tr").each(function(){M(this).data("promotionid")&&(oe=!0),M(this).data("id")&&te.push({product_sku:M(this).data("id"),selected:w,buy_number:M(this).data("productnum"),goods_type:M(this).data("goodstype"),promotion_id:M(this).data("promotionid")?M(this).data("promotionid"):0})}),j={skuList:JSON.stringify(te),hasPromotion:oe},n(j)}),M(".per-list").on("click",'input[type="checkbox"]',function(){i(M(this),"pre-sell-box")}),M(".common-list").on("click",'input[type="checkbox"]',function(){i(M(this),"common-sell-box")}),p=M("#togetherProduct").html(),f=F.compile(p),o(J,"/cart/index/getHistroyProduct"),o(Q,"/cart/index/getTogetherProduct"),Q.on("click",".pagenext, .pageprev",function(){o(Q,"/cart/index/getTogetherProduct",{page:Math.ceil(100*Math.random())+1})}),Z.on("click",".icon-minus, .icon-add",function(){M(this).hasClass("icon-minus")?(M(this).parents(".title").next(".main").hide(),M(this).parents("h2").next(".right").hide()):(M(this).parents(".title").next(".main").show(),M(this).parents("h2").next(".right").show()),M(this).siblings("i").toggleClass("none"),M(this).toggleClass("none")}),J.on("click",".pagenext, .pageprev",function(){M(this).hasClass("pagenext")?K++:--K>0||(K=1),o(J,"/cart/index/getHistroyProduct",{page:K})}),X.on("click",".cart-add-btn",function(){S=M(this).data("id"),T=M(this).parents("table").data("promotion"),I=M(this).parents("table").find(".subjoin-price").html(),B=M(this).parents("table").find(".wapper-price").html(),r(),s({productId:S})}),M(".clearfix").on("click",".btn_view_s",function(){S=M(this).data("id"),T=M(this).parents("table").data("promotion"),I=M(this).parents("table").find(".subjoin-price").html(),r(),s({productId:S})}),W.on("click",".colse",function(){W.hide(),W.html(" "),ee=1}),X.on("click",".icon-minusCart, .icon-addCart",function(){d(M(this))}),X.on("click",".unfold-color",function(){d(M(this)),M(this).siblings(".icon-minusCart").removeClass("none"),M(this).siblings(".icon-addCart").addClass("none")}),X.on("click",".cart-btn-next",function(){v=M(this).siblings("p").find(".f-red"),y=Number(M(this).siblings("p").find(".subjoinPageNum").html()),g=Number(v.html()),v.html(g+1),g>=y-1?M(this).hide():M(this).siblings("i").show(),b=M(this).parents(".cart-product-num").siblings("div").find("table"),b.addClass("none").eq(g).removeClass("none")}),X.on("click",".cart-btn-pre",function(){v=M(this).siblings("p").find(".f-red"),y=Number(M(this).siblings("p").find(".subjoinPageNum").html()),g=Number(v.html()),v.html(g-1),2>=g?M(this).hide():M(this).siblings("i").show(),b=M(this).parents(".cart-product-num").siblings("div").find("table"),b.addClass("none").eq(g-2).removeClass("none")}),W.on("click",".fav_count",function(){M.ajax({type:"POST",dataType:"json",url:"/product/item/togglecollect",data:{productId:S,type:"add"}}).then(function(e){200===e.code?new H(e.message).show():403===e.code?e.data.url&&(window.location=e.data.url):new H(e.message).show()})}),X.on("click",".cart-del-btn",function(){j={},te=[],T=M(this).parents("tr").data("promotionid")?M(this).parents("tr").data("promotionid"):0,te.push({product_sku:M(this).parents("tr").data("id"),buy_number:M(this).parents("tr").data("productnum"),promotion_id:T}),oe=T?!0:!1,j={skuList:JSON.stringify(te),hasPromotion:oe},D="<div><span></span>删除商品</div><p>确定从购物车中删除此商品?</p>",M(this).data("gift")||(k={productPrice:M(this).parents("tr").find(".productPrice").text(),productTitle:M(this).parents("tr").find(".pay-pro-info a").text(),link:M(this).parents("tr").find(".pay-pro-info a").attr("href"),productNum:M(this).parents("tr").data("productnum"),productSku:M(this).parents("tr").data("id"),promotionId:M(this).parents("tr").data("promotionid")}),C="/cart/index/remove",new R({content:D,cb:function(){l(j,C,k)}}).show()}),X.on("click",".cart-remove-btn",function(){j={},te=[],T=M(this).parents("tr").data("promotionid")?M(this).parents("tr").data("promotionid"):0,te.push({product_sku:M(this).parents("tr").data("id"),buy_number:M(this).parents("tr").data("productnum"),promotion_id:T}),oe=T?!0:!1,j={skuList:JSON.stringify(te),hasPromotion:oe},l(j,"/cart/index/fav")}),G.on("click",".delAll",function(){j={},k={},te=[],ae=[],M(".pay-wapper:first tr").each(function(){M(this).find('input[type="checkbox"]').attr("checked")&&(T=M(this).data("promotionid")?M(this).data("promotionid"):0,T&&(oe=!0),M(this).data("id")&&(M(this).find('input[type="checkbox"]').attr("checked")&&te.push({product_sku:M(this).data("id"),buy_number:M(this).data("productnum"),promotion_id:T}),k={productPrice:M(this).find(".productPrice").text(),productTitle:M(this).find(".pay-pro-info a").text(),link:M(this).find(".pay-pro-info a").attr("href"),productNum:M(this).data("productnum"),productSku:M(this).data("id"),promotionId:M(this).data("promotionid")},ae.push(k)))}),C="/cart/index/remove",D="<div><span></span>删除商品</div><p>确定从购物车中删除所有选中商品?</p>",j={skuList:JSON.stringify(te),hasPromotion:oe},M.isEmptyObject(te)?new H("请至少选择一件商品").show():new R({content:D,cb:function(){l(j,C,ae)}}).show()}),G.on("click",".removeAll",function(){j={},k={},te=[],M(".pay-wapper:first tr").each(function(){M(this).find('input[type="checkbox"]').attr("checked")&&(T=M(this).data("promotionid")?M(this).data("promotionid"):0,T&&(oe=!0),M(this).data("id")&&M(this).find('input[type="checkbox"]').attr("checked")&&te.push({product_sku:M(this).data("id"),buy_number:M(this).data("productnum"),promotion_id:T}))}),j={skuList:JSON.stringify(te),hasPromotion:oe},M.isEmptyObject(te)?new H("请至少选择一件商品").show():l(j,"/cart/index/fav")}),X.on("click",".minus, .plus",function(){return k={},x=M(this).hasClass("minus")?"decreaseNum":"increaseNum",k[""+x]=1,se||"1"===M(this).siblings("input").val()&&M(this).hasClass("minus")?!1:void c(M.extend(k,{sku:M(this).parents("tr").data("id")}))}),M(".gift").on("click",".up, .down",function(){M(this).siblings("i").toggleClass("none"),M(this).toggleClass("none")}),W.on("click",".addcart",function(){return 0===M(".showSizeBox:not(.none) .atcive").length?(new H("请选择尺码").show(),!1):(_=M(".showSizeBox:not(.none) .atcive").data("num"),q=M(".showSizeBox:not(.none) .atcive").data("sku"),j={productSku:q,buyNumber:M("#mnum").val(),promotionId:T},void(M("#mnum").val()>_?new H("库存不足,目前还有"+_+"个库存").show():1===Number(M("#addToCart").val())?u(j):new H("该商品无法加入购物车").show()))}),W.on("click",".cut, .add",function(){if(x=M(this).hasClass("minus")?"decreaseNum":"increaseNum",T)M(this).hasClass("cut")?new H("-_-,已经是最后一件,不能在减了!").show():new H("最多只能购买1,您好像购买的太多了!").show();else{if(M(this).hasClass("add")?ee++:ee--,1>ee)return new H("-_-,已经是最后一件,不能在减了!").show(),ee=1,!1;M("#mnum").val(ee)}}),W.on("click",".color",function(){V=0,M(".color").find("p").removeClass("atcive"),M(this).find("p").addClass("atcive"),M(".showSizeBox").addClass("none").eq(M(this).index()).removeClass("none"),M(".showSizeBox:not(.none) span").length<2&&M(".showSizeBox:not(.none) span:first").addClass("atcive"),M(".detail-bigpic").addClass("none").eq(M(this).index()).removeClass("none"),M(".detail-bigpic").eq(M(this).index()).find(".bigpic").hide(),M(".detail-bigpic").eq(M(this).index()).find(".bigpic:first").show(),M(".detail-bigpic").eq(M(this).index()).find(".con li").removeClass("active"),M(".detail-bigpic").eq(M(this).index()).find(".con li:first").addClass("active"),M(".showSizeBox").eq(M(this).index()).find("span").each(function(){return M(this).hasClass("null-atcivec")?(M(".addcart").addClass("none"),void M(".btn_sellout").removeClass("none")):(M(".addcart").removeClass("none"),M(".btn_sellout").addClass("none"),!1)})}),W.on("click",".showSizeBox span",function(){_=M(this).data("num"),M(this).data("num")>0?(M(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(M(this).index()).addClass("atcive"),M(".addcart").removeClass("none"),M(".btn_sellout").addClass("none")):(M(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(M(this).index()).addClass("atcivec"),M(".addcart").addClass("none"),M(".btn_sellout").removeClass("none"))}),M(".goBack").on("click",function(){j={},$=M(".dev-revocation .goBack").index(this),te=[],M(".dev-revocation tr").each(function(e){$!==e&&(k={productPrice:M(this).find(".productPrice").text(),productTitle:M(this).find(".title").text(),link:M(this).find(".title").attr("href"),productNum:M(this).data("productnum"),productSku:M(this).data("productsku"),promotionId:M(this).data("promotionid")},te.push(k))}),j={productSku:M(this).parents("tr").data("productsku"),promotionId:M(this).parents("tr").data("promotionid"),buyNumber:M(this).parents("tr").data("productnum")},u(j,te)}),W.on("click",".piclist li",function(){V=M(this).index(),M(".detail-bigpic:not(.none) .piclist li").removeClass("active"),M(this).addClass("active"),M(".detail-bigpic:not(.none) .bigpic").hide().eq(M(this).index()).show()}),h(),W.on("click",".pre, .next",function(){if(M(this).hasClass("next")){if(V>=M(this).siblings(".con").find("li").length-1)return!1;V++}else{if(1>V)return!1;V--}M(this).siblings(".con").find("li").removeClass("active").eq(V).addClass("active"),M(".detail-bigpic:not(.none) .bigpic").hide().eq(V).show()}),M(".btn_account").on("click",function(){L="",M(".pay-wapper input:checked").parents("tr").find(".tipNoStore").length>0?(P=M(".pay-wapper input:checked").parents("tr").find(".tipNoStore"),M.each(P.parents("tr").find(".pay-pro-info a"),function(){L+=M(this).html()}),new H(L+"库存不足").show()):M(".zp").length>0&&!M(this).attr("title")?(M(this).attr("title","1"),new H("您有赠品没有选择,请选择完再结算!").show()):M("input:checked").length>0?M(".pre-sell-box input:checked").length>0?window.location.href="/cart/index/orderEnsure?type=2":window.location.href="/cart/index/orderEnsure?type=1":new H("请至少选择一件商品").show()}),X.on("selectstart",function(){return!1}),W.on("selectstart",function(){return!1})}),define("js/guang/entry",["jquery","lazyload","dot","jquery-pjax"],function(e,t,a){e("js/guang/list"),e("js/guang/detail"),e("js/guang/index")}),define("js/guang/list",["jquery","lazyload","dot"],function(e,t,a){e("js/guang/msg"),e("js/guang/img-blink"),e("js/guang/right-side")}),define("js/guang/msg",["jquery","lazyload","dot"],function(e,t,a){function n(){o(".msg-title, .msg-content .content").dotdotdot({wrap:"letter"}),s(o("#msg-list img.lazy"))}var i,o=e("jquery"),s=e("lazyload");e("dot"),o(".guang-page").on("click",".like-icon",function(){var e,t=o(this),a=t.closest(".msg-content").data("id");i!==a&&(i=a,t.toggleClass("liked"),e=t.hasClass("liked")?"/guang/info/praise":"/guang/info/cancelPraise",o.ajax({type:"GET",url:e,data:{id:a,time:(new Date).getTime()}}).then(function(e){200===e.code&&(1*e.data===0?t.next("b").addClass("num-0").children(".num").html("0"):t.next("b").removeClass("num-0").children(".num").html(e.data)),i=!1}))}).on("mouseenter mouseleave",".like-icon",function(){o(this).closest(".like").toggleClass("hover")}),n(),t.dotLazy=n}),define("js/guang/img-blink",["jquery"],function(e,t,a){var n=e("jquery");n(".guang-page").on("mouseover","a img, a .bg-img",function(e){var t=n(e.target);t.closest(".slider").length>0||(t.addClass("blink"),setTimeout(function(){t.removeClass("blink")},100))})}),define("js/guang/right-side",["jquery","lazyload","dot"],function(e,t,a){var n=e("jquery"),i=e("lazyload");e("dot"),n(".ex-reco-context").dotdotdot({wrap:"letter"}),i(n(".ads img.lazy"))}),define("js/guang/detail",["jquery","lazyload","dot","jquery-pjax"],function(e,t,a){function n(){var e=o(".comments-list").find("li").length;0===e?(o(".commnets-resultwrapper").hide(),o(".comments-empty").show()):(o(".commnets-resultwrapper").show(),o(".comments-empty").hide())}function i(e){var t=o("#comment-info").val();return""===t?(alert("评论不能为空"),!1):(u=!0,void o.ajax({url:"/guang/info/comment",data:{id:e,comment:t},type:"post",success:function(e){switch(e.code){case 401:h=!0,location.href="http://www.yohobuy.com/signin.html?refer="+window.escape(location.href+"#comment-info");break;case 400:alert(e.message);break;case 200:e.data&&(l.html(e.data.content),c.html(e.data.count),n(),o("#comment-info").val("").keyup())}u=!1}}))}var o=e("jquery"),s=e("lazyload"),r=o("#comment-area"),d=o(".detail-body").data("id"),l=r.find(".comments-wrap"),c=o("#article-comment > .comment-num"),u=!1,h=!1,p=o("#comment-btn"),f=100,m=o("#word-count-tip");e("js/guang/right-side"),e("js/guang/img-blink"),e("js/common/share"),e("jquery-pjax"),s({failure_limit:50}),o("#prise-btn").click(function(){var e,t=!1,a=o(this);t||(a.toggleClass("liked"),e=a.hasClass("liked")?"/guang/info/praise":"/guang/info/cancelPraise",t=!0,o.ajax({type:"GET",url:e,data:{id:d}}).then(function(e){200===e.code&&a.find(".like-num").html(e.data),t=!1}))}).bind("mouseenter mouseleave",function(){o(this).toggleClass("hover")}),o("#collect-btn").click(function(){var e,t,a=!1,n=o(this);a||(n.hasClass("collected")?(e="/guang/info/cancelcollect",t=0):(e="/guang/info/collect",t=1),a=!0,o.ajax({type:"GET",url:e,data:{id:d}}).then(function(e){var i;switch(e.code){case 401:i=/\?col=(1|0)/.test(location.href)?location.href.replace(/\?col=(1|0)/,"?col="+t):location.href+"?col="+t,location.href="http://www.yohobuy.com/signin.html?refer="+encodeURI(i);break;case 400:break;case 200:/\?col=(1|0)/.test(location.href)?location.href=location.href.replace(/\?col=(1|0)/,""):n.toggleClass("collected")}a=!1}))}).bind("mouseenter mouseleave",function(){o(this).toggleClass("hover")}),n(),p.click(function(e){return h||u?!1:void(o("#comment-info").val().length-f>0||(e.preventDefault(),i(d)))}),o(document).pjax(".comment-pager a","#pjax-container",{timeout:5e3}),o(document).on("pjax:end",function(){n(),o("html,body").scrollTop(o("#comment-info").offset().top)}),o("#comment-info").keyup(function(){var e,t=o(this).val().length;0===t?(m.html(""),p.addClass("disable")):0>=t-f?(e="还可以输入"+(f-t)+"字",p.removeClass("disable")):(e='已超过<span class="exceed-count">'+(t-f)+"</span>字",p.addClass("disable")),m.html(e)}),o("#comment-info").trigger("keyup")}),define("js/guang/index",["jquery","lazyload","dot","jquery-pjax"],function(e,t,a){var n=e("jquery"),i=e("js/guang/msg");e("jquery-pjax"),e("js/common/slider"),e("js/guang/img-blink"),e("js/guang/right-side"),n("#slider").slider(),n(document).pjax(".pjax-link, .msg-pager a","#pjax-container",{timeout:2e3}),n(document).on("pjax:end",function(){i.dotLazy()})}),define("js/home/entry",["jquery","handlebars","source-map","dot"],function(e,t,a){e("js/home/index"),e("js/home/orders"),e("js/home/favorite"),e("js/home/currency"),e("js/home/returns"),e("js/home/comment"),e("js/home/complaints"),e("js/home/message"),e("js/home/edit"),e("js/home/gift"),e("js/home/validate"),e("js/home/address"),e("js/home/common-address")}),define("js/home/index",["jquery","handlebars","source-map"],function(e,t,a){var n=e("jquery");e("js/home/order-block"),n("#close-message").click(function(){n(".message-tip").slideUp(200)}),function(){var e=n(".na-pager"),t=n(".new-arrival ul"),a=Math.ceil(t.children("li").length/5),i=t.children("li:last-child").outerWidth(),o=1;t.width(t.width()*a),e.click(function(){var e,s=n(this);s.hasClass("next")?(++o,2===o&&s.siblings().removeClass("no-visible"),o===a&&s.addClass("no-visible")):(--o,o===a-1&&s.siblings().removeClass("no-visible"),1===o&&s.addClass("no-visible")),e=-5*(o-1)*i,t.animate({marginLeft:e},400)})}()}),define("js/home/order-block",["jquery","handlebars","source-map"],function(e,t,a){function n(e){var t={mask:!1,btns:[{id:"cancel-sure",name:"确定并取消订单",btnClass:["cancel-sure"],cb:function(){var t=o(".cancel-dialog :checked"),a=o(".cancel-dialog .cancel-tip");return 0===t.length?void a.html("请选择要取消订单的原因"):void o.ajax({type:"POST",url:"/home/orders/cancelorder",data:{orderCode:e,reason:t.val()}}).then(function(e){200===e.code?(i.close(),history.go(0)):a.html(e.message)})}},{id:"cancel-no",name:"取消",btnClass:["cancel-no"],cb:function(){i.close()}}],content:c,className:"cancel-dialog"};return new r(t)}var i,o=e("jquery"),s=e("js/common/dialog"),r=s.Dialog,d=s.Confirm,l=o("#cancel-dialog-tpl"),c=l.html();l.remove(),o(".check-logistics").click(function(){o(this).siblings(".logistics").removeClass("hide")}),o(".close-logistics").click(function(){o(this).closest(".logistics").addClass("hide")}),o(".me-orders, .order-detail").on("click",".cancel-order",function(e){i=n(o(this).closest(".order, .order-detail").data("id")),i.show()}).on("click",".confirm-received",function(e){var t=o(this).closest(".order, .order-detail").data("id");i=new d({cb:function(){o.ajax({type:"POST",url:"/home/orders/confirmorder",data:{orderCode:t}}).then(function(e){200===e.code&&(i.close(),history.go(0))})},content:"您确定要确认收货吗?"}),i.show()})}),define("js/home/orders",["jquery","handlebars","source-map"],function(e,t,a){e("js/home/order-block")}),define("js/home/favorite",["jquery","handlebars","source-map","dot"],function(e,t,a){var n,i,o,s=e("jquery"),r=e("handlebars"),d=e("js/passport/mail-phone-regx").phoneRegx["+86"],l={on:"[ 降价通知 ]",off:"[ 取消通知 ]"},c=location.href.match(/type=(.*)[&]*/);e("dot"),function(){function e(e){y=1*e,u.text(e),f.find(".notice-num").text(5-e)}function t(){c.addClass("hide"),h.addClass("hide"),v.text("订阅成功")}function a(){var t=s(document).scrollTop()+s(window).height()/2;"undefined"==typeof c&&(s("body").append('<div class="body-mask hide"></div>'),c=s(".body-mask")),c.css({height:s(document).height(),width:s(document).width()}).removeClass("hide"),h.removeClass("error"),o.hasClass("noticed")?s.ajax({type:"GET",url:"/home/favorite/cancelnotice",data:{id:i}}).then(function(a){200===a.code?(e(a.data.num),p.addClass("hide"),f.removeClass("hide"),v.text("取消成功"),h.removeClass("hide").css({top:t}),o.closest(".reduction-products").length>0?o.closest(".fav-good").remove():o.removeClass("noticed").text(l.on)):a.message&&(m.text(a.message),h.removeClass("hide").addClass("error").css({top:t}))}):y>=5?(m.text("您的订阅数已经到达上限"),h.removeClass("hide").addClass("error").css({top:t})):(p.removeClass("hide"),f.addClass("hide"),h.removeClass("hide").css({top:t}))}var n,r,c,u,h,p,f,m,v,g,y,b={};0!==s(".fav-products").length&&(n=s(".default-sorts"),r=s(".all-sorts"),u=s(".reduction-notice span"),h=s(".price-notice"),p=s("#price-notice .content"),f=s("#price-notice .success"),m=s("#price-notice .error-message"),v=f.find(".subscribe-or-cancel"),g=s("#notice-phone-num"),b.phone=g.val(),b.change=!1,y=1*u.text(),s("#spread-sort").click(function(){n.slideUp(function(){r.slideDown()})}),s("#retract-sort").click(function(){r.slideUp(function(){
n.slideDown()})}),s(".price-down-clock").click(function(){o=s(this),i=o.closest(".fav-good").data("id"),a()}),s('.reduction-filter input[type="checkbox"]').change(function(){location.href=s(this).parent().attr("href")}),s("#price-notice").on("click",".close",function(){t()}).on("click",".price-notice-sure",function(){var a,n;if(h.hasClass("error")||p.hasClass("hide"))t();else{if(a=s.trim(g.val()),""===a||!d.test(a))return n=""===a?"请输入手机号码":"手机号码格式不正确",g.addClass("error"),void s("#price-notice .err-text").removeClass("hide").find("em").html(n);if(g.removeClass("error"),s("#price-notice .err-text").addClass("hide"),""!==b.phone&&b.phone!==a&&!b.change)return s("#price-notice .phone-diff").removeClass("hide"),void(b.change=!0);s.ajax({type:"GET",url:"/home/favorite/notice",data:{mobile:a,id:i}}).then(function(t){200===t.code?(e(t.data.num),f.removeClass("hide"),p.addClass("hide"),b.phone=a,b.change=!1,s("#price-notice .phone-diff").addClass("hide"),o.toggleClass("noticed").text(l.off)):t.message&&(m.text(t.message),h.removeClass("hide").addClass("error"))})}}),s(".has-activity").click(function(){var e=s(this),t=e.next(".activites"),a=e.closest("li");t.hasClass("hide")?(t.removeClass("hide"),a.css("padding-bottom",t.outerHeight())):(t.addClass("hide"),a.css("padding-bottom",""))}))}(),function(){function e(e,t){var a=e.data("id"),i=e.find(".na-goods-ul"),o=n[a],s=o.cur?o.cur:1,r=Math.ceil(o.total/5),d=e.find(".na-pre"),l=e.find(".na-next");s+=t,d.removeClass("hidden"),l.removeClass("hidden"),1===s&&d.addClass("hidden"),s===r&&l.addClass("hidden"),i.animate({marginLeft:-(s-1)*i.parent(".na-goods").width()},200),o.cur=s}function t(e,t){e.css("padding-bottom",t.outerHeight()+10)}var a,n={};0!==s(".fav-brands").length&&(a=r.compile(s("#na-tpl").html()),s(".na-trigger").click(function(){var e,i=s(this),o=i.next(".na-list"),r=i.closest("li");return o.hasClass("hide")?(e=r.data("id"),n[e]&&n[e].cache?(o.removeClass("hide"),void t(r,o)):void s.ajax({type:"GET",url:"/home/favorite/newproduct",data:{id:e}}).then(function(i){var s,d,l;200===i.code&&(d=i.data,l=0===d.length?{}:{naGoods:d},s=a(l),o.removeClass("hide").find(".na-content").html(s),t(r,o),d.length>5&&r.find(".na-next").removeClass("hidden"),n[e]||(n[e]={}),n[e].cache=!0,n[e].total=d.length)})):(o.addClass("hide"),void r.css("padding-bottom",""))}),s(".na-content").on("click",".na-pre, .na-next",function(){var t=s(this),a=t.hasClass("na-pre")?-1:1;e(t.closest(".fav-brand"),a)}))}(),function(){s(".fav-articles").length<0||s(".fav-articles .desc").dotdotdot()}(),c&&c.length&&(n=c[1]),s("#me-checkall").click(function(){s('.checkbox input[type="checkbox"]').prop("checked",s(this).prop("checked"))}),s(".del-favorite").click(function(e){var t=s(this).closest(".fav-row").data("id");e.preventDefault(),s.ajax({type:"GET",url:"/home/favorite/cancel",data:{id:t,type:n}}).then(function(e){200===e.code&&history.go(0)})}),s("#me-del-checked").click(function(){var e=[],t="商品";if("brand"===n?t="品牌":"article"===n&&(t="文章"),confirm("您确定要删除您收藏的"+t+"吗?")){if(s('.checkbox input[type="checkbox"]:checked').each(function(){e.push(s(this).closest(".fav-row").data("id"))}),0===e.length)return void alert("请选中您要移除的"+t);s.ajax({type:"GET",url:"/home/favorite/cancel",data:{id:e.join(","),type:n}}).then(function(e){200===e.code&&history.go(0)})}}),location.href.match(/is_reduction=(.*)[&]*/)&&s(".reductionChecked").attr("checked",!0),location.href.match(/is_promotion=(.*)[&]*/)&&s(".activityChecked").attr("checked",!0)}),define("js/home/currency",["jquery"],function(e,t,a){var n=e("jquery");n(".filter-select").change(function(){location.href=n(this).val()})}),define("js/home/returns",["jquery","handlebars","source-map"],function(e,t,a){e("js/home/returns-detail"),e("js/home/returns-apply")}),define("js/home/returns-detail",["jquery"],function(e,t,a){function n(){v=g[f]?g[f]:"",h.html(v+" 快递单号:"+m),c.val(f),u.val(m)}function i(){var e={};if(e.number=u.val(),e.id=1*c.val(),e.id){if(e.number)return e;alert("请填入快递单号")}else alert("请选择快递公司");return!1}function o(){var e=i();e&&s.ajax({type:"POST",url:"/home/returns/setExpressNumber",data:{id:p,isChange:y,expressId:e.id,expressNumber:e.number,expressCompany:g[e.id]}}).then(function(t){200===t.code?(f=e.id,m=e.number,r.eq(2).addClass("act")):alert(t.message),n(),l.removeClass("in-edit")})}var s=e("jquery"),r=s(".visual-return-state li"),d=s(".detail-container"),l=s(".courier-code"),c=s("#express-company"),u=s("#express-number"),h=s(".express-view-box > span"),p=s("#return-id").val(),f=s("#express-old-id").val(),m=u.val(),v="",g={},y=!1;d.parent().hasClass("exchange-detail")&&(y=!0),c.val(f),d.find(".company-list").each(function(){var e=s(this).data();g[e.id]=e.name}),s("#modify").click(function(){l.addClass("in-edit")}),s("#submit-btn").click(function(){o()})}),define("js/home/returns-apply",["jquery","handlebars","source-map"],function(e,t,a){function n(e){l.ajax({type:"POST",url:"/home/returns/getDelivery",data:{areaCode:e}}).then(function(e){var t="";200===e.code&&(l.each(e.data,function(e,a){var n="";"Y"===a.is_default&&(n='checked="checked"'),t+='<input type="radio" name="delivery-tpye" value="'+a.id+'" '+n+'"">'+a.name}),_.html(t))})}function i(){var e=[],t="换货";return I&&(t="退货"),h.length||(P="没有可以"+t+"的商品"),h.each(function(){var a,n=l(this).parent().parent(),i=n.next();P.length||l(this).prop("checked")&&(a={product_skn:n.find('input[name="skn"]').val(),product_skc:n.find('input[name="skc"]').val(),product_sku:n.find('input[name="sku"]').val(),goods_type:n.find('input[name="typeid"]').val(),last_price:n.find('input[name="price"]').val(),reason:1*n.find(".return-reason").val()},I?a.returned_reason=a.reason:(a.exchange_reason=a.reason,a.new_goods_id=1*n.find(".exchange-color").val(),a.new_product_sku=1*n.find(".exchange-size").val(),P||a.new_goods_id||(P="请选择要换的颜色"),P||a.new_product_sku||(P="请选择要换的尺码")),P||a.reason||(P="请选择"+t+"原因"),(4===a.reason||6===a.reason||8===a.reason)&&(a.remark=l.trim(i.find("textarea").val()),a.evidence_images=[],i.find('input[name="imgs"]').each(function(){a.evidence_images.push(l(this).val())}),P||a.remark||(P="请填写"+t+"描述"),P||a.evidence_images.length||(P="请上传图片")),delete a.reason,e.push(a))}),P||e.length||(P="请选择要"+t+"的商品"),e}function o(){var e={};return e.goods=i(),e.payment={},m.each(function(){l(this).prop("checked")&&(e.payment.return_amount_mode=1*l(this).val())}),P||e.payment.return_amount_mode||(P="请选择退款方式"),2===e.payment.return_amount_mode?(e.payment.province=v.val(),e.payment.city=g.val(),e.payment.area_code=y.val(),!P&&1*!e.payment.area_code&&(P="请选择银行所在地"),e.payment.bank_name=l.trim(b.find('input[name="bank-name"]').val()),P||e.payment.bank_name||(P="请填写银行名称"),e.payment.payee_name=l.trim(b.find('input[name="payee-name"]').val()),P||e.payment.payee_name||(P="请填写收款人姓名"),e.payment.bank_card=l.trim(b.find('input[name="bank-card"]').val()),P||e.payment.bank_card||(P="请填写收款账户")):3===e.payment.return_amount_mode&&(e.payment.alipay_name=l.trim(b.find('input[name="alipay-name"]').val()),P||e.payment.alipay_name||(P="请填写收款人姓名"),e.payment.alipay_account=l.trim(b.find('input[name="alipay-account"]').val()),P||e.payment.alipay_account||(P="请填写收款账户")),e}function s(){var e={};return e.goods=i(),e.consigneeName=l.trim(k.find('input[name="name"]').val()),P||e.consigneeName||(P="请填写收货人姓名"),e.areaCode=y.val(),!P&&1*!e.areaCode&&(P="请选择地区"),e.address=l.trim(k.find('input[name="address"]').val()),P||e.address||(P="请填写详细地址"),e.mobile=l.trim(k.find('input[name="phone"]').val()),e.mobile===S?e.mobile=D:P||e.mobile||(P="请填写手机号"),e.zipCode=l.trim(k.find('input[name="postcode"]').val()),e.deliveryType=k.find('input[name="delivery-tpye"]:checked').val(),P||e.deliveryType||(P="请选择商品返回方式"),e}function r(e){var t="○";e?(q.addClass("applying"),d=setInterval(function(){T.text(t),t.length>3&&(t=""),t+="○"},600)):(q.addClass("applying"),clearInterval(d))}var d,l=e("jquery"),c=e("js/home/common-address"),u=l("#goods-table"),h=u.find('input[type="checkbox"]'),p=u.find(".return-reason"),f=u.find("input[type=file]"),m=l('input[name="refund-type"]'),v=l("#province"),g=l("#city"),y=l("#area"),b=l("#refund-pay-info"),w=b.find(".type-yoho"),C=b.find(".type-bank"),x=b.find(".type-alipay"),k=l(".exchange-detail"),j=k.find('input[name="hide-phone"]'),_=k.find(".refund-mode"),q=l(".submit-box"),T=q.find(".wait-gif span"),I=0,A=l("#order-code").val(),E=k.find('input[name="hide-area"]').val(),D=j.val(),S="",P="",$={};e("plugin/jquery.upload"),D&&(j.remove(),S=D.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"),k.find('input[name="phone"]').val(S)),b.length?I=1:n(E),E=E?E:"",c.loadAllData(E,{areaDomId:"area"}),u.find(".sizeinfo").each(function(){var e=[];l(this).children().each(function(){e.push(l(this).data())}),$[l(this).data().id]=e}),p.change(function(){var e=l(this).parent().parent(),t=1*l(this).val();4===t||6===t||8===t?e.next().show():e.next().hide()}),h.change(function(){var e=l(this).parent().parent();l(this).prop("checked")?e.find("select").prop("disabled",!1):(e.find("select").val(0).prop("disabled",!0),e.next().hide())}),u.on("change",".exchange-color",function(){var e=l(this).closest(".exchange-choose-wrap"),t='<option value="0">请选择尺码</option>',a=l(this).val();$[a]&&l.each($[a],function(e,a){t+='<option value="'+a.id+'">'+a.name+"</option>"}),e.find(".exchange-size").html(t).val(0)}),u.on("click",".btn-del",function(){l(this).parent().empty()}),f.each(function(e){l("#upload-img-"+e).upload({auto:!0,buttonClass:"upload-img-btn",fileType:"image/*",uploadScript:"/home/returns/imgUpload",fileObjName:"fileData",fileSizeLimit:5e3,buttonText:"上传图片",height:34,width:116,multi:!1,onUploadComplete:function(e,t){var a,n,i=l(this).closest(".problem-description"),o=i.find("li"),s=!1;a=JSON.parse(t).imgList[0],n='<span class="btn-del" title="删除"></span><img src="'+a.imgUrl+'" width="126" height="126"><input type="hidden" name="imgs" value="'+a.imgRelUrl+'">',o.each(function(){s||l(this).find("img").length||(s=!0,l(this).html(n))})},onError:function(e,t,a){var n="图片上传失败!";"FILE_SIZE_LIMIT_EXCEEDED"===e&&(n="图片大小超出限制!"),alert(n)}})}),k.on("change","#area",function(){var e=1*l(this).val();e&&n(e)}),m.change(function(){var e=1*l(this).val();w.hide(),2===e?(C.show(),x.hide(),w.hide()):3===e?(x.show(),C.hide(),w.hide()):4===e&&(w.show(),C.hide(),x.hide())}),l(".save-btn").click(function(){var e,t;return P="",I?(e="/home/returns/saveRefund",t=o()):(e="/home/returns/saveExchange",t=s()),t.orderCode=A,P?void alert(P):(r(!0),void l.ajax({type:"POST",url:e,data:t}).then(function(e){200===e.code?e.data&&e.data.refer&&(window.location.href=e.data.refer):(alert(e.message),r())}))})}),define("js/home/common-address",["jquery","handlebars","source-map"],function(e,t,a){var n=e("jquery"),i=e("js/common/dialog"),o=i.Alert,s={provinceDomId:"province",cityDomId:"city",areaDomId:"areaCode",initDomIds:function(e){var t=this;void 0!==e.provinceDomId&&(t.provinceDomId=e.provinceDomId),void 0!==e.cityDomId&&(t.cityDomId=e.cityDomId),void 0!==e.areaDomId&&(t.areaDomId=e.areaDomId)},loadAreaData:function(e,t,a,i){var s,r,d,l,c=this,u=n("#"+t),h=0,p="";u.empty(),91>e&&(n("#"+c.areaDomId).empty(),n("#county").attr("disabled","disabled")),n.ajax({type:"GET",url:"/home/address/area",data:"id="+e,success:function(e){if(e.code=200,200!==e.code)return s=new o("暂无数据"),s.show(),!1;u.append('<option value="0">'+a+"</option>");for(h in e.options)e.options[h]&&(r=e.options[h],p=t===c.areaDomId&&"Y"===r.is_support?"*":"",d=r.value,l="","undefined"!=typeof i&&0!==i&&d===i.substr(0,d.length)&&(l="selected"),u.append('<option value="'+d+'" '+l+">"+p+r.text+"</option>"))}})},bindAreaChange:function(e){var t=this;void 0===n("#"+t.provinceDomId).data("events")&&(n("#"+t.provinceDomId).change(function(){var a=n("#"+t.provinceDomId).val();"0"!==a&&(t.loadAreaData(a,t.cityDomId,"请选择城市",a),n("#"+t.areaDomId).hide(),t.showAreaSel(e.dispDomId))}),n("#"+this.cityDomId).change(function(){var a=n("#"+t.cityDomId).val();"0"!==a&&(t.loadAreaData(a,t.areaDomId,"请选择区县",a),n("#"+t.areaDomId).show(),t.showAreaSel(e.dispDomId))}),n("#"+t.areaDomId).change(function(){t.showAreaSel(e.dispDomId)}),t.showAreaSel(e.dispDomId))},showAreaSel:function(e){var t=this,a="",i=n("#"+t.provinceDomId).find("option:selected").text(),o=n("#"+t.cityDomId).find("option:selected").text(),s=n("#"+t.areaDomId).find("option:selected").text();void 0!==e&&""!==e&&(i.indexOf("选择")<0&&(a=i),""!==o&&o.indexOf("选择")<0&&(a+=","+o),""!==s&&s.indexOf("选择")<0&&(a+=","+s),n("#"+e).html(a))},loadAllData:function(e,t){var a=this;a.initDomIds(t),e+="",91>e?(a.loadAreaData(0,a.provinceDomId,"请选择省份",""),n("#"+a.areaDomId).hide(),n("#"+a.cityDomId).html('<option value="0">请选择市</option>')):4===e.length?(a.loadAreaData(0,a.provinceDomId,"请选择省份",e),a.loadAreaData(e.substr(0,2),a.cityDomId,"请选择城市",e),a.loadAreaData(e,a.areaDomId,"请选择区县",e),n("#"+a.areaDomId).show()):6===e.length&&(a.loadAreaData(0,a.provinceDomId,"请选择省份",e),a.loadAreaData(e.substr(0,2),a.cityDomId,"请选择城市",e),a.loadAreaData(e.substr(0,4),a.areaDomId,"请选择区县",e),n("#"+this.areaDomId).show()),a.bindAreaChange(t)}};a.exports=s}),define("plugin/jquery.upload",["jquery"],function(e,t,a){var n=e("jquery");!function(e){var t={init:function(a){return this.each(function(){var n=e(this);n.data("uploadifive",{inputs:{},inputCount:0,fileID:0,queue:{count:0,selected:0,replaced:0,errors:0,queued:0,cancelled:0},uploads:{current:0,attempts:0,successful:0,errors:0,count:0}});var o=n.data("uploadifive"),s=o.settings=e.extend({auto:!0,buttonClass:!1,buttonText:"Select Files",checkScript:!1,dnd:!0,dropTarget:!1,fileObjName:"Filedata",fileSizeLimit:0,fileType:!1,formData:{},height:30,itemTemplate:!1,method:"post",multi:!0,overrideEvents:[],queueID:!1,queueSizeLimit:0,removeCompleted:!1,simUploadLimit:0,truncateLength:0,uploadLimit:0,uploadScript:"uploadifive.php",width:100},a);if(isNaN(s.fileSizeLimit)){var r=1.024*parseInt(s.fileSizeLimit);s.fileSizeLimit.indexOf("KB")>-1?s.fileSizeLimit=1e3*r:s.fileSizeLimit.indexOf("MB")>-1?s.fileSizeLimit=1e6*r:s.fileSizeLimit.indexOf("GB")>-1&&(s.fileSizeLimit=1e9*r)}else s.fileSizeLimit=1024*s.fileSizeLimit;if(o.inputTemplate=e('<input type="file">').css({"font-size":s.height+"px",opacity:0,position:"absolute",right:"-3px",top:"-3px","z-index":999}),o.createInput=function(){var a=o.inputTemplate.clone(),i=a.name="input"+o.inputCount++;s.multi&&a.attr("multiple",!0),s.fileType&&a.attr("accept",s.fileType),a.bind("change",function(){o.queue.selected=0,o.queue.replaced=0,o.queue.errors=0,o.queue.queued=0;var a=this.files.length;if(o.queue.selected=a,o.queue.count+a>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(n,"QUEUE_LIMIT_EXCEEDED");else{for(var r=0;a>r;r++)file=this.files[r],o.addQueueItem(file);o.inputs[i]=this,o.createInput()}s.auto&&t.upload.call(n),"function"==typeof s.onSelect&&s.onSelect.call(n,o.queue)}),o.currentInput&&o.currentInput.hide(),o.button.append(a),o.currentInput=a},o.destroyInput=function(t){e(o.inputs[t]).remove(),delete o.inputs[t],o.inputCount--},o.drop=function(a){o.queue.selected=0,o.queue.replaced=0,o.queue.errors=0,o.queue.queued=0;var i=a.dataTransfer,r=i.name="input"+o.inputCount++,d=i.files.length;if(o.queue.selected=d,o.queue.count+d>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(n,"QUEUE_LIMIT_EXCEEDED");else{for(var l=0;d>l;l++)file=i.files[l],o.addQueueItem(file);o.inputs[r]=i}s.auto&&t.upload.call(n),"function"==typeof s.onDrop&&s.onDrop.call(n,i.files,i.files.length),a.preventDefault(),a.stopPropagation()},o.fileExistsInQueue=function(e){for(var t in o.inputs){input=o.inputs[t],limit=input.files.length;for(var a=0;a<limit;a++)if(existingFile=input.files[a],existingFile.name==e.name&&!existingFile.complete)return!0}return!1},o.removeExistingFile=function(e){for(var a in o.inputs){input=o.inputs[a],limit=input.files.length;for(var i=0;i<limit;i++)existingFile=input.files[i],existingFile.name!=e.name||existingFile.complete||(o.queue.replaced++,t.cancel.call(n,existingFile,!0))}},0==s.itemTemplate?o.queueItem=e('<div class="uploadifive-queue-item">                        <a class="close" href="#">X</a>                        <div><span class="filename"></span><span class="fileinfo"></span></div>                        <div class="progress">                            <div class="progress-bar"></div>                        </div>                    </div>'):o.queueItem=e(s.itemTemplate),o.addQueueItem=function(a){if(e.inArray("onAddQueueItem",s.overrideEvents)<0){o.removeExistingFile(a),a.queueItem=o.queueItem.clone(),a.queueItem.attr("id",s.id+"-file-"+o.fileID++),a.queueItem.find(".close").bind("click",function(){return t.cancel.call(n,a),!1});var i=a.name;i.length>s.truncateLength&&0!=s.truncateLength&&(i=i.substring(0,s.truncateLength)+"..."),a.queueItem.find(".filename").html(i),a.queueItem.data("file",a),o.queueEl.append(a.queueItem)}"function"==typeof s.onAddQueueItem&&s.onAddQueueItem.call(n,a),a.size>s.fileSizeLimit&&0!=s.fileSizeLimit?o.error("FILE_SIZE_LIMIT_EXCEEDED",a):(o.queue.queued++,o.queue.count++)},o.removeQueueItem=function(t,a,n){n||(n=0);var i=a?0:500;t.queueItem&&(" - Completed"!=t.queueItem.find(".fileinfo").html()&&t.queueItem.find(".fileinfo").html(" - Cancelled"),t.queueItem.find(".progress-bar").width(0),t.queueItem.delay(n).fadeOut(i,function(){e(this).remove()}),delete t.queueItem,o.queue.count--)},o.filesToUpload=function(){var e=0;for(var t in o.inputs){input=o.inputs[t],limit=input.files.length;for(var a=0;a<limit;a++)file=input.files[a],file.skip||file.complete||e++}return e},o.checkExists=function(a){if(e.inArray("onCheck",s.overrideEvents)<0){e.ajaxSetup({async:!1});var i=e.extend(s.formData,{filename:a.name});if(e.post(s.checkScript,i,function(e){a.exists=parseInt(e)}),a.exists&&!confirm("A file named "+a.name+" already exists in the upload folder.\nWould you like to replace it?"))return t.cancel.call(n,a),!0}return"function"==typeof s.onCheck&&s.onCheck.call(n,a,a.exists),!1},o.uploadFile=function(t,a){if(!t.skip&&!t.complete&&!t.uploading)if(t.uploading=!0,o.uploads.current++,o.uploads.attempted++,xhr=t.xhr=new XMLHttpRequest,"function"==typeof FormData||"object"==typeof FormData){var r=new FormData;r.append(s.fileObjName,t);for(i in s.formData)r.append(i,s.formData[i]);xhr.open(s.method,s.uploadScript,!0),xhr.upload.addEventListener("progress",function(e){e.lengthComputable&&o.progress(e,t)},!1),xhr.addEventListener("load",function(e){4==this.readyState&&(t.uploading=!1,200==this.status?"Invalid file type."!==t.xhr.responseText?o.uploadComplete(e,t,a):o.error(t.xhr.responseText,t,a):404==this.status?o.error("404_FILE_NOT_FOUND",t,a):403==this.status?o.error("403_FORBIDDEN",t,a):o.error("Unknown Error",t,a))}),xhr.send(r)}else{var d=new FileReader;d.onload=function(i){var r="-------------------------"+(new Date).getTime(),d="--",l="\r\n",c="";c+=d+r+l,c+='Content-Disposition: form-data; name="'+s.fileObjName+'"',t.name&&(c+='; filename="'+t.name+'"'),c+=l,c+="Content-Type: application/octet-stream"+l+l,c+=i.target.result+l;for(key in s.formData)c+=d+r+l,c+='Content-Disposition: form-data; name="'+key+'"'+l+l,c+=s.formData[key]+l;c+=d+r+d+l,xhr.upload.addEventListener("progress",function(e){o.progress(e,t)},!1),xhr.addEventListener("load",function(e){t.uploading=!1;var n=this.status;404==n?o.error("404_FILE_NOT_FOUND",t,a):"Invalid file type."!=t.xhr.responseText?o.uploadComplete(e,t,a):o.error(t.xhr.responseText,t,a)},!1);var u=s.uploadScript;if("get"==s.method){var h=e(s.formData).param();u+=h}xhr.open(s.method,s.uploadScript,!0),xhr.setRequestHeader("Content-Type","multipart/form-data; boundary="+r),"function"==typeof s.onUploadFile&&s.onUploadFile.call(n,t),xhr.sendAsBinary(c)},d.readAsBinaryString(t)}},o.progress=function(t,a){if(e.inArray("onProgress",s.overrideEvents)<0){if(t.lengthComputable)var i=Math.round(t.loaded/t.total*100);a.queueItem.find(".fileinfo").html(" - "+i+"%"),a.queueItem.find(".progress-bar").css("width",i+"%")}"function"==typeof s.onProgress&&s.onProgress.call(n,a,t)},o.error=function(a,i,r){if(e.inArray("onError",s.overrideEvents)<0){switch(a){case"404_FILE_NOT_FOUND":errorMsg="404 Error";break;case"403_FORBIDDEN":errorMsg="403 Forbidden";break;case"FORBIDDEN_FILE_TYPE":errorMsg="Forbidden File Type";break;case"FILE_SIZE_LIMIT_EXCEEDED":errorMsg="File Too Large";break;default:errorMsg="Unknown Error"}i.queueItem.addClass("error").find(".fileinfo").html(" - "+errorMsg),i.queueItem.find(".progress").remove()}"function"==typeof s.onError&&s.onError.call(n,a,i),i.skip=!0,"404_FILE_NOT_FOUND"==a?o.uploads.errors++:o.queue.errors++,r&&t.upload.call(n,null,!0)},o.uploadComplete=function(a,i,r){e.inArray("onUploadComplete",s.overrideEvents)<0&&(i.queueItem.find(".progress-bar").css("width","100%"),i.queueItem.find(".fileinfo").html(" - Completed"),i.queueItem.find(".progress").slideUp(250),i.queueItem.addClass("complete")),"function"==typeof s.onUploadComplete&&s.onUploadComplete.call(n,i,i.xhr.responseText),s.removeCompleted&&setTimeout(function(){t.cancel.call(n,i)},3e3),i.complete=!0,o.uploads.successful++,o.uploads.count++,o.uploads.current--,delete i.xhr,r&&t.upload.call(n,null,!0)},o.queueComplete=function(){"function"==typeof s.onQueueComplete&&s.onQueueComplete.call(n,o.uploads)},!(window.File&&window.FileList&&window.Blob&&(window.FileReader||window.FormData)))return"function"==typeof s.onFallback&&s.onFallback.call(n),!1;if(s.id="uploadifive-"+n.attr("id"),o.button=e('<div id="'+s.id+'" class="uploadifive-button">'+s.buttonText+"</div>"),s.buttonClass&&o.button.addClass(s.buttonClass),o.button.css({height:s.height,"line-height":s.height+"px",overflow:"hidden",position:"relative","text-align":"center",width:s.width}),n.before(o.button).appendTo(o.button).hide(),o.createInput.call(n),s.queueID?o.queueEl=e("#"+s.queueID):(s.queueID=s.id+"-queue",o.queueEl=e('<div id="'+s.queueID+'" class="uploadifive-queue" />'),o.button.after(o.queueEl)),s.dnd){var d=s.dropTarget?e(s.dropTarget):o.queueEl.get(0);d.addEventListener("dragleave",function(e){e.preventDefault(),e.stopPropagation()},!1),d.addEventListener("dragenter",function(e){e.preventDefault(),e.stopPropagation()},!1),d.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation()},!1),d.addEventListener("drop",o.drop,!1)}XMLHttpRequest.prototype.sendAsBinary||(XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var a=Array.prototype.map.call(e,t),n=new Uint8Array(a);this.send(n.buffer)}),"function"==typeof s.onInit&&s.onInit.call(n)})},debug:function(){return this.each(function(){console.log(e(this).data("uploadifive"))})},clearQueue:function(){this.each(function(){var a=e(this),n=a.data("uploadifive"),o=n.settings;for(var s in n.inputs)for(input=n.inputs[s],limit=input.files.length,i=0;i<limit;i++)file=input.files[i],t.cancel.call(a,file);"function"==typeof o.onClearQueue&&o.onClearQueue.call(a,e("#"+n.settings.queueID))})},cancel:function(a,n){this.each(function(){var i=e(this),o=i.data("uploadifive"),s=o.settings;"string"==typeof a&&(isNaN(a)||(fileID="uploadifive-"+e(this).attr("id")+"-file-"+a),a=e("#"+fileID).data("file")),a.skip=!0,o.filesCancelled++,a.uploading&&(o.uploads.current--,a.uploading=!1,a.xhr.abort(),delete a.xhr,t.upload.call(i)),e.inArray("onCancel",s.overrideEvents)<0&&o.removeQueueItem(a,n),"function"==typeof s.onCancel&&s.onCancel.call(i,a)})},upload:function(t,a){this.each(function(){var n=e(this),i=n.data("uploadifive"),o=i.settings;if(t)i.uploadFile.call(n,t);else if(i.uploads.count+i.uploads.current<o.uploadLimit||0==o.uploadLimit){if(!a){i.uploads.attempted=0,i.uploads.successsful=0,i.uploads.errors=0;var s=i.filesToUpload();"function"==typeof o.onUpload&&o.onUpload.call(n,s)}e("#"+o.queueID).find(".uploadifive-queue-item").not(".error, .complete").each(function(){return _file=e(this).data("file"),i.uploads.current>=o.simUploadLimit&&0!==o.simUploadLimit||i.uploads.current>=o.uploadLimit&&0!==o.uploadLimit||i.uploads.count>=o.uploadLimit&&0!==o.uploadLimit?!1:void(o.checkScript?(_file.checking=!0,skipFile=i.checkExists(_file),_file.checking=!1,skipFile||i.uploadFile(_file,!0)):i.uploadFile(_file,!0))}),0==e("#"+o.queueID).find(".uploadifive-queue-item").not(".error, .complete").size()&&i.queueComplete()}else 0==i.uploads.current&&(e.inArray("onError",o.overrideEvents)<0&&i.filesToUpload()>0&&0!=o.uploadLimit&&alert("The maximum upload limit has been reached."),"function"==typeof o.onError&&o.onError.call(n,"UPLOAD_LIMIT_EXCEEDED",i.filesToUpload()))})},destroy:function(){this.each(function(){var a=e(this),n=a.data("uploadifive"),i=n.settings;t.clearQueue.call(a),i.queueID||e("#"+i.queueID).remove(),a.siblings("input").remove(),a.show().insertBefore(n.button),n.button.remove(),"function"==typeof i.onDestroy&&i.onDestroy.call(a)})}};e.fn.upload=function(a){return t[a]?t[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?void e.error("The method "+a+" does not exist in $.uploadify"):t.init.apply(this,arguments)}}(n)}),define("js/home/comment",["jquery"],function(e,t,a){var n,i=e("jquery"),o=i(".comment-table"),s=o.find(".remark-btn"),r=i("#comment-dialog-widget"),d=r.find(".dialog-titlebar"),l=r.find("textarea"),c=i(document).width(),u=i(document).height(),h=i(window).height(),p={canmove:!1,offset:{},maxtop:0,maxleft:0},f={};s.each(function(){var e=i(this).next(),t=e.data(),a=t.orderid;f[a]={},f[a].productSkn=t.productskn,f[a].productId=t.productid,f[a].goodsId=t.goodsid,f[a].orderId=t.orderid,f[a].erpSkuId=t.erpskuid,e.remove(),i(this).data("code",a)}),s.click(function(){var e=i(document).scrollTop();n=i(this),l.val(""),r.removeClass("hide").css({top:e+(h-r.outerHeight())/2,left:(c-r.outerWidth())/2})}),d.bind("mousedown",function(e){i(e.target).hasClass("dialog-close-btn")||(p.canmove=!0,p.offset={x:e.offsetX,y:e.offsetY},p.maxtop=u-r.outerHeight(),p.maxleft=c-r.outerWidth())}),i(document).mousemove(function(e){var t,a;p.canmove&&(t=e.pageY-p.offset.y,a=e.pageX-p.offset.x,t=t<p.maxtop?t:p.maxtop,a=a<p.maxleft?a:p.maxleft,r.css({top:t>0?t:0,left:a>0?a:0}))}).mouseup(function(e){p.canmove=!1}),r.on("click",".dialog-save-btn",function(){var e,t=i.trim(l.val());return""===t?void alert("请添加评论内容"):void(n.length&&(e=f[n.data().code],e.content=t,i.ajax({type:"POST",url:"/home/comment/saveComment",data:e}).then(function(e){var a=n.parent();200===e.code?(a.prev().text(t),a.html('<span class="remarked">已评论!</span>'),n.length=0,r.addClass("hide")):alert(e.message)})))}),r.on("click",".dialog-close-btn",function(){n.length=0,r.addClass("hide")})}),define("js/home/complaints",["jquery"],function(e,t,a){function n(){return m?!0:(m=!0,setTimeout(function(){m=!1},1e3),!1)}function i(e){var t=e.dom.siblings(".option-tip"),a=d.trim(e.dom.val()),n=a.length;return e.min&&n<e.min?(t.text(e.onmin),!1):e.max&&n>e.max?(t.text(e.onmax),!1):e.regexp&&!e.regexp.test(a)?(t.text(e.onerror),!1):(t.text("输入正确"),!0)}function o(){var e,t={};return d.each(v,function(a,n){i(n)?t[a]=d.trim(n.dom.val()):e||(e=a,n.dom.focus())}),t.complaintsType=h.val(),e?!1:t}function s(){var e=o();!n()&&e&&d.ajax({type:"POST",url:"/home/complaints/addcomplaints",data:e}).then(function(e){m=!1,200===e.code?window.location.reload():alert(e.message)})}function r(e,t){var a=t;n()||d.ajax({type:"POST",url:"/home/complaints/cancelcomplaints",data:{id:e}}).then(function(e){m=!1,200===e.code?(a.prev().remove(),a.text("问题已撤销")):alert(e.message)})}var d=e("jquery"),l=d(".cancel-btn"),c=d("#title"),u=d("#customer"),h=d("#complaintsType"),p=d("#orderCode"),f=d("#content"),m=!1,v={title:{dom:c,min:1,max:10,onshow:"请输入您的投诉主题",onfocus:"请输入主题",onmin:"投诉主题不能为空",onmax:"输入投诉主题不能超过10个字"},customer:{dom:u,min:1,max:10,onshow:"请填写您要投诉的对象,比如:客服00*号、发货员...",onfocus:"请填写您要投诉的对象",onmin:"投诉对象不能为空",onmax:"输入投诉对象不能超过10个字"},orderCode:{dom:p,regexp:/^([0-9,]{9,})$/,onshow:"如果多个是多个订单号,请用英文逗号隔开,没有则不填",onfocus:"请输入订单号",onerror:"您输入的订单格式不对,如果多个是多个订单号,请用英文逗号隔开"},content:{dom:f,min:1,max:130,onshow:"输入您投诉的内容",onfocus:"请输入您投诉的内容",onmin:"投诉内容不能为空",onmax:"输入的投诉内容不能超过130个字"}};d.each(v,function(e,t){t.dom.focus(function(){t.dom.siblings(".option-tip").text(t.onfocus)}).blur(function(){i(t)})}),d("#complaint-submit").click(function(){s()}),l.click(function(){var e=d(this).data();e&&e.id&&r(e.id,d(this).parent())})}),define("js/home/message",["jquery"],function(e,t,a){function n(){var e=!1;o=r.find(".msg-check:checked"),c=[],o.each(function(){var t=s(this).parent().parent();c.push(s(this).val()),t.hasClass("new-msg")&&(e=!0)}),e?l.addClass("has-new"):l.removeClass("has-new")}function i(e,t){var a;switch(e){case"del":a="/home/message/delMessage";break;case"read":a="/home/message/readMessage"}s.ajax({type:"GET",url:a,data:t}).then(function(t){t.code?200===t.code?"read"===e&&(o.removeAttr("checked"),o.parent().parent().removeClass("new-msg"),n()):alert(t.message):"del"===e&&(r.html(t),d=r.find(".msg-check"),l=r.find(".read-choose-btn"))})}var o,s=e("jquery"),r=s("#message-main-container"),d=r.find(".msg-check"),l=r.find(".read-choose-btn"),c=[];e("js/home/message-content"),r.on("change",'input[type="checkbox"]',function(){var e=s(this).attr("checked");s(this).hasClass("choose-all")&&("checked"===e?d.attr("checked",!0):d.removeAttr("checked")),n()}),r.on("click",".del-btn",function(){confirm("您确定要删除这条短消息?")&&i("del",s(this).data())}),r.on("click",".del-choose-btn",function(){return c.length?void(confirm("确定要删除您选中的消息")&&i("del",{id:c.join(",")})):void alert("请选中您要删除的消息")}),r.on("click",".read-choose-btn",function(){s(this).hasClass("has-new")&&i("read",{id:c.join(",")})})}),define("js/home/message-content",["jquery"],function(e,t,a){var n=e("jquery"),i=n(".pick-coupon-btn"),o=!1;i.click(function(){var e=n(this).data();o||(o=!0,n.ajax({type:"GET",url:"/home/message/pickCoupon",data:e}).then(function(e){var t=e.message;200===e.code&&(t="领取成功",n(this).removeClass("pick-coupon-btn")),o=!1,alert(t)}))})}),define("js/home/edit",["jquery","handlebars","source-map"],function(e,t,a){function n(){var e=u("#nickname").val().length,t=u("#username").val().length,a=u('input[name="gender"]'),n=u("#year"),i=u("#month"),o=u("#day");return 0===e?(alert("请输入昵称"),!1):0===t?(alert("请输入用户名"),!1):e>=20?(alert("昵称最长为20个字符"),!1):a.is(":checked")?"0"===n.val()||"0"===i.val()||"0"===o.val()?(alert("请选择出生年月日"),!1):!0:(alert("请选择性别"),!1)}function i(){return"0"===u("#province").val()||"0"===u("#city").val()||"0"===u("#areaCode").val()?(alert("请选择所在区域"),!1):null===u("#province").val()||null===u("#city").val()||null===u("#areaCode").val()?(alert("请选择所在区域"),!1):0===u("#phone").val().length&&0===u("#mobile").val().length?(alert("电话和手机号码不能同时为空,请填写!"),!1):0===u("#fullAddress").val().length?(alert("请填写地址"),!1):0===u("#zipCode").val().length||u("#zipCode").val().length<2?(alert("请填写邮编"),!1):!0}function o(){return u(".user-habbit-info input").is(":checked")?!0:(alert("请填写购物&着装习惯"),!1)}function s(){return""===u("#likebrand").val()?(alert("请选择品牌"),!1):!0}function r(e){var t=u("#likebrand").val();return 0===parseInt(e)?!1:(u("#likebrand").val(t.replace(","+e+",",",")),u("#pp-"+e).attr("checked",!1),void u("#brand-"+e).remove())}function d(e,t,a){var n='<li id="brand-'+t+'">'+a+'<a href="javascript:void(0);" class="btn-del"></a></li>',i=u("#brand-"+t).html(),o=u("#likebrand").val(),s=u("#brand-box");return 0===parseInt(t)?!1:"undefined"!=typeof e&&""!==e&&e.checked===!1?(r(t),!1):i?(alert("您已经选择了该品牌."),!1):(s.append(n),s.find("li>a").off("click").on("click",function(){r(u(this).closest("li").attr("id").substr(6))}),o+=t+",",void u("#likebrand").val(o))}function l(){var e={brandName:u("#keywords").val()};u.post("/home/user/isbrandname",e,function(e){return 200===e.code?e.data.id&&e.data.brand_name?(d("",e.data.id,e.data.brand_name),
u("#keywords").val(""),!0):(alert("网络异常,请重试"),!1):(alert(e.message),!1)},"json")}function c(e,t){var a=u("#"+t).closest("form");u.post(e,a.serialize(),function(e){return 200===e.code?(alert(e.message),setTimeout(function(){a.closest("div").next().find("h2").click()},100),!0):(alert(e.message),!1)},"json")}var u=e("jquery"),h=u(".userinfo-edit form"),p=e("js/home/common-address"),f={init:function(e,t,a){var n=u("#year"),i=u("#month"),o=u("#day"),s=this;this.createDay(n.val(),i.val(),o.val()),n.on("change",function(){s.update()}),i.on("change",function(){s.update()})},update:function(){this.createDay(u("#year").val(),u("#month").val(),u("#day").val())},createDay:function(e,t,a){var n,i,o='<select name="day" id="day">',s=new Array(4,6,9,11),r=31;if(e=parseInt(e),t=parseInt(t),0===e&&(e=0),0===t&&(t=0),u("#year").val(e.toString()),u("#month").val(t.toString()),o+='<option value="0">日</option>',e>0&&t>0)for(-1!==u.inArray(t,s)?r=30:2===t&&(r=28,0!==e%4||e%100===0&&e%400!==0||(r=29)),i=1;r>=i;i++)n="",parseInt(a)===i&&(n="selected"),o+='<option value="'+i+'" '+n+">"+i+"</option>";o+="</select>",u("#day").replaceWith(o)}};u(".userinfo-edit h2").on("click",function(){var e=u(this).next();h.slideUp("fast"),"none"===e.css("display")?e.slideDown("slow"):null}),u("#base-info").on("click",function(){n()&&c("/home/user/edituserinfo/","base-info")}),u("#contact-info").on("click",function(){i()&&c("/home/user/editusercontactinfo/","contact-info")}),u("#shopping-info").on("click",function(){o()&&c("/home/user/edituserhabitsinfo/","shopping-info")}),u("#favorite-brand").on("click",function(){s()&&u.ajax({url:"/home/user/edituserlikebrand/",type:"post",datatype:"json",data:{brand:u("#likebrand").val()},success:function(e){return 200===e.code?(alert(e.message),!0):(alert(e.message),!1)},error:function(e){alert("网络异常")}})}),u("#add-brand-btn").on("click",function(){l()}),u('.user-favorite-info input[type="checkbox"]').on("click",function(){var e=u(this);d(this,e.attr("id").substr(3),e.parent().text())}),function(){var e=u("#brand-box li");e.length>0&&e.find("a").on("click",function(){r(u(this).closest("li").attr("id").substr(6))})}(),f.init(),function(){u("#province").val()?p.bindAreaChange({provinceDomId:"province",cityDomId:"city",areaDomId:"areaCode"}):p.loadAllData(0,{provinceDomId:"province",cityDomId:"city",areaDomId:"areaCode"})}()}),define("js/home/gift",["jquery","handlebars","source-map"],function(e,t,a){function n(){var e=new Date;return o("#imgcode").attr("src","/passport/images?t="+e.getTime()),!1}var i,o=e("jquery"),s=e("js/common/dialog"),r=s.Alert,d=o(".giftCardCode").find(".gift-error"),l=o(".captchaCode").find(".gift-error"),c="",u="",h=1,p={suc:[!1,!1,!1,!1],checkCard:function(e){if(c=/^[0-9a-zA-Z]{4,4}$/,c.test(o("#giftCardCode"+e).val())){for(h=1;3>=h;h++)c.test(o("#giftCardCode"+h).val())?(d.html(""),p.suc[h]=!0):(d.html("您输入的兑换码有误,兑换码必须为数字或字母,每个文本框里只能输入四个兑换码!"),p.suc[h]=!1);3!==e&&o("#giftCardCode"+(e+1)).focus()}else d.html("您输入的兑换码有误,兑换码必须为数字或字母,每个文本框里只能输入四个兑换码!"),p.suc[e-1]=!1},bindGiftCardForm:function(){o("#giftCardCode1").bind("blur keyup",function(){p.checkCard(1)}),o("#giftCardCode2").bind("blur keyup",function(){p.checkCard(2)}),o("#giftCardCode3").bind("blur keyup",function(){p.checkCard(3)}),o("#captchaCode").bind("blur keyup",function(){u=o("#captchaCode").val(),u.length<=0?(l.html("请输入验证码!"),p.suc[3]=!1):(l.html(""),p.suc[3]=!0)})},checkForm:function(){return c.test(o("#giftCardCode1").val())&&c.test(o("#giftCardCode2").val())&&c.test(o("#giftCardCode3").val())?""===o.trim(o("#captchaCode").val())?(l.html("请输入验证码!"),!1):!0:(d.html("您输入的兑换码有误,兑换码必须为数字或字母,每个文本框里只能输入四个兑换码!"),!1)}};o("#sub-gift").on("click",function(){return p.checkForm()?void o.post("/home/gift/exchange",o("#giftCardForm").serialize(),function(e){200===e.code?window.location.href="/home/gift?type=1":400===e.code?(i=new r(e.message),i.show(),n()):window.location.href="/home/gift?type=2"},"json"):!1}),o(document).on("click","#imgcode,.check-img",function(){n()}),o(function(){n(),p.bindGiftCardForm()})}),define("js/home/validate",["jquery","handlebars","source-map"],function(e,t,a){function n(e,t){return e.$checkInfo.html('<div class="form-error">'+t+"</div>"),"code"!==e.dom.attr("name")&&"verifyCode"!==e.dom.attr("name")&&e.dom.addClass("input-error"),!1}function i(e){return e.$checkInfo.html('<div class="form-success">&nbsp;</div>'),"code"!==e.dom.attr("name")&&"verifyCode"!==e.dom.attr("name")&&e.dom.removeClass("input-error"),!0}function o(e){var t;return g.post(e.url,e.data,function(a){"undefined"!=typeof a.code&&200===a.code?t=i(e.opt):(e.txt=""!==e.txt&&null!==e.txt?e.txt:a.message,t=n(e.opt,e.txt))}),t}function s(e){var t=e.val(),a=t.length,s=e.parent(),r=s.find(".check-info"),d=e.attr("name"),l="",c="",u="",h={$checkInfo:r,dom:e},p={opt:h};return r.html(""),"password"===d?0===a?n(h,"密码不能为空!"):(g.extend(p,{url:"/home/account/checkpassword",data:{password:t},txt:"密码错误!"}),o(p)):"verifyCode"===d?(g.extend(p,{url:"/home/account/checkverifycode",data:{verifyCode:t},txt:"验证码错误!"}),o(p)):"email"===d?(l=b.emailRegx,null===t.match(l)?n(h,"邮箱错误!"):(g.extend(p,{url:"/home/account/checkemail",data:{email:t},txt:""}),o(p))):"mobile"===d?(l=b.phoneRegx,c=t.split("-"),l=1===c.length?t.match("^1[35847]{1}[0-9]{9}"):l["+"+c[0]].test(c[1]),0===a?n(h,"手机号不能为空!"):null!==l&&l?(g.extend(p,{url:"/home/account/checkmobile",data:{mobile:t},txt:"手机号已经存在!"}),o(p)):n(h,"手机号错误!")):"newPwd"===d?(l=b.pwdValidateRegx,l.test(t)?i(h):n(h,"建议6~20个数字+字母组合!")):"confirm_password"===d?g("#newPwd").val()!==t?n(h,"两次密码不一致!"):i(h):"code"!==d?!0:(u=g("#realAccount").length>0?g("#realAccount").val():g("#mobilevalue").val(),""!==t?(g.extend(p,{url:"/home/account/checkmobilemsg",data:{mobile:u,code:g("#inputcode").val()},txt:"验证码错误!"}),o(p)):void 0)}function r(){var e=[];return j=!1,g.each(x,function(t,a){e[t]=s(g(a))}),e.indexOf(!1)>=0?!1:!0}function d(){var e=(new Date).getTime();g("#the-code-img").attr("src","/passport/images?len=6&time="+e)}function l(){var e="";_>0?(e="重新发送"+_+"秒",g("#sendButton").text(e),_-=1):(_=60,g("#sendButton").text("发送验证码"),clearInterval(m),k=!0)}function c(e){var t=g("#inputcode"),a=t.parent().find("check-info");g.post("/home/account/sendmobilemsg",{mobile:e},function(e){"undefined"!=typeof e.code&&200===e.code?(k=!1,m=setInterval(function(){l()},1e3),a.html("")):a.html('<div class="form-error">验证码发送失败</div>')})}function u(){var e,t,a,n=g("#mobilevalue");if(n.length>0?(e=n.next(),t=n.val(),a=t.split("-"),a=1===a.length?t.match("^1[35847]{1}[0-9]{9}"):b.phoneRegx["+"+a[0]].test(a[1])):t=g("#realAccount").val(),!k)return!1;if(n.length>0){if(null===a||!a)return e.html('<div class="form-error">手机号错误!</div>'),n.addClass("input-error"),!1;e.find(".form-success").length>0&&c(t)}g("#realAccount").length>0&&c(t)}function h(){window.location.href="/home/account"}function p(e,t){g.post(e.url,e.data,function(a){return 200!==a.code?(j=!0,v=new w(a.message),v.show(),!1):(t&&(e.hrefUrl+="&checkCode="+a.data),void(window.location.href=e.hrefUrl))},"json")}function f(){var e=g(".progress-bar .cur").index(),t=g("#verifyType").val(),a="",n={};g(".email").length>0&&(a="email"),g(".mobile").length>0&&(a="mobile"),g(".userpwd").length>0&&(a="userpwd"),0===e?"1"===t?(n={url:"/home/account/verifypassword",data:g("#pwdform").serialize(),hrefUrl:"/home/account/"+a+"?step=2"},p(n,"step1")):"2"===t?(n={url:"/home/account/sendemail",data:{checkType:a,email:g("#realAccount").val()},hrefUrl:"/home/account/sendemailsuccess?email="+g("#realAccount").val()+"&type=1&checkType="+a},p(n)):(n={url:"/home/account/checkmobilemsg",data:{mobile:g("#realAccount").val(),code:g("#inputcode").val()},hrefUrl:"/home/account/"+a+"?step=2"},p(n,"step1")):1===e&&("userpwd"===a?(n={url:"/home/account/modifypwd",data:g("#pwdform").serialize(),hrefUrl:"/home/account/userpwd?step=3&success=true"},p(n)):"email"===a?(n={url:"/home/account/modifyemail",data:{email:g("#email").val()},hrefUrl:"/home/account/sendemailsuccess?email="+g("#email").val()+"&type=2&checkType=email"},p(n)):(n={url:"/home/account/modifymobile",data:{mobile:g("#mobilevalue").val(),code:g("#inputcode").val()},hrefUrl:"/home/account/mobile?step=3&success=true"},p(n)))}var m,v,g=e("jquery"),y=e("js/common/dialog"),b=e("js/passport/mail-phone-regx"),w=y.Alert,C=g(".check-user"),x=C.find("input").not("input[type=button],input[type=hidden],input[type=reset]"),k=!0,j=!0,_=60;g.ajaxSetup({async:!1}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,n;for(a=t||0,n=this.length;n>a;a++)if(this[a]===e)return a;return-1}),g(function(){var e=null;g(".res-info").length>0&&(e=setTimeout(function(){h()},5e3)),d(),g("#pwdform").submit(function(){return!1}),x.blur(function(){s(g(this))}),g(".sub-btn").on("click",function(){return j===!1?!1:r()?void f():!1}),g("input[name=verifyCode]").keydown(function(e){if(13===e.keyCode){if(j===!1)return!1;if(!r())return!1;f()}}),g(".the-code").on("click",function(){d()}),g("#send-mobile-code").on("click",function(){u()}),g("#newPwd").length>0&&g("#newPwd").on("input",function(e){var t=g("input[name=confirm_password]"),a=t.val(),i=g("#newPwd").val(),o={dom:t,$checkInfo:t.next()};a.length>0&&i!==a&&n(o,"两次密码不一致!")})})}),define("js/home/address",["jquery","handlebars","source-map"],function(e,t,a){function n(e){var t=e.parents(".address-content"),a=t.attr("addressId");return a}function i(e){var t="";"addressName"===e.inputName&&(t="真实姓名在2到5个汉字之间"),"address"===e.inputName&&(t="请填写详细地址"),"zipCode"===e.inputName&&(t="请输入收货人所在地邮编号"),"phone"===e.inputName&&(t="格式例如:0577-88888888"),"mobile"===e.inputName&&(t="请输入手机号,如1360000000"),"email"===e.inputName&&(t="用来接收订单提醒邮件,便于您及时了解订单状态"),e.$checkInfo.removeClass("form-prompt").addClass("form-focus").html(t)}function o(e){var t="",a=!0,n="输入正确",i="form-info form-success",o=e.val;return"addressName"===e.inputName&&(t=/^[\u4e00-\u9fa5]{2,5}$/,e.len<1||e.len>12?(n="真实姓名在2到5个汉字之间,请确认",a=!1,i="form-info form-error"):t.test(e.val)===!1&&(n="真实姓名至少2个中文,最多5个中文",a=!1,i="form-info form-error")),"address"===e.inputName&&e.len<2&&(n="请填写详细地址",a=!1,i="form-info form-error"),"zipCode"===e.inputName&&(t=/^[0-9]{6}$/,0===e.len?(n="请输入收货人所在地邮编号",a=!1,i="form-info form-error"):t.test(e.val)===!1&&(n="你输入的邮编式不正确",a=!1,i="form-info form-error")),"phone"===e.inputName&&(t=/^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/,0===e.len?(n="你真的不想留联系电话了吗?",a=!0,i="form-info form-success"):t.test(e.val)===!1&&(n="你输入的联系电话格式不正确",a=!1,i="form-info form-error")),"mobile"===e.inputName&&(t=/^1[3|4|5|8|7][0-9]{9}$/,11!==e.len?(n="手机号码必须是11位的,请确认",a=!1,i="form-info form-error"):t.test(e.val)===!1&&(n="您输入的手机号格式不正确",a=!1,i="form-info form-error")),"email"===e.inputName&&(t="^[a-z0-9_-]+(.[_a-z0-9-]+)*@([_a-z0-9-]+.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)$",(null===o.match(t)||0===e.len)&&(n="你输入的邮件地址格式不正确",a=!1,i="form-info form-error")),e.$checkInfo.removeClass().addClass(i).html(n),a}function s(e,t){var a=e.val(),n=e.parent(),s={val:a,len:a.length,$domParent:e.parent(),$checkInfo:n.find("span"),inputName:e.attr("name")};return"focus"===t&&i(s),"blur"===t?o(s):void 0}function r(){var e=c("#phone").next(),t=c("#mobile").next();return t.hasClass("form-success")&&!e.hasClass("form-error")&&0===c("#phone").val().length?(e.removeClass().addClass("form-prompt form-info").html("请输入你的联系电话,可以为空哦"),!0):"输入正确"!==e.html()||t.hasClass("form-error")||0!==c("#mobile").val().length?t.hasClass("form-success")||"输入正确"===e.html()?void 0:(e.removeClass().addClass("form-success form-info").html("你真的不想留联系电话了吗?"),t.removeClass().addClass("form-prompt form-info").html("填写手机号便于接收发货和收货通知"),c("#mobile").focus(),!1):(t.removeClass().addClass("form-prompt form-info").html("填写手机号便于接收发货和收货通知"),!0)}function d(){var e=[];return c.each(v,function(t,a){e.push(s(c(a),"blur"))}),e.push(r()),c.each(c(".form-info"),function(e,t){return c(t).hasClass("form-error")?(c(t).prev().focus(),!1):void 0}),-1===e.indexOf(!1)?!0:!1}var l,c=e("jquery"),u=e("js/home/common-address"),h=e("js/common/dialog"),p=h.Alert,f=c(".address-del"),m=c(".address-modify"),v=c(".input-1"),g={evil:function(e){var t=Function;return new t("return "+e)()},clearAddrForm:function(){c("#addressName").val(""),c("#address").val(""),c("#zipCode").val(""),c("#phone").val(""),c("#mobile").val(""),c("#email").val(""),c("#addrId").val(0),c("#province").val(0),c("#city").val(0),c("#areaCode").val(0).hide(),c("#btn-reset").hide(),c("#form-status").html("添加新地址")},editAddr:function(e){c.getJSON("/home/address/editAddress?id="+e,function(e){200===e.code&&(c("#form-status").html("修改地址"),c("#addressName").val(e.data.consignee),u.loadAllData(e.data.area_code,{}),c("#address").val(e.data.address),c("#email").val(e.data.email),c("#phone").val(e.data.phone),c("#mobile").val(e.data.mobile),c("#zipCode").val(e.data.zip_code),c("#addrId").val(e.data.address_id),c("#btn-reset").show())})},saveAddr:function(e){c.post("/home/address/saveAddress",c("#address-form").serialize(),function(e){200===e.code?location.reload():(l=new p(e.message),l.show())},"json")},delAddr:function(e){c.getJSON("/home/address/delAddress?id="+e,function(t){200===t.code?(c(".address-list").find("li[addressId="+e+"]").remove(),e===c("#addrId").val()&&g.clearAddrForm()):(l=new p("删除失败"),l.show())})},setDefaultAddr:function(e){var t=c(".address-list").find(".default-btn"),a=c(".address-list").find(".default-btn").parents("li"),n=c(".address-list").find("li[addressId="+e+"]"),i=n.find(".set-default-btn");c.getJSON("/home/address/defaultAddress?id="+e,function(e){200===e.code?(t.attr("class","btn-c3 set-default-btn"),a.removeClass("preferred"),t.html("<span>设为常用地址</span>"),i.attr("class","btn-c2 default-btn"),t.html("<span>设为常用地址</span>"),n.addClass("preferred")):(l=new p("设置失败"),l.show())})}};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,n;for(a=t||0,n=this.length;n>a;a++)if(this[a]===e)return a;return-1}),c(document).on("click",".set-default-btn",function(){var e=n(c(this));g.setDefaultAddr(e)}),f.on("click",function(){var e=n(c(this));g.delAddr(e)}),m.on("click",function(){var e=n(c(this));g.editAddr(e),c("#btn-reset").show()}),v.on("focus",function(){s(c(this),"focus")}),v.on("blur",function(){s(c(this),"blur")}),c("#address-info").on("click",function(){d()&&g.saveAddr()}),c(document).ready(function(){u.loadAllData(0,{provinceDomId:"province",cityDomId:"city",areaDomId:"areaCode"}),g.clearAddrForm(),c("#btn-reset").click(function(){g.clearAddrForm()})})}),define("js/help/entry",["jquery","handlebars","source-map"],function(e,t,a){e("js/help/search")}),define("js/help/search",["jquery","handlebars","source-map"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=n(".search-content"),s=n("#help-dialog-widget"),r=n("#help-dialog-bg"),d=n(document).width(),l=n(window).height(),c='<div class="dialog-titlebar"><span class="dialog-close-btn"></span></div><div class="dialog-content"><p class="ask">问:<br>{{ask}}</p><p class="answer">答:<br>{{answer}}</p></div>',u=i.compile(c);o.on("click",".faqs",function(){var e=n(this).data(),t=n(document).scrollTop();s.html(u(e)).removeClass("hide"),r.removeClass("hide"),s.html(u(e)).css({top:t+(l-s.outerHeight())/2,left:(d-s.outerWidth())/2})}),s.on("click",".dialog-close-btn",function(){s.addClass("hide"),r.addClass("hide")})}),define("js/order/ensure",["jquery","handlebars","source-map"],function(e,t,a){var n=e("jquery"),i=e("js/order/address"),o=e("js/common/dialog"),s={Data:{product:0,activity:0,carriage:0,juan:0,yohocoin:0},UI:{e:{$pan:n(".pan"),$jc:n("#juancode"),$bp:n("#biprice"),$statistics:n("li",".play-total"),$tobi:n("p em",".play-bi-pan .play-pan"),$cancel:n(".cancel",".btn-group"),$total:n("em",".to-play"),$tbody:n("table tbody",".pay-wapper"),$orderSelectionSave:n(".address-list h2 span"),$addAddress:n(".add-address"),$addressManage:n(".address-manage"),$spanPayTypeLegend:n("span.pay-type-legend"),$supportType:n(".support-type"),$existAddressListWrap:n(".exist-address-list"),$existAddressList:n(".exist-address-list").find("li"),$existAddress:n(".exist-address-list").find('input[name="exist-address"]'),$payTimeModify:n(".pay-time-modify"),$switchPayModify:n(".switch-pay-modify"),$modityPayInfo:n(".modity-pay-info"),$payTotal:n(".play-total"),$toPay:n(".to-play em"),$redEnvelopes:n(".red-envelopes"),$useEnvelopes:n(".use-envelopes"),$hasEnvelopes:n(".has-envelopes span"),$useEnvelopesInput:n(".use-envelopes").find("input")},init:function(){var e=this.e,t=s.Data,a=s.Common;e.$tbody.find("tr").each(function(i){var o=n(this).find("td"),s=e.$tbody.find("tr").length,r=parseFloat(o.eq(1).html())*parseInt(o.eq(3).html());o.eq(1).html("¥"+o.eq(1).html()),o.hasClass("xforone")?(o.eq(4).find("del").html("¥"+a.strFixed(r)),r=0):o.eq(4).html("¥"+a.strFixed(r)),t.product+=r,i?o.last().remove():o.last().attr("rowspan",s),i===s-1&&e.$tbody.find("tr").eq(0).find("td").last().html("<strong>¥"+a.strFixed(t.product)+"</strong>")}),e.$pan.find("dt").click(function(){var e=n(this).parent("dl.pan");e.find("dd").is(":hidden")?(a.winShow(e),n(this).addClass("active")):(a.winHide(e),n(this).removeClass("active"))}),e.$orderSelectionSave.click(function(){var t=0,a=n(".exist-address-list li"),i=a.length,o=0;if(n(this).attr("expand")){for(t=0;i>t;t++)a.eq(t).hasClass("address_select")&&o++,a.eq(t).hasClass("address_select")||a.eq(t).addClass("hide");0===o&&(n('.exist-address-list li:not(".use-new-address")').removeClass("hide"),n(".use-new-address input").removeAttr("checked")),n(".address-list-inner li.address_select input").attr("checked","checked"),n(".address-list-inner li").removeClass("active"),n(".address-list-inner li.address_select").addClass("active"),n(this).removeAttr("expand").text("[修改]"),n(".save-btn").addClass("hide"),e.$existAddressListWrap.removeClass("address-expand"),e.$addressManage.addClass("hide")}else n(this).attr("expand","expand").text("[不保存并关闭]"),n(".exist-address-list li").removeClass("hide"),n(".save-btn").removeClass("hide"),e.$existAddressListWrap.addClass("address-expand"),1===i&&e.$addressManage.removeClass("hide")}),e.$switchPayModify.click(function(){e.$payTimeModify.hasClass("hide")?(e.$payTimeModify.removeClass("hide"),e.$modityPayInfo.addClass("hide"),n(this).text("[不保存并关闭]")):(e.$payTimeModify.addClass("hide"),e.$modityPayInfo.removeClass("hide"),n(this).text("[修改]"),e.$payTimeModify.find('input[name="pay-type"]').filter(".checked").attr("checked","checked"),e.$payTimeModify.find('input[name="pay-time-radio"]').filter(".checked").attr("checked","checked"),e.$payTimeModify.find('input[name="call-me"]').filter(".checked").attr("checked","checked"))}),e.$spanPayTypeLegend.click(function(){n(this).toggleClass("active"),e.$supportType.toggleClass("hide")}),n(document).on("click",".exist-address-list li",function(){n(".exist-address-list li").removeClass("active"),n(this).addClass("active"),n(this).find("input").attr("checked","checked"),n(this).hasClass("use-new-address")&&(e.$addressManage.removeClass("hide"),n(".address-manage input").val(""),n(".save-btn").removeAttr("data-id"),i.newAddress(0,"000000"))})},render:function(e,t){var a,i,o,s=this.e,r=e.promotion_formula_list,d="",l="";for(i=t?t:"",a=0;a<r.length;a++)"优惠券:"===r[a].promotion&&(r[a].promotion=(i?i:"优惠券")+'<span class="juan-modify">[修改]</span>:'),"YOHO币:"===r[a].promotion&&(r[a].promotion='YOHO币<span class="bi-modify">[修改]</span>:'),l=r[a].isExpress?"total-express-w":"",d+='<li class="'+l+'"><label>'+r[a].promotion+"</label><em>"+r[a].promotion_amount+"</em></li>";s.$payTotal.html(d),s.$toPay.html(e.last_order_amount.toFixed(2)),n("#biprice").val(100*e.use_yoho_coin),0===~~e.use_yoho_coin?n(".errbitip").text(""):n(".errbitip").text("抵扣"+e.use_yoho_coin.toFixed(2)+"元"),o=s.$useEnvelopesInput.data("all")-e.use_red_envelopes,~~e.use_red_envelopes>0?(s.$useEnvelopes.find("span").html("-¥"+e.use_red_envelopes.toFixed(2)),s.$useEnvelopes.find("input").attr("data-use",e.use_red_envelopes)):(s.$useEnvelopes.find("span").html("-¥0.00"),s.$hasEnvelopes.html("¥"+(1*s.$useEnvelopesInput.attr("data-all")).toFixed(2)),s.$redEnvelopes.removeClass("active"),s.$useEnvelopesInput.prop("checked",!1)),s.$hasEnvelopes.html("¥"+o.toFixed(2))}},Common:{enterNUM:function(e,t){return e=e.replace(/[^\d]/g,""),e&&t&&(e=parseInt(e),t=parseInt(t),e>t&&(e=t)),e},calucate:function(){var e=s.Data;return n.each(s.Data,function(t,a){e[t]=parseFloat(s.Data[t])}),e.product-e.activity+e.carriage-e.juan-e.yohocoin},winShow:function(e){e.find("dt").show(),e.find("dd").show(),e.attr("class").match(/(-bi-)|(-juan-)/g)&&e.find("dt").hide()},winHide:function(e){e.find("dt").show(),e.find("dd").hide()},strFixed:function(e){return parseFloat(e).toFixed(2)}},Bll:{e:{$juanok:n("#juansubmit"),$juantip:n(".errtip",".play-juan-pan"),$biok:n("#bisubmit"),$carriageGroup:n('input[name="carriagegroup"]'),$selectExpress:n(".express-list input"),$bp:n("#biprice"),$errorTip:n(".errbitip"),$useEnvelopes:n(".use-envelopes"),$hasEnvelopes:n(".has-envelopes span"),$useEnvelopesInput:n(".use-envelopes").find("input"),$redEnvelopes:n(".red-envelopes"),$loading:n(".loading")},init:function(){function e(e){var t,a=n('.play-juan.is-select input[name="juangroup"]:checked'),i=n('.express-list input[name="carriagegroup"]').val(),o=n("#biprice.is-select").val(),s=a.val(),r=n(".address-manage").attr("cart-type"),d=n(".use-envelopes input:checked").attr("data-use");s=s?s:a.closest("li").find("#juancode").val(),t={cartType:r,deliveryWay:i,couponCode:s,yohoCoin:o},d&&(t.redEnvelopes=d),e(t)}function t(e,t){var a=e;a.keyup(function(){a.val().length>t&&a.val(a.val().substr(0,t))})}var a,i,r=this.e,d=s.UI,l=s.Common;r.$selectExpress.click(function(){var t=n(this).val();r.$loading.show(),e(function(e){e.deliveryWay=t,a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data),"1"===t?n(".express-list.sf").addClass("hide"):"2"===t&&n(".express-list.sf").removeClass("hide")):new o.Alert(e.message).show()}},n.ajax(a)})}),r.$juanok.click(function(){var t=n(this).parents("dl.pan"),i="";n(".play-juan").addClass("is-select"),e(function(e){var o=e.couponCode;o?(r.$loading.show(),a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(i=n('.play-juan input[value="'+o+'"]').next().text(),d.render(e.data,i),l.winHide(t),r.$juantip.html("")):(r.$juantip.html(e.message),n(".play-juan").removeClass("is-select"))}},n.ajax(a)):(r.$juantip.html("请选择或填写一个优惠券"),n(".play-juan").removeClass("is-select"))})}),n(document).on("click",".juan-modify",function(){var e=n(".play-juan-pan");l.winShow(e)}),r.$biok.click(function(){var t,i=n(this).parents("dl.pan");n("#biprice").addClass("is-select"),e(function(e){e.couponCode&&(t=n('.play-juan input[value="'+e.couponCode+'"]').next().text()),/^\d+$/.test(e.yohoCoin+"")&&1*e.yohoCoin!==0?1*e.yohoCoin>1*n(".play-pan em").text()?(n(".errbitip").html("您的YOHO币不足"),n("#biprice").removeClass("is-select")):(r.$loading.show(),a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data,t),l.winHide(i)):(n(".errbitip").html(e.message),n("#biprice").removeClass("is-select"))}},n.ajax(a)):(n(".errbitip").html("请输入一个正整数"),n("#biprice").removeClass("is-select"))})}),n(document).on("click",".bi-modify",function(){var e=n(".play-bi-pan");l.winShow(e)}),r.$bp.keyup(function(){var e=n(this).val();/^\d+$/.test(e+"")?1*e>1*n(this).data("bi")?r.$errorTip.html("您的YOHO币不足"):r.$errorTip.html("抵扣"+(e/100).toFixed(2)+"元"):r.$errorTip.html("请输入一个正整数")}),n(".cancel-bi").click(function(){var t,i=n(".play-bi-pan");n(".errbitip").html(""),n("#biprice").hasClass("is-select")?(r.$loading.show(),e(function(e){e.yohoCoin=0,e.couponCode&&(t=n('.play-juan input[value="'+e.couponCode+'"]').next().text()),a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data,t),l.winHide(i),n("#biprice").val("0"),n("#biprice").removeClass("is-select"),n(".errbitip").html("")):n(".errbitip").html(e.message)}},n.ajax(a)})):(l.winHide(i),n("#biprice").val("0"))}),n(".cancel-code").click(function(){var t=n(".play-juan-pan");n(".play-juan").hasClass("is-select")?(r.$loading.show(),e(function(e){e.couponCode="",a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data),l.winHide(t),n(".play-juan").removeClass("is-select"),n("#juancode").val("").siblings('input[name="juangroup"]').attr("checked","checked")):r.$juantip.html(e.message)}},n.ajax(a)})):l.winHide(t)}),i=r.$useEnvelopesInput.data("all")-r.$useEnvelopesInput.data("use"),r.$hasEnvelopes.text("¥"+i.toFixed(2)),r.$useEnvelopes.find("input").click(function(){var t,i=n(this);r.$loading.show(),i.attr("disabled","disabled"),e(function(e){i.attr("checked")?e.redEnvelopes=i.data("use"):e.redEnvelopes=0,t=n('.play-juan input[value="'+e.couponCode+'"]').next().text(),a={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data,t),i.removeAttr("disabled"),i.attr("checked")?r.$redEnvelopes.addClass("active"):(r.$useEnvelopes.find("span").html("-¥0.00"),r.$hasEnvelopes.html("¥"+(1*i.attr("data-all")).toFixed(2)),r.$redEnvelopes.removeClass("active"))):new o.Alert(e.message).show()}},n.ajax(a)})}),t(n("#piaodesc"),30),t(n("#notedesc"),100)}}};s.Data.activity=0,s.Data.carriage=0,s.UI.init(),s.Bll.init(),i.getUserAddressList(),i.newAddress(0,"000000"),i.modifyAddress(),i.saveAddress()}),define("js/order/address",["jquery","handlebars","source-map"],function(e,t,a){function n(e,t,a){var n,i,o="",s="";for(n=0;n<t.length;n++)s="Y"===t[n].is_support_express?"*":"",o+=t[n].id===a?'<option selected value="'+t[n].id+'">'+s+t[n].caption+"</option>":'<option value="'+t[n].id+'">'+s+t[n].caption+"</option>";"province"===e.attr("name")?i='<option value="0">请选择省份</option>':"city"===e.attr("name")?i='<option value="0">请选择城市</option>':"county"===e.attr("name")&&(i='<option value="0">请选择区县</option>'),e.html(i+o)}function i(e,t){var a,i=e.selectId;"getProvince"===e.type?a=f:"getCity"===e.type?a=m:"getCounty"===e.type&&(a=v),c.ajax({type:"GET",url:"/cart/index/getAreaList",dataType:"json",data:{id:1*e.id}}).then(function(e){n(a,e.data,i),"function"==typeof t&&t()})}function o(e){return e.replace(/^(\d{3}).*(\d{4})$/,"$1****$2")}function s(e){b.val(e.attr("data-name")),b.attr("data-id",e.attr("data-id")),x.val(e.attr("data-addressDesc")),w.val(e.attr("data-mobile")),C.val(e.attr("data-email")),k.val(e.attr("data-zipcode")),_.val(e.attr("data-phoneCode")),q.val(e.attr("data-phoneNum"))}function r(){T.removeClass("active"),I.find('li:not(".active")').addClass("hide"),I.find("li.active").addClass("address_select"),p.addClass("hide"),j.addClass("hide").removeAttr("data-id"),I.removeClass("address-expand"),c(".address-list h2 span").text("[修改]")}function d(){var e,t,a,n=c(".play-juan ul"),i="";c.ajax({type:"GET",dataType:"json",url:"/cart/index/getCouponList"}).then(function(o){if(200===o.code){for(t=o.data,e=t.length,a=0;e>a;a++)i+='<li><input name="juangroup" type="radio" value="'+t[a].code+'"><label>'+t[a].desc+"</label></li>";n.prepend(c(i))}})}function l(e){return"N"===e?!1:!0}var c=e("jquery"),u=e("js/common/dialog"),h=!1,p=c(".address-manage"),f=p.find('.text-input[name="province"]'),m=p.find('.text-input[name="city"]'),v=p.find('.text-input[name="county"]'),g=p.find('.text-input[name="province"], .text-input[name="city"]'),y=c(".address-list"),b=p.find('.text-input[name="name"]'),w=p.find('.text-input[name="phone"]'),C=p.find('.text-input[name="mail"]'),x=p.find('.text-input[name="address"]'),k=p.find('.text-input[name="code"]'),j=c(".save-btn"),_=p.find('.text-input[name="tel-code"]'),q=p.find('.text-input[name="tel"]'),T=c(".use-new-address"),I=c(".exist-address-list"),A=c(".loading"),E=c("#order-edit-main"),D=p.attr("cart-type");A.show(),t.getUserAddressList=function(){var e,t,a="",n="",i="",o="",s=0;c.ajax({type:"GET",url:"/cart/index/getAddress",dataType:"json"}).then(function(r){if(A.hide(),200===r.code){if(e=r.data.list,!e)return E.attr("data-new")&&(j.addClass("new-user-btn").html("下一步:选择支付及送货时间"),c(".pay-btn").addClass("new-user-pay").html("下一步:发票和备注"),c(".switch-pay-modify").html("")),y.find(">h2").find("span").click(),c(".exist-address-list li").click(),void c(".use-new-address").removeClass("active");for(t=0;t<e.length;t++)e[t].checked?(n="checked",i="active address_select",s++,o="默认地址"):(n="",i="hide",o="设为默认地址"),a+='<li data-id="'+e[t].id+'" class="'+i+'" data-express="'+e[t].isSupport+'"><input data-name="'+e[t].user+'" data-areaCode="'+e[t].areaCode+'" data-addressDesc="'+e[t].addressDesc+'" data-mobile="'+e[t].mobile+'" data-phoneNum="'+e[t].phoneNum+'" data-phoneCode="'+e[t].phoneCode+'" data-zipCode="'+e[t].zipCode+'" data-email="'+e[t].email+'" class="radio" type="radio" name="address" '+n+' /><label for=""><strong>'+e[t].user+"</strong>"+e[t].address+'<a href="javascript:void(0);" class="default-address">'+o+'</a><div class="order-modify-btn"><span class="address-modify">[修改]</span><span class="address-del">[删除]</span></div></label></li>';c(".use-new-address").before(c(a)),0===s&&c(".address-list h2 span").click(),"N"===c(".active.address_select").attr("data-express")?(c('.express-list input[name="carriagegroup"][value="2"]').attr("disabled","disabled"),c('.express-list input[name="carriagegroup"][value="1"]').attr("checked","checked"),c(".express-list.sf").addClass("hide"),c(".is-sup").removeClass("hide")):(c('.express-list input[name="carriagegroup"][value="2"]').removeAttr("disabled"),c(".express-list.sf").removeClass("hide"),c(".is-sup").addClass("hide"))}})},t.newAddress=function(e,t){var a=e||0,n=/[0-9]{2}/gi,o=!!t&&t.match(n);i({id:a,type:"getProvince",selectId:o[0]},function(){var e=f.val();"0"!==e?i({id:e,type:"getCity",selectId:""+o[0]+o[1]},function(){var e=m.val();"0"!==e&&i({id:e,type:"getCounty",selectId:t})}):(p.find('select[name="city"]').html('<option value="0">请选择城市</option>'),p.find('select[name="county"]').html('<option value="0">请选择区县</option>'))}),g.change(function(){var e=c(this);"province"===e.attr("name")&&("0"===e.val()?(p.find('select[name="city"]').html('<option value="0">请选择城市</option>'),p.find('select[name="county"]').html('<option value="0">请选择区县</option>')):(i({id:e.val(),type:"getCity"},function(){h=!0}),p.find('select[name="county"]').html('<option value="0">请选择区县</option>'))),"city"===e.attr("name")&&h&&("0"===e.val()?p.find('select[name="county"]').html('<option value="0">请选择区县</option>'):i({id:e.val(),type:"getCounty"}))})},t.modifyAddress=function(){y.click(function(e){var a=c(e.target),n=a.closest("li").attr("data-id"),i=a.closest("li").find(".radio").attr("data-areaCode");a.hasClass("address-modify")?(p.removeClass("hide"),t.newAddress(0,i),s(a.closest("li").find(".radio")),c(".address-list-inner .save-btn").removeClass("hide"),j.attr("data-id",n),h=!0):a.hasClass("address-del")?(A.show(),c.ajax({type:"POST",url:"/cart/index/delAddress",data:{id:n}}).then(function(e){A.hide(),200===e.code?a.closest("li").remove():new u.Alert(e.message).show()}).fail(function(){})):a.hasClass("default-address")&&!a.parents("li").hasClass("address_select")&&(A.show(),c.ajax({type:"post",url:"/cart/index/setDefaultAddress",data:{id:n}}).then(function(e){A.hide(),200===e.code?(c(".exist-address-list li").removeClass("address_select").find(".default-address").text("设为默认地址"),a.parents("li").addClass("address_select"),a.text("默认地址")):new u.Alert(e.message).show()}))})},t.saveAddress=function(){j.click(function(){function e(e){return e===y?e?e+"-":" ":e?e+" ":" "}var t,a,n,i=c(this),s=b.val(),d=f.val(),l=m.val(),h=v.val(),p=x.val(),g=w.val(),y=_.val(),T=q.val(),I=C.val(),A=k.val(),E=f.find('option[value="'+d+'"]').text().replace(/\*/,""),D=m.find('option[value="'+l+'"]').text().replace(/\*/,""),S=v.find('option[value="'+h+'"]').text().replace(/\*/,""),P={consignee:s,areaCode:h,address:p,email:I,
mobile:g,zipCode:A,phoneCode:y,phoneNum:T},$=/^[\u4e00-\u9fa5]{2,5}$/,L=/^[\s\S]{2,100}$/,z=/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/,O=/^[0-9]{6}$/,N=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,B=/^[0-9]{3,5}$/,M=/^[0-9]{5,10}$/;if(n=c('.exist-address-list li:not(".use-new-address")').find('input[name="address"]:checked').length>0,c(".add-address").attr("checked")||!n||c(".save-btn").attr("data-id")||(c(".exist-address-list li").removeClass("address_select"),c(".exist-address-list li.active").addClass("address_select").find('input[name="address"]').attr("checked","checked"),c(".address-list span").removeAttr("expand"),r()),!c(".address-manage").hasClass("hide")){if(!$.test(s))return void new u.Alert("真实姓名至少2个中文,最多5个中文").show();if(!L.test(p))return void new u.Alert("你输入的地址格式不正确").show();if(!z.test(g))return void new u.Alert("你输入的联系电话格式不正确").show();if(y&&!B.test(y)||T&&!M.test(T)||B.test(y)&&!M.test(T)||!B.test(y)&&M.test(T))return void new u.Alert("你输入的电话格式不正确").show();if(I&&!N.test(I))return void new u.Alert("你输入的邮箱格式不正确").show();if(A&&!O.test(A))return void new u.Alert("你输入的邮编格式不正确").show();j.attr("data-id")&&(P.id=j.attr("data-id")),c.ajax({type:"post",url:"/cart/index/saveAddress",data:P}).then(function(n){var d;200===n.code?(d=n.data,"Y"===d.is_support?(c('.express-list input[name="carriagegroup"][value="2"]').removeAttr("disabled"),c(".express-list.sf").removeClass("hide"),c(".is-sup").addClass("hide")):(c('.express-list input[name="carriagegroup"][value="2"]').attr("disabled","disabled"),c('.express-list input[name="carriagegroup"][value="1"]').attr("checked","checked"),c(".express-list.sf").addClass("hide"),c(".is-sup").removeClass("hide")),t=P.id?'<li class="active" data-id="'+P.id+'" data-express="'+d.is_support+'"><input data-name="'+P.consignee+'" data-areaCode="'+P.areaCode+'" data-addressDesc="'+P.address+'" data-mobile="'+P.mobile+'" data-phoneNum="'+P.phoneNum+'" data-phoneCode="'+P.phoneCode+'" data-zipCode="'+P.zipCode+'" data-email="'+P.email+'" checked="checked" class="radio" type="radio" name="address" /><label><strong>'+s+"</strong><span>"+E+" "+D+" "+S+" "+p+" "+e(A)+o(g)+e(y)+e(T)+'</span><a href="javascript:void(0);" class="default-address">设为默认地址</a><div class="order-modify-btn"><span class="address-modify">[修改]</span><span class="address-del">[删除]</span></div></label></li>':'<li class="active" data-id="'+d.id+'" data-express="'+d.is_support+'"><input data-name="'+d.consignee+'" data-areaCode="'+d.area_code+'" data-addressDesc="'+d.address+'" data-mobile="'+d.mobile+'" data-phoneNum="'+P.phoneNum+'" data-phoneCode="'+P.phoneCode+'" data-zipCode="'+d.zip_code+'" data-email="'+d.email+'" checked="checked" class="radio" type="radio" name="address" /><label><strong>'+s+"</strong><span>"+E+" "+D+" "+S+" "+p+" "+e(A)+o(g)+e(y)+e(T)+'</span><a href="javascript:void(0);" class="default-address">设为默认地址</a><div class="order-modify-btn"><span class="address-modify">[修改]</span><span class="address-del">[删除]</span></div></label></li>',i.attr("data-id")?(a=c('.exist-address-list li[data-id="'+i.attr("data-id")+'"]'),a.after(c(t)).remove()):c(".use-new-address").before(c(t)),c(".address-list span").removeAttr("expand"),r()):new u.Alert(n.message).show()})}return 0===c(".exist-address-list li").find('input[name="address"]:checked').length?void new u.Alert("请选择一个地址").show():("N"===c(".exist-address-list li").find('input[name="address"]:checked').closest("li").attr("data-express")?(c('.express-list input[name="carriagegroup"][value="2"]').attr("disabled","disabled"),c('.express-list input[name="carriagegroup"][value="1"]').attr("checked","checked"),c(".express-list.sf").addClass("hide"),c(".is-sup").removeClass("hide")):(c('.express-list input[name="carriagegroup"][value="2"]').removeAttr("disabled"),c(".express-list.sf").removeClass("hide"),c(".is-sup").addClass("hide")),void(i.hasClass("new-user-btn")&&c(".switch-pay-modify").click()))})},c(".pay-time-modify .pay-btn").click(function(){var e=c(this),t=c(".modity-pay-info"),a=c(".pay-time-modify"),n=a.find('input[name="pay-type"]:checked').val(),i=a.find('input[name="pay-type"]:checked').next("label").text(),o=a.find('input[name="pay-time-radio"]:checked').next("label").text(),s=a.find('input[name="pay-time-radio"]:checked').val(),r=a.find('input[name="call-me"]:checked').next("label").text(),d=a.find('input[name="call-me"]:checked').val();A.show(),c.ajax({type:"POST",url:"/cart/index/orderCompute",dataType:"json",data:{cartType:D,paymentType:n}}).then(function(a){A.hide(),200===a.code?(t.find("li").eq(0).find("span").text(i),t.find("li").eq(1).find("span").text(o),t.find("li").eq(2).find("span").text(r),c(".pay-time-modify").addClass("hide").find('input[name="pay-type"][value='+n+"]").addClass("checked").end().find('input[name="pay-time-radio"][value='+s+"]").addClass("checked").end().find('input[name="call-me"][value='+d+"]").addClass("checked"),c(".modity-pay-info").removeClass("hide"),c(".switch-pay-modify").text("[修改]"),e.hasClass("new-user-pay")&&(c(".play-piao-pan dd").css({display:"block"}),c(".play-piao-pan dt").addClass("active"))):new u.Alert(a.message).show()})}),d(),c(".to-play input.submit").click(function(){var e=c(this),t=c('.exist-address-list input[name="address"]:checked').closest("li").attr("data-id"),a=c('.pay-time-modify input[name="pay-time-radio"]:checked').val(),n=c('.select-express input[name="carriagegroup"]:checked').val(),i=c("#piaodesc").val(),o=c("#piaotype").val(),s=c('.pay-time-modify input[name="pay-type"]:checked').val(),r=c('.pay-time-modify input[name="pay-type"]:checked').data("pay"),d=c("#notedesc").val(),h=c("#biprice").val(),p=c('.pay-time-modify input[name="call-me"]:checked').val(),f=c('.play-pan input[name="isPP"]:checked').val(),m=c(".use-envelopes input:checked").attr("data-use"),v=c('.play-juan.is-select input[name="juangroup"]:checked'),g=v.val(),y=g?g:v.closest("li").find("#juancode").val();A.show(),e.attr("disabled")||(e.attr("disabled","disabled"),c.ajax({type:"POST",dataType:"json",url:"/cart/index/orderSub",data:{addressId:t,cartType:D,deliveryTimeId:a,deliveryWayId:n,invoiceTitle:i,invoiceId:o,paymentId:r,paymentType:s,remark:d,couponCode:y,yohoCoin:h,isPreContact:l(p),isPrintPrice:l(f),redEnvelopes:m}}).then(function(e){A.hide(),200===e.code?window.location.href=e.data.payUrl:new u.Alert(e.message).show()}).always(function(){e.removeAttr("disabled")}))})}),define("js/shopping/pay",["jquery"],function(e,t,a){function n(){v?c('.mode div[id="'+v+'"]').addClass("choosed-tag").parent().addClass("choose-type"):(h.eq(0).addClass("choose-type").show(),h.eq(0).find("div").addClass("choosed-tag")),f.attr("value","前往"+c("#"+g).attr("alt")),p.attr("src",c("#"+g).attr("src"))}var i,o,s,r,d,l,c=e("jquery"),u=c(".mode div"),h=c(".mode"),p=c("#show-pay-img"),f=c("#btnby"),m=c(".light-box"),v=c("#choosePay").val(),g=c('.mode div[id="'+v+'"]').parent().data("value"),y=v?g:c(".mode").eq(0).data("value"),b=c("#payUrl").val();c.jqtab=function(e,t){c(e+" li").click(function(){return o=c(this).find("a").attr("tab"),c(e+" li").removeClass("thistab"),c(this).addClass("thistab"),c(t).hide(),c("#"+o).fadeIn(),!1})},c.jqtab("#tabs",".tab-con"),n(),h.click(function(){return i=c(this).data(),s=i.id,y=i.value,r=c("#"+y).attr("alt"),d=c("#"+y).attr("src"),h.removeClass("choose-type"),c(this).addClass("choose-type"),u.removeClass("choosed-tag"),c("#"+s).addClass("choosed-tag"),f.attr("value","前往"+r),p.attr("src",d),!1}),c(".btnby").click(function(){l=c(".order-num").text(),window.open(b+"?order_code="+l+"&payment_type="+y),m.show()}),c(".close").click(function(){m.hide()}),c(".change").click(function(){m.hide()})}),define("js/pay/wechatqrcode",["jquery"],function(e,t,a){function n(){console.log("ll"),i.ajax({url:s,dataType:"jsonp",success:function(e){"success"===e.message&&(window.location.href=r)}})}var i=e("jquery"),o=i(".w-odetail"),s=i("#payHost").val(),r=i("#paySuccessUrl").val(),d=i(".w-p-erm");e("plugin/jquery.qrcode"),o.click(function(){i(".w-addrinfo").slideToggle("slow"),o.find("i").hasClass("up")?o.html('收起详情<i class="down"></i>'):o.html('订单详情<i class="up"></i>')}),d.qrcode(d.data("url")),setInterval(n,3e3)}),define("plugin/jquery.qrcode",["jquery"],function(e,t,a){var n=e("jquery");!function(e){e.fn.qrcode=function(t){function a(e){this.mode=d,this.data=e}function i(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function o(e,t){if(void 0==e.length)throw Error(e.length+"/"+t);for(var a=0;a<e.length&&0==e[a];)a++;this.num=Array(e.length-a+t);for(var n=0;n<e.length-a;n++)this.num[n]=e[n+a]}function s(e,t){this.totalCount=e,this.dataCount=t}function r(){this.buffer=[],this.length=0}var d;a.prototype={getLength:function(){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},i.prototype={addData:function(e){this.dataList.push(new a(e)),this.dataCache=null},isDark:function(e,t){if(0>e||this.moduleCount<=e||0>t||this.moduleCount<=t)throw Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var e=1,e=1;40>e;e++){for(var t=s.getRSBlocks(e,this.errorCorrectLevel),a=new r,n=0,i=0;i<t.length;i++)n+=t[i].dataCount;for(i=0;i<this.dataList.length;i++)t=this.dataList[i],a.put(t.mode,4),a.put(t.getLength(),l.getLengthInBits(t.mode,e)),t.write(a);if(a.getLengthInBits()<=8*n)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=Array(this.moduleCount);for(var a=0;a<this.moduleCount;a++){this.modules[a]=Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[a][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),7<=this.typeNumber&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=i.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var a=-1;7>=a;a++)if(!(-1>=e+a||this.moduleCount<=e+a))for(var n=-1;7>=n;n++)-1>=t+n||this.moduleCount<=t+n||(this.modules[e+a][t+n]=a>=0&&6>=a&&(0==n||6==n)||n>=0&&6>=n&&(0==a||6==a)||a>=2&&4>=a&&n>=2&&4>=n?!0:!1)},getBestMaskPattern:function(){for(var e=0,t=0,a=0;8>a;a++){this.makeImpl(!0,a);var n=l.getLostPoint(this);(0==a||e>n)&&(e=n,t=a)}return t},createMovieClip:function(e,t,a){for(e=e.createEmptyMovieClip(t,a),this.make(),t=0;t<this.modules.length;t++)for(var a=1*t,n=0;n<this.modules[t].length;n++){var i=1*n;this.modules[t][n]&&(e.beginFill(0,100),e.moveTo(i,a),e.lineTo(i+1,a),e.lineTo(i+1,a+1),e.lineTo(i,a+1),e.endFill())}return e},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=0==e%2);for(e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=0==e%2)},setupPositionAdjustPattern:function(){for(var e=l.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var a=0;a<e.length;a++){var n=e[t],i=e[a];if(null==this.modules[n][i])for(var o=-2;2>=o;o++)for(var s=-2;2>=s;s++)this.modules[n+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s?!0:!1}},setupTypeNumber:function(e){for(var t=l.getBCHTypeNumber(this.typeNumber),a=0;18>a;a++){var n=!e&&1==(t>>a&1);this.modules[Math.floor(a/3)][a%3+this.moduleCount-8-3]=n}for(a=0;18>a;a++)n=!e&&1==(t>>a&1),this.modules[a%3+this.moduleCount-8-3][Math.floor(a/3)]=n},setupTypeInfo:function(e,t){for(var a=l.getBCHTypeInfo(this.errorCorrectLevel<<3|t),n=0;15>n;n++){var i=!e&&1==(a>>n&1);6>n?this.modules[n][8]=i:8>n?this.modules[n+1][8]=i:this.modules[this.moduleCount-15+n][8]=i}for(n=0;15>n;n++)i=!e&&1==(a>>n&1),8>n?this.modules[8][this.moduleCount-n-1]=i:9>n?this.modules[8][15-n-1+1]=i:this.modules[8][15-n-1]=i;this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var a=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var r=0;2>r;r++)if(null==this.modules[n][s-r]){var d=!1;o<e.length&&(d=1==(e[o]>>>i&1)),l.getMask(t,n,s-r)&&(d=!d),this.modules[n][s-r]=d,i--,-1==i&&(o++,i=7)}if(n+=a,0>n||this.moduleCount<=n){n-=a,a=-a;break}}}},i.PAD0=236,i.PAD1=17,i.createData=function(e,t,a){for(var t=s.getRSBlocks(e,t),n=new r,o=0;o<a.length;o++){var d=a[o];n.put(d.mode,4),n.put(d.getLength(),l.getLengthInBits(d.mode,e)),d.write(n)}for(o=e=0;o<t.length;o++)e+=t[o].dataCount;if(n.getLengthInBits()>8*e)throw Error("code length overflow. ("+n.getLengthInBits()+">"+8*e+")");for(n.getLengthInBits()+4<=8*e&&n.put(0,4);0!=n.getLengthInBits()%8;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*e)&&(n.put(i.PAD0,8),!(n.getLengthInBits()>=8*e));)n.put(i.PAD1,8);return i.createBytes(n,t)},i.createBytes=function(e,t){for(var a=0,n=0,i=0,s=Array(t.length),r=Array(t.length),d=0;d<t.length;d++){var c=t[d].dataCount,u=t[d].totalCount-c,n=Math.max(n,c),i=Math.max(i,u);s[d]=Array(c);for(var h=0;h<s[d].length;h++)s[d][h]=255&e.buffer[h+a];for(a+=c,h=l.getErrorCorrectPolynomial(u),c=new o(s[d],h.getLength()-1).mod(h),r[d]=Array(h.getLength()-1),h=0;h<r[d].length;h++)u=h+c.getLength()-r[d].length,r[d][h]=u>=0?c.get(u):0}for(h=d=0;h<t.length;h++)d+=t[h].totalCount;for(a=Array(d),h=c=0;n>h;h++)for(d=0;d<t.length;d++)h<s[d].length&&(a[c++]=s[d][h]);for(h=0;i>h;h++)for(d=0;d<t.length;d++)h<r[d].length&&(a[c++]=r[d][h]);return a},d=4;for(var l={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;0<=l.getBCHDigit(t)-l.getBCHDigit(l.G15);)t^=l.G15<<l.getBCHDigit(t)-l.getBCHDigit(l.G15);return(e<<10|t)^l.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;0<=l.getBCHDigit(t)-l.getBCHDigit(l.G18);)t^=l.G18<<l.getBCHDigit(t)-l.getBCHDigit(l.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return l.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,a){switch(e){case 0:return 0==(t+a)%2;case 1:return 0==t%2;case 2:return 0==a%3;case 3:return 0==(t+a)%3;case 4:return 0==(Math.floor(t/2)+Math.floor(a/3))%2;case 5:return 0==t*a%2+t*a%3;case 6:return 0==(t*a%2+t*a%3)%2;case 7:return 0==(t*a%3+(t+a)%2)%2;default:throw Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new o([1],0),a=0;e>a;a++)t=t.multiply(new o([1,c.gexp(a)],0));return t},getLengthInBits:function(e,t){if(t>=1&&10>t)switch(e){case 1:return 10;case 2:return 9;case d:return 8;case 8:return 8;default:throw Error("mode:"+e)}else if(27>t)switch(e){case 1:return 12;case 2:return 11;case d:return 16;case 8:return 10;default:throw Error("mode:"+e)}else{if(!(41>t))throw Error("type:"+t);switch(e){case 1:return 14;case 2:return 13;case d:return 16;case 8:return 12;default:throw Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),a=0,n=0;t>n;n++)for(var i=0;t>i;i++){for(var o=0,s=e.isDark(n,i),r=-1;1>=r;r++)if(!(0>n+r||n+r>=t))for(var d=-1;1>=d;d++)0>i+d||i+d>=t||0==r&&0==d||s==e.isDark(n+r,i+d)&&o++;o>5&&(a+=3+o-5)}for(n=0;t-1>n;n++)for(i=0;t-1>i;i++)o=0,e.isDark(n,i)&&o++,e.isDark(n+1,i)&&o++,e.isDark(n,i+1)&&o++,e.isDark(n+1,i+1)&&o++,(0==o||4==o)&&(a+=3);for(n=0;t>n;n++)for(i=0;t-6>i;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(a+=40);for(i=0;t>i;i++)for(n=0;t-6>n;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(a+=40);for(i=o=0;t>i;i++)for(n=0;t>n;n++)e.isDark(n,i)&&o++;return e=Math.abs(100*o/t/t-50)/5,a+10*e}},c={glog:function(e){if(1>e)throw Error("glog("+e+")");return c.LOG_TABLE[e]},gexp:function(e){for(;0>e;)e+=255;for(;e>=256;)e-=255;return c.EXP_TABLE[e]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},u=0;8>u;u++)c.EXP_TABLE[u]=1<<u;for(u=8;256>u;u++)c.EXP_TABLE[u]=c.EXP_TABLE[u-4]^c.EXP_TABLE[u-5]^c.EXP_TABLE[u-6]^c.EXP_TABLE[u-8];for(u=0;255>u;u++)c.LOG_TABLE[c.EXP_TABLE[u]]=u;return o.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=Array(this.getLength()+e.getLength()-1),a=0;a<this.getLength();a++)for(var n=0;n<e.getLength();n++)t[a+n]^=c.gexp(c.glog(this.get(a))+c.glog(e.get(n)));return new o(t,0)},mod:function(e){if(0>this.getLength()-e.getLength())return this;for(var t=c.glog(this.get(0))-c.glog(e.get(0)),a=Array(this.getLength()),n=0;n<this.getLength();n++)a[n]=this.get(n);for(n=0;n<e.getLength();n++)a[n]^=c.gexp(c.glog(e.get(n))+t);return new o(a,0).mod(e)}},s.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],s.getRSBlocks=function(e,t){var a=s.getRsBlockTable(e,t);if(void 0==a)throw Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=a.length/3,i=[],o=0;n>o;o++)for(var r=a[3*o+0],d=a[3*o+1],l=a[3*o+2],c=0;r>c;c++)i.push(new s(d,l));return i},s.getRsBlockTable=function(e,t){switch(t){case 1:return s.RS_BLOCK_TABLE[4*(e-1)+0];case 0:return s.RS_BLOCK_TABLE[4*(e-1)+1];case 3:return s.RS_BLOCK_TABLE[4*(e-1)+2];case 2:return s.RS_BLOCK_TABLE[4*(e-1)+3]}},r.prototype={get:function(e){return 1==(this.buffer[Math.floor(e/8)]>>>7-e%8&1)},put:function(e,t){for(var a=0;t>a;a++)this.putBit(1==(e>>>t-a-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},"string"==typeof t&&(t={text:t}),t=e.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:2,background:"#ffffff",foreground:"#000000"},t),this.each(function(){var a;if("canvas"==t.render){a=new i(t.typeNumber,t.correctLevel),a.addData(t.text),a.make();var o=document.createElement("canvas");o.width=t.width,o.height=t.height;for(var s=o.getContext("2d"),r=t.width/a.getModuleCount(),d=t.height/a.getModuleCount(),l=0;l<a.getModuleCount();l++)for(var c=0;c<a.getModuleCount();c++){s.fillStyle=a.isDark(l,c)?t.foreground:t.background;var u=Math.ceil((c+1)*r)-Math.floor(c*r),h=Math.ceil((l+1)*r)-Math.floor(l*r);s.fillRect(Math.round(c*r),Math.round(l*d),u,h)}}else for(a=new i(t.typeNumber,t.correctLevel),a.addData(t.text),a.make(),o=e("<table></table>").css("width",t.width+"px").css("height",t.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",t.background),s=t.width/a.getModuleCount(),r=t.height/a.getModuleCount(),d=0;d<a.getModuleCount();d++)for(l=e("<tr></tr>").css("height",r+"px").appendTo(o),c=0;c<a.getModuleCount();c++)e("<td></td>").css("width",s+"px").css("background-color",a.isDark(d,c)?t.foreground:t.background).appendTo(l);a=o,n(a).appendTo(this)})}}(n)});