index.js 237 KB
define("index",["jquery","handlebars","source-map","index","lazyload","dot","jquery.placeholder","jquery-pjax"],function(e,t,n){var a;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"),e("js/about/entry"),e("js/coupon/entry"),n.exports=a}),define("js/common",["jquery"],function(e,t,n){function a(e){var t=new RegExp(e+"=([^;$]*)","i"),n="$1";return t.test(decodeURIComponent(document.cookie))?RegExp[n]:""}function i(e,t,n){var a,i,o,s,r="";"undefined"!=typeof t&&(n=n||{},null===t&&(t="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(s=new Date,s.setTime(s.getTime()+24*n.expires*60*60*1e3)):s=n.expires,r="; expires="+s.toUTCString()),a=n.path?"; path="+n.path:"",i=n.domain?"; domain="+n.domain:"",o=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,a,i,o].join(""))}function o(){var e,t=a("_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=a("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function d(){var e,t,n={},a=window.location.search,i=a?decodeURIComponent(a).slice(1).split("&"):[];for(t=0;t<i.length;t++)e=i[t].split("="),n[e[0]]=e[1];return n}var l=e("jquery"),c=l("body");e("js/footer"),function(e,t,n,a,i){var o=t.createElement(n),s=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[i].p=arguments},o.async=1,o.src=a,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=a,window.setCookie=i,window.getUser=o,window.getUid=s,window.getShoppingKey=r,window.queryString=d}),define("js/footer",["jquery"],function(e,t,n){function a(){var e=s("#subscriber-box"),t=s("#subscriber-btn"),n=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,a={mail:"&#xe61b;",tick:"&#xe61a"};e.focus(function(){s(this).val("").css("color",""),t.removeClass("done").html(a.mail)}),t.click(function(){var i=s.trim(e.val());if(""!==i&&n.test(i))try{s.ajax({url:"http://www.yohobuy.com/common/emailSubscriber",dataType:"jsonp",data:{email:i,tmp:Math.random(),uid:window.getUid()},success:function(n){1===n.data.result?(e.val("已订阅到:"+i),t.addClass("done").html(a.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"),n=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 a=s(this),i=a.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://www.yohobuy.com/common/suggestFeedback",dataType:"jsonp",data:{feedback_id:l||0,question_id:c||0,answer:d||"",solution:r.join(",")},success:function(a){var s=o+1;if(1===~~a.data.result){if(o===n-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),a(),i(),window.rePosReturnTop=o}),define("js/header",["jquery","handlebars","source-map","index"],function(e,t,n){function a(e,t,n){try{ee.push({louceng:e,weizhi:t,event:n})}catch(a){}}function i(){var e=H("#nav_keyword").text(),t="vans",n=H("#query_key");""!==e?(n.css({color:"#000"}),n.val(e)):(n.css({color:"#e0e0e0"}),n.val(t),n.on("focus",function(e){n.css({color:"#000"}),n.val("")}))}function o(){var e={cookie:"_g",cartNum:""},t="",n="",a=0,i=0,o=0,s=0,r="";H.fn.miniCart=function(a){if(t=H.extend(e,a),"undefined"==typeof window.cookie(t.cookie))n=null;else if(t.cookie)try{n=Y.parse(window.cookie(t.cookie))}catch(i){}null!==n&&""!==n&&(s=parseInt(n._nac)+parseInt(n._ac),0===s?H("#icart-num").attr("class","icart-num icart-none"):H("#icart-num").attr("class","icart-num"),H(t.cartNum).html(s))},H.fn.search=function(e){function t(t){var n=H.trim(H(t).val());return n=n.replace(new RegExp("'","gm"),""),""===n?(H(".search-list").hide(),!1):(n=encodeURI(n),void H.get(e+"?query="+n,function(e){H(".search-list").html(e.data),a=H(".search-list").children("li").length,i=-1,a>0?H(".search-list").show():H(".search-list").hide(),H(".search-list").find("a").hover(function(){H(this).css("background-color","#eee")},function(){H(this).css("background-color","#fff")})},"jsonp"))}function n(e){H(".search-list li:eq("+o+")").children("a").css("background-color","#fff"),H(".search-list li:eq("+i+")").children("a").css("background-color","#eee"),r=H(".search-list li:eq("+i+")").children("a").attr("title"),H("#query_key").val(r)}return this.each(function(){H(this).keyup(function(e){if(38===e.which){if(0===a)return!1;-1===i&&(i=0),o=i,i=(i-1+a)%a,n(this)}else if(40===e.which){if(0===a)return!1;o=i,i=(i+1)%a,n(this)}else 13===e.which?window.submitSearch():t(this)})})},H.extend({getData:function(e,t,n){var a={page:1,method:"",v:1,return_type:"jsonp",open_key:"12345",tmp:Math.random()},i="";if(void 0===typeof e||""===e)return!1;i=H.extend(a,t),i.page=i.page||1;try{H.getJSON(e+"/?callback=?",i,function(e){return""!==n?("undefined"!=typeof n(e.data)&&Y.parse(n(e.data)),!1):void 0})}catch(o){console.log(o.message)}},getShoppingKey:function(){var e,t=window.cookie("_g"),n=Y.parse(t);return"undefined"==typeof t||null===t?(e=window.cookie("_SPK"),e?e:""):n._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="yoho-notice"><div class="notice-container center-content"><h1 class="notice-title">关于系统升级的公告</h1><div class="notice-content"><p class="tips">尊敬的顾客:</p><p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p><p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p></div></div></div>',H("body").prepend(t))}function r(e){var t=document.createElement("script");t.src=de+e+"&client_type=web&callback=JsonPCallBack",document.getElementsByTagName("head")[0].appendChild(t)}function d(e,t){var n,a;H(e).hover(function(e){e.preventDefault(),n=H(this),a=H(t)[0],""===a.style.display?(n.addClass("acttags"),a.style.display="block"):(n.removeClass("acttags"),a.style.display="")})}function l(){var e,t,n=[{sourceClass:".myyoho",targetClass:".myyoho-info"},{sourceClass:".phone",targetClass:".qr"}];for(t=0;t<n.length;t++)e=n[t],d(e.sourceClass,e.targetClass)}function c(){var e;H(".yohogroup").mouseenter(function(){e=H(this),e.text(e.attr("cn"))}),H(".yohogroup").mouseleave(function(){e=H(this),e.text(e.attr("en"))})}function u(){var e,t,n=["webkit","moz","ms"];for(t=0;t<n.length;t++)return e=n[t]+"RequestAnimationFrame",window[e]?!0:!1}function h(){var e=["webkit","moz","ms"],t=e[0]+"RequestAnimationFrame",n=e[1]+"RequestAnimationFrame",a=e[2]+"RequestAnimationFrame";return window[t]?function(e){requestAnimationFrame(e)}:window[n]?function(e){window[n](e)}:window[a]?function(e){window[a](e)}:function(e){window.setTimeout(e,67)}}function p(){ne+=10,ae.css({transform:"rotateX("+ne+"deg)","-webkit-transform":"rotateX("+ne+"deg)","-moz-transform":"rotateX("+ne+"deg)"}),ne/90%2===1&&(ie?(ae.css("background-image","url(http://static.yohobuy.com/newheader/img/logo1.png)"),ie=!1):(ae.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ie=!0)),ne/90%2===0&&ne%360!==0?window.setTimeout(p,3e3):ne%360===0?window.setTimeout(p,6e4):te(function(){p()})}function f(){W&&window.clearTimeout(W),ae.fadeOut(oe,function(){ie=!1,ae.css("background-image","url(http://static.yohobuy.com/newheader/img/logo.png)"),ae.fadeIn(oe,function(){M=window.setTimeout(function(){ae.fadeOut(oe,function(){window.clearTimeout(M),ie=!0,ae.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ae.fadeIn(oe,function(){W=window.setTimeout(f,6e4)})})},3e3)})})}function m(){u()?(te=h(),window.setTimeout(p,3e3)):window.setTimeout(f,3e3)}function g(e){var t=H(e);t.find(".thirdnavbar").each(function(){var e=H(this),t=e.find("a"),n=t.attr("href"),a="hot"===t.attr("hot")?!0:!1,i={};i=e.hasClass("category-title")?{type:"title",height:49,content:e.text(),index:window.valueIndex,href:n,hot:!1}:{type:"catlist",height:36,content:t.text(),index:window.valueIndex,href:n,hot:a},window.valueIndex++,window.newArr.push(i)})}function v(){var e=window.newArr.length,t=0,n=[],a=[],i=[],o=[],s="",r="",d="",l=0,c=0,u=0;for(t;e>t;t++){if(n=window.newArr[t],0===window.gindex&&(window.oh1=window.oh1+n.height,window.oh1>=340&&t!==e-1&&(window.targetArr1=window.newArr.slice(0,n.index+1),window.nowIndex=n.index+1,window.gindex++),t===e-1)){window.targetArr1=window.newArr.slice(0,e+1);break}if(1===window.gindex&&(window.oh2=window.oh2+n.height,window.oh2>=340&&t!==e-1&&(window.targetArr2=window.newArr.slice(window.nowIndex,n.index+1),window.nowIndex=n.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+n.height,window.oh3>=340&&t!==e-1){window.targetArr3=window.newArr.slice(window.nowIndex,n.index+1),window.nowIndex=n.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++)a=window.targetArr1[l]||{},"title"===a.type?window.inner1=window.inner1+'<li class="cattitle"><h3><a  href="'+a.href+'">'+a.content+"</a></h3></li>":a.hot===!0?window.inner1=window.inner1+'<li class="catdetail"><a  class="thirdcatelink hot" href="'+a.href+'">'+a.content+"</a></li>":window.inner1=window.inner1+'<li class="catdetail"><a  class="thirdcatelink" href="'+a.href+'">'+a.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,H("#"+window.wrapperindex).empty().append(window.finalresult)}function y(){H(".categorywrapper").each(function(e){window.wrapperindex=H(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="",g(H(this).find(".category")),v()})}function b(){var e={},t="",n="",a="",i="",o="";H(document).on("mouseenter",".sub-nav-item",function(){t=H(this).find(".showdetail").attr("data-code"),t&&(e[t]||(e[t]=t,n=H(this).find(".showdetail").find("img"),a=H(this).find(".showdetail").find(".title"),i=H(this).find(".showdetail").find("a"),H.get(de+t+"&width=337&height=250&client_type=web",function(e){n.attr("src",e.data.src),i.attr("href",e.data.url),a.text(e.data.title)},"jsonp")))}),o=H(".cure").find(".name-cn").find("a").attr("href"),H(".main-link").attr("href",o)}function w(){var e=H("#cover");e.remove()}function C(){var e,t=window.cookie("_Gender"),n="",i="",o="",s="";"http://www.yohobuy.com/"!==window.location.href||"undefined"!=typeof t&&""!==t&&null!==t||H.get("http://www.yohobuy.com/index/guide",function(t){n=document.createElement("div"),n.id="cover",n.innerHTML=t,document.body.appendChild(n),i=H(window).height(),o=H(".guide-box").height(),e=i/2-o/2,s=H(".guide-box .clear").find("li").length,H(".guide-box").css({width:200*s+"px",top:e+"px"}),H("#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()}),H("#cover .guide-box .close").bind("click",function(e){a("弹窗","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()}),H(".boys img , .boys .go").bind("click",function(e){a("弹窗","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()}),H(".girls img, .girls .go").bind("click",function(e){a("弹窗","GIRLS","homepage_woman"),window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})}),H(".lifestyle img, .lifestyle .go").bind("click",function(e){window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),a("弹窗","LIEFSTYLE","homepage_lifestyle")}),H("#cover .guide-box").bind("click",function(e){e.stopPropagation()})})}function i(){var e=H("#nav_keyword").text(),t=H("#defaultsearch").val(),n=H("#query_key");""!==e?(n.css({color:"#000"}),n.val(e)):(n.css({color:"#e0e0e0"}),n.val(t),n.on("focus",function(e){n.css({color:"#000"}),n.val("")})),H(document).click(function(e){H(e.target).closest(".searchspan, .search-list").length||H(".search-list").hide()})}function _(){var e=window.cookie("_Gender"),t=H(".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 x(){H(".first-nav-item").click(function(){var e=window.cookie("_Gender");"undefined"!=typeof e&&""!==e&&window.setCookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===H(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})),"女生"===H(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})),"创意生活"===H(this).find(".name-cn a").text()&&window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===H(this).find(".name-cn a").text()&&window.setCookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})})}function k(){var e,t,n,a=document.cookie,i=a.split(";");for(e=0;e<i.length;e++)t=i[e].split("="),"undefined"!=typeof t[0]&&(n=t[0].replace(/\s/g,""),re[n]=t[1])}function j(){H("#miniCartBox").miniCart({cartNum:".ic-infomation"})}function S(){var e,t,n;H.getData("http://www.yohobuy.com/common/shoppingCart","",function(a){""===V&&(V=G.compile(H("#mini-cart-tpl").html())),H("#miniCartBox").children(".gobuy-wrapper").html(V({carData:a})),0===parseInt(H(".ic-infomation").html())&&H("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'),H("#miniCartBox .goods-list li").length<1&&(e=window.cookie("_g"),t=Y.parse(e),null!==t&&(n='{"_k":"'+t._k+'","_nac":0,"_ac":0,"_r":0}',window.setCookie("_g",n,{path:"/",domain:".yohobuy.com"})),H(".ic-infomation").html(0),H("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'))})}function T(e,t,n){H.getData("http://www.yohobuy.com/common/delCartGoods",{product_sku:e,promotion_id:t,product_num:n},function(e){var t=window.cookie("_g"),n=Y.parse(t),a='{"_k":"'+n._k+'","_nac":'+e.total_goods_num+',"_ac":0,"_r":0}';window.setCookie("_g",a,{path:"/",domain:".yohobuy.com"}),S(),j()})}function q(){var e,t,n,a;H(document).on("click",".goodscardelete",function(i){e=H(this),t=e.attr("product_sku"),n=e.attr("promotion_id"),a=e.prev("h3").find(".num").html(),T(t,n,a)})}function E(){var e;H(document).on("click",".mycart_i_down",function(t){e=H(this),e.toggleClass("mycart_i_up"),H("#mycartmore").slideToggle(300)})}function I(){var e,t="http://www.yohobuy.com/shopping/cart";H("#miniCartBox").on("click",function(n){e=H(n.target),e.hasClass("gobuy")&&(window.location.href=t)})}function A(e){1===e?(H("#miniCartBox").addClass("list-cur"),H(".gobuy-wrapper").show(),0!==parseInt(H(".ic-infomation").html())?(H("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-loading"><h3 class="information">加载中,请稍后</h3></div>'),S()):H("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>')):(H("#miniCartBox").removeClass("list-cur"),H(".gobuy-wrapper").hide())}function F(){var e;H("#miniCartBox").mouseenter(function(t){e=H(t.target),("miniCartBox"===e.attr("id")||"ic-infomation"===e.attr("class"))&&A(1)}),H("#miniCartBox").mouseleave(function(e){A(0)})}function U(){var e,t="indexkids",n="indexlifestyle",a="indexboys",i="indexgirls",o="uniquebrand",s=window.location.href,d=window.location.host,l="";-1!==s.indexOf("search")&&(l=se["search"+re._Channel]),-1!==s.indexOf("list")&&(l=se["list"+re._Channel]),-1!==s.indexOf("brands")&&(l=se["brands"+re._Channel]),-1!==s.indexOf("new")&&(l=se["new"+re._Channel]),-1!==s.indexOf("sale")&&(l=se["sale"+re._Channel]),-1!==s.indexOf("home")&&(l=se["home"+re._Channel]),-1!==s.indexOf("kids")&&(l=se[t]),(-1!==s.indexOf("woman")||-1!==s.indexOf("girls"))&&(l=se[i]),-1!==s.indexOf("lifestyle")&&(l=se[n]),-1!==s.indexOf("www.yohobuy.com")&&"/"===window.location.pathname&&(l=se[a]),e=d.split(".")[0],"list"!==e&&"search"!==e&&"www"!==e&&"new"!==e&&"item"!==e&&"guang"!==e&&(l=se[o+re._Channel]),r(l)}function D(e){H(".hot-brands").find("ul").stop().animate({opacity:0,"z-index":1},200).eq(e).animate({opacity:1,"z-index":2},200)}function P(){var e,t=0;H(".hot-brands").size()>0&&(e=H(".hot-brands").find("ul").size(),H(".hot-brands").find("ul").eq(0).css({opacity:1,"z-index":2}),H(".brands-control").on("click",".next",function(){t===e-1?t=0:t++,D(t)}),H(".brands-control").on("click",".prev",function(){0===t?t=e-1:t--,D(t)}))}function O(){setInterval(j,2e3)}function L(){var e=H("#goodcartempwarpper"),t="";e&&e.html()&&(t=H("#goodcartempwarpper").html().replace(/\\/g,""),H("#goodcartempwarpper").html(t),Q=G.compile(H("#tmpl-my-login-new").html()))}function N(){var e="http://search.yohobuy.com/api/suggest";H("#query_key").search(e)}function $(e){var t=(new Date).getTime(),n='<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>]',a='<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=H("#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.html",p="1",f=0,m={user_name:s,logout:h,random:Math.random()};if(X=G.compile(a),"undefined"==typeof o||null===o)return i.html(n),!1;if("undefined"==typeof c||c.length<4)return i.html(n),!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.html",-1===e.result&&(p="-1"),m.islogin=p,i.html(X(m))}function z(e){var t=e.data,n="";if(1===e.result){if(void 0===typeof t||t.length<1)return!1;"3"===t.vip.curVipInfo.curLevel&&(t.vip3=!0),H("#myYohoBox").mouseenter(function(){return H(this).addClass("acttags"),H("#myYohoBox .myyoho-info").show().html(Q(t)),n=H(".myyoho-photo img").attr("data-url"),1===H._checkUrlState?void H(".myyoho-photo").show().find("img").attr("src",n):void(""!==n&&""===H._checkUrl&&H.ajax({url:n,type:"GET",complete:function(e){(200===e.status||0===e.status)&&(H(".myyoho-photo").show().find("img").attr("src",n),H._checkUrlState=1),H._checkUrl=n}}))}),H("#myYohoBox").mouseleave(function(){H(this).removeClass("acttags"),H("#myYohoBox .myyoho-info").hide()})}}function B(){H.getData("http://www.yohobuy.com/common/passport","",function(e){-1!==e.result?($(e),z(e)):window.setCookie("_UID","",{path:"/",domain:".yohobuy.com",expires:-1})})}function R(){y(),b(),L(),C(),_(),x(),k(),o(),c(),l(),m(),U(),P(),F(),j(),O(),N(),I(),q(),E(),B(),i()}var W,M,H=e("jquery"),G=e("handlebars"),Y=e("index"),Q=null,X=null,V="",Z=/^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/]{0,}$/g,J="",K="",ee=[],te=null,ne=0,ae=H(".icon-logo"),ie=!0,oe=500,se={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"},re={},de="http://new.yohobuy.com/common/getbanner?content_code=";H("#api-domain").remove(),window.submitSearch=function(){var e,t,n=H("#query_key").val(),i=H("#defaultsearch").val(),o="Search",s="Head Search",r="Search";if(e=H.trim(J.toLowerCase()),t=H.trim(n.toLowerCase()),a(o,s,r),""!==K&&""!==J&&e===t)location.href=K.replace("'","");else{if(!Z.test(n)||""===n)return""===n&&H("#query_key").val(i),H("#searchForm").submit(),!1;location.href="http://search.yohobuy.com/error?query="+n+"&result=error"}},G.registerHelper("timestamp",function(){return(new Date).getTime()}),G.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}),G.registerHelper("equallevelthree",function(e,t){return"3"===e?t.fn(this):t.inverse(this)}),G.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="",R()}),define("js/simple-header",["jquery"],function(e,t,n){function a(e){var t,n,a,i=0,o=0;for(a=0;a<e.length;a++)n=e.substr(a,1),o+=/.*[\u4e00-\u9fa5]+.*$/.test(n)?2:1;if(10>=o)t=e;else{for(i=0,t="",a=0;a<e.length;a++)10>i&&(n=e.substr(a,1),"*"!==n&&(i+=/.*[\u4e00-\u9fa5]+.*$/.test(n)?2:1),t+=n);t.length<e.length&&(t+="...")}return t}function i(e){var t,n,i=e.data;-1!==e.result?(n=a(i.profile_name),t='<span>Hi~</span><a href="http://www.yohobuy.com/home?t='+i.random+'">'+n+'</a>&nbsp;<a href="http://www.yohobuy.com/logout.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"};s.getJSON("http://www.yohobuy.com/common/passport/?callback=?",e,function(e){e&&e.data&&i(e.data)})}var s=e("jquery"),r=s("#api-domain");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,n){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,n){var a=e("jquery");e("js/product/filter"),e("js/product/sort-pager"),e("js/product/latest-walk"),e("js/product/product"),function(){var e,t=a(".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,n){function a(e,t){e.each(function(){g(this).closest(".attr").hasClass("checked")||g(this).removeClass("checked").html(y.unchecked)}),t.find(".checkbox").addClass("checked").html(y.checked)}function i(){w.addClass("hide"),_.removeClass("hide")}function o(){_.addClass("hide"),w.removeClass("hide"),S.children("span").removeClass("hover")}function s(e,t){var n,a=window.queryString();a[e]=t,delete a.page,n="?"+decodeURIComponent(g.param(a)),window.location.href=n}function r(e){I.children(".senior-sub:eq("+m+")").addClass("hide"),A.children(".attr:eq("+m+")").removeClass("hover"),m=-1}var d,l,c,u,h,p,f,m,g=e("jquery"),v=e("handlebars"),y={unchecked:"&#xe635;",checked:"&#xe636;"},b={up:"&#xe610;",down:"&#xe600;"},w=g(".brand .default"),C=g("#brand-search-input"),_=g(".brand .brand-panel"),x=_.find(".attr"),k=g("#brand-more"),j=g("#brand-multi"),S=g(".brands-index"),T=g(".ud-price-range"),q=/^\d+$/,E=g(".sort-sub-wrap"),I=g(".senior-sub-wrap"),A=g(".senior-attr-wrap"),F='{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',U={},D=g(".filter-box .size");F=v.compile(F),g(".filter-box").on("selectstart",".attr, .brands-index span",function(){return!1}),g(".sort-pre").on("click","li",function(){var e=g(this),t=e.index(),n=e.data("id");return e.hasClass("active")?(e.removeClass("active"),E.children(":eq("+t+")").addClass("hide"),void D.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),E.children(":not(.hide)").addClass("hide"),E.children(":eq("+t+")").removeClass("hide"),void(D.data("load")||(U[n]?(D.find(".attr-content").html(U[n]),D.removeClass("hide")):g.ajax({url:"/product/search/sortSize",data:{msort:n}}).then(function(e){"array"===g.type(e)&&e.length?(U[n]=F({size:e}),D.find(".attr-content").html(U[n]),D.removeClass("hide")):D.addClass("hide")}))))}),k.length>0&&(d=k.children("em"),l=k.children(".iconfont")),j.click(function(){"none"===_.css("display")&&k.trigger("click"),i(),_.removeClass("hide").addClass("multi"),g(this).addClass("hide"),k.addClass("hide")}),k.click(function(){var e=g(this);e.hasClass("more")?(o(),d.text("更多"),l.html(b.down),C.val("").trigger("keyup")):(i(),d.text("收起"),l.html(b.up)),g(this).toggleClass("more")}),S.on("mouseenter","span",function(){var e=g(this),t=e.data("index");e.hasClass("hover")||setTimeout(function(){e.siblings("span.hover").removeClass("hover"),e.addClass("hover"),0===e.index()?x.removeClass("hide"):x.addClass("hide").filter("[data-index="+t+"]").removeClass("hide")},120)}),C.keyup(function(){var e=g(this).val().toLowerCase();""===e?x.removeClass("hide"):x.addClass("hide").filter('[data-key*="'+e+'"]').removeClass("hide")}),g("#brand-multi-ok").click(function(){var e=[];g(this).hasClass("dis")||(_.find("span.checked").each(function(){e.push(g(this).data("id"))}),s("brand",e.join(",")))}),g(".multi-select-cancel").click(function(){var e=g(this).closest(".multi");e.hasClass("brand-panel")&&(j.removeClass("hide"),k.trigger("click"),k.removeClass("hide"),C.val("").trigger("keyup"),o()),e.addClass("hide").removeClass("multi"),a(e.find(".checkbox.checked"),e.find(".attr.checked")),g(this).siblings(".multi-select-ok").addClass("dis")}),g(".check-container").on("click",".attr",function(){var e=g(this),t=e.find(".checkbox"),n=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?n.removeClass("dis"):n.addClass("dis")}),g(".brand, .senior").on("click",".attr > a",function(e){g(this).closest(".multi").length>0&&e.preventDefault()}),g(".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,n,a=g.trim(g(this).val()),i=q.test(a);i||(e=parseInt(a,10),g(this).val(isNaN(e)?"":e)),t=g.trim(u.val()),n=g.trim(h.val()),""!==t||""!==n?p.removeClass("hide"):p.addClass("hide")}),p.click(function(){var e,t=g.trim(u.val()),n=g.trim(h.val());""!==t&&""!==n&&+t>+n&&(e=n,n=t,t=e),s("price",t+","+n)})),A.on("mouseenter",".attr",function(){var e=g(this),t=e.index();e.hasClass("no-sub")||(e.addClass("hover").siblings().removeClass("hover"),I.children(".senior-sub:eq("+t+")").removeClass("hide").siblings().addClass("hide"))}).on("mouseleave",".attr",function(){var e=g(this),t=e.index();
e.hasClass("no-sub")||(m=t,f=setTimeout(function(){r()},100))}),g(".senior-sub").on("click",".multi-select",function(){g(this).closest(".senior-sub").addClass("multi")}).on("click",".multi-select-ok",function(){var e=g(this),t=e.closest(".senior-sub"),n=[];e.hasClass("dis")||(t.find("span.checked").each(function(){n.push(g(this).data("id"))}),s(t.data("attr"),n.join(",")))}).on("mouseenter",function(){clearTimeout(f)}).on("mouseleave",function(){r()})}),define("js/product/sort-pager",["jquery"],function(e,t,n){var a=e("jquery"),i=a("#count-per-page"),o=i.next("ul"),s=200;a(document).click(function(e){a(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,n){var a=e("jquery"),i=e("handlebars"),o=e("lazyload"),s=a("#latest-walk-count");!function(){var e;0!==s.length&&(e=i.compile(a("#latest-walk-tpl").html()),a.ajax({url:"http://www.yohobuy.com/common/recentReview",dataType:"jsonp",data:{limit:s.val()},success:function(t){var n,i,s,r=[];if(200===t.code){if(n=t.data,0===n.length)return void a(".latest-walk").addClass("hide");for(i=0;i<n.length;i++)s=n[i],r.push({href:s.url,img:s.pic_url,name:s.product_name,salePrice:s.price,marketPrice:s.market_price});r.length>0&&(a("#latest-walk-goods").html(e({latestWalk:r})),o(a("#latest-walk-goods .lazy")))}}}))}()}),define("js/product/product",["jquery","lazyload","handlebars","source-map"],function(e,t,n){var a,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 n,a,i,o="",s=e.length,r=4,d=Math.ceil(s/r),l=0;for(n=0;d>n;n++)for(o+="<ul>",a=0;r>a&&(i=n*r+a,i!==s);a++)o+='<li><a target="_blank" href="'+e[n*r+a].url+t+'"><img src="'+e[n*r+a].src+'" data-cover="'+e[n*r+a].coverImg+'" /></a></li>',a===r-1&&(o+="</ul>",l++);return d>l&&(o+="</ul>"),{colorListStr:o,ulNum:d}}function n(){u.html(""),h.html(""),c.css({display:"none"})}a=null,l.unbind(),a=r(l,e),a.addHandler("MouseEnter",function(e){var a,o,s,r,l,p,f,m,g=10,v=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,_=t(C.pics,b);n(),y=_.colorListStr,a=_.ulNum,u.append(e.targetDuplicate),h.append(i(y)),p=c.css("paddingLeft"),f=c.css("paddingTop"),m=d.css("paddingTop"),o=10+65*a+e.targetWidth,r=(e.targetX-1)*(e.targetWidth+g)-(parseInt(p)+1),l=(e.targetY-1)*(e.targetHeight+v)+parseInt(m)-(parseInt(f)+1),s=e.offsetR-(65*a+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)})}),a.addHandler("MouseLeave",function(){n()}),c.mouseleave(function(){n()})},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"),n=i("#brand-favor");t.length&&i.ajax({type:"POST",url:"/product/index/getNodeContent",data:{node:t.data("node")}}).then(function(e){t.html(e)}),n.length&&(e=i("#pic-link-tpl").html(),i.ajax({type:"POST",url:"/product/index/getAdnav",data:{brandId:n.data("id")}}).then(function(t){t&&i("#brand-ad").html(s.compile(e)({picLink:t}))}))}()}),define("js/common/product-event",["jquery"],function(e,t,n){function a(){this.handlers={}}var i=e("jquery");a.prototype={constructor:a,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,n;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],n=0;n<t.length;n++)t[n](e)},removeHandler:function(e,t){var n,a;if(this.handlers[e]instanceof Array){for(n=this.handlers[e],a=0;a<n.length&&n[a]!==t;a++);n.splice(a,1)}}},n.exports=function(e,t){function n(e){var n,a=0,u=0,h=t,p=0,f="",m=0,g=0;switch(e.type){case"mouseenter":n=i(this),o=setTimeout(function(){s=!0,f=n.clone(),p=n.index()+1,a=p%h===0?h:p%h,u=Math.ceil(p/h),m=n.offset().left,g=c-(m+d),r.fire({type:"MouseEnter",target:n,targetWidth:d,targetHeight:l,targetX:a,targetY:u,rowWidth:h,activeIndex:p,targetDuplicate:f,offsetL:m,offsetR:g})},150);break;case"mouseleave":s||(o&&clearTimeout(o),r.fire({type:"MouseLeave"})),s=!1}}var o,s,r=new a,d=e.eq(0).width(),l=e.eq(0).height(),c=i(window).width();return e.bind({mouseenter:n,mouseleave:n}),r}}),define("js/product/brand",["jquery"],function(e,t,n){var a=e("jquery"),i=a("#brand-favor"),o=i.data("id");i.on("click",function(){a.ajax({type:"post",url:"/product/index/favoriteBrand",data:{brandId:o}}).then(function(e){200===e.code?i.find("i").toggleClass("coled"):403===e.code&&(location.href="http://www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})}),a.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,n){var a=e("jquery"),i=e("handlebars"),o=e("lazyload");e("js/common/slider"),e("js/common/logo-brand"),o(a("img.lazy")),a(".slide-container").slider(),a(".logo-brand").logoBrand({showNum:10,url:a(".logo-brand").data("url")}),function(e){function t(t,n){var d={};d=n?{sid:t,page:n}:{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(a),n?(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 n,a,s,r=e(".hot-week").find(".floatlayer"),d=(e(".hot-cate").find("li").eq(0).data("sid"),1),l=0,c=!1;a='{{# 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 a,i=n+e(".hot-week").outerHeight();n=e(".hot-week").offset().top,e(this).scrollTop()>=n-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()>=n+e(".hot-week").height()-e(window).height()&&(c||(a=e(".hot-cate").find("li.current").data("sid"),d++,c=!0,t(a,d)))}),e(".hot-cate").find("li").each(function(t){var n=e(".hot-cate").width();n>=l&&(l+=e(this).width(),l>=n&&e(".floatlayer").find("li").eq(t).hide().nextAll().hide())}),e(".hot-cate").on("click","li",function(){var a=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(a).addClass("current"),e("body,html").stop().animate({scrollTop:n-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")}(a)}),define("js/common/slider",["jquery","lazyload"],function(e,t,n){var a=e("jquery"),i=e("lazyload");!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.slider.defaults,n),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">',n=0;if(!(this.len<=1)){for(n=0;n<this.len;n++)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(n){return this.each(function(){var a=e(this),i=a.data("Slider"),o="object"==typeof n&&n;i||a.data("Slider",i=new t(this,o)),"string"==typeof n&&i[n]()})},e.fn.slider.Constructor=t,e.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(a)}),define("js/common/logo-brand",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var a=e("jquery"),i=e("handlebars"),o=e("lazyload");!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.logoBrand.defaults,n),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,n){var a="<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=n.fn(t[i]),a=i%e===5||5===i?a+'<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?a+'<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>":a+'<li data-page="'+Math.floor(i/e)+'">'+o+"</li>";return a+'<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 n,a;e&&0!==e.length&&(t._createHelper(),a='{{#brandList logoBrand}}<a href="{{href}}" target="_blank"><img class="lazy" data-original="{{img}}" alt=""></a>{{/brandList}}',n=i.compile(a),t.$element.html(n(e)),t.$element.find(".brand-more a").attr("href",e.moreBrand),o(t.$element.find("img.lazy")),t._bindEvent())}})},_brandShow:function(t,n){var a=this;o(e("li[data-page="+n+"]").find("img.lazy").trigger("appear")),a.$element.find("li[data-page="+t+"]").find("img").fadeOut("normal",function(){a.$element.find("li").hide(),a.$element.find("li[data-page="+n+"]").show().find("img").fadeIn()})},_bindEvent:function(){var t=this;t.$element.on("click",".next",function(){var n=e(this).parent().data("page"),a=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;a=n===i?0:n+1,t._brandShow(n,a)}),t.$element.on("click",".prev",function(){var n=e(this).parent().data("page"),a=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;a=0===n?i:n-1,t._brandShow(n,a)})}},e.fn.logoBrand=function(n){return this.each(function(){var a=e(this),i=a.data("LogoBrand"),o="object"==typeof n&&n;i||a.data("LogoBrand",i=new t(this,o)),"string"==typeof n&&i[n]()})},e.fn.logoBrand.Constructor=t,e.fn.logoBrand.defaults={showNum:16,url:"/boys/getBrand"}}(a)}),define("js/product/item",["jquery","lazyload","handlebars","source-map","index"],function(e,t,n){function a(e){h.attr("src",e)}function i(){return+y.text()}function o(){y.text("1"),1===E||0===E?(b.addClass("dis"),w.addClass("dis")):(b.removeClass("dis"),w.addClass("dis"))}function s(e){0!==k.length&&(0===E||e&&0===~~e.data("total")?(k.addClass("hide"),_.removeClass("hide")):(k.removeClass("hide"),_.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"),g=f.find(".size-warn"),v=f.children(".color-size-tip"),y=d("#num"),b=d("#plus-num"),w=d("#minus-num"),C=d("#add-to-cart"),_=d("#sold-out"),x=d(".lc-container"),k=d(".item-buy"),j=d("#desc-color"),S={},T=d(".main"),q=T.data("id"),E=-1,I=200,A={def:"收藏商品",coled:"已收藏",hover:"取消收藏"},F=e("js/common/dialog").Alert;e("js/product/latest-walk"),e("js/common/share"),function(){var e,t=d("#size-title-json"),n=t.html();""!==n&&(e=u.parse(n),t.remove(),m.children("li").each(function(){var t=d(this),n=t.data("name");t.data("title",e[n])}))}(),S[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),n=t.index();v.addClass("hide"),g.addClass("hide"),E=-1,t.hasClass("focus")?m.eq(n).children("li").removeClass("focus"):(t.siblings(".focus").removeClass("focus"),t.addClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(n).removeClass("hide").find("img"),"undefined"==typeof S[n]&&(l(e,{event:"sporty"}),e.trigger("sporty"),S[n]=!0),a(e.first().data("shower")),j.text(t.data("color")),m.not(".hide").addClass("hide").children("li").removeClass("focus"),m.eq(n).removeClass("hide")),o(),s(t)}),d("#thumbs").on("mouseenter",".thumb",function(){a(d(this).data("shower"))}),f.on("click","li",function(){var e=d(this);e.hasClass("focus")||(E=+e.data("num"),e.siblings(".focus").removeClass("focus"),e.addClass("focus"),v.html(e.data("title")).removeClass("hide"),g.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===E?void r():void(0!==E&&(e===E-1&&d(this).addClass("dis"),1===e&&w.removeClass("dis"),y.text(e+1>E?E:e+1)))}).on("selectstart",function(){return!1}),w.click(function(){var e=i();d(this).hasClass("dis")||(2===e&&d(this).addClass("dis"),e===E&&b.removeClass("dis"),y.text(0>e-1?0:e-1))}).on("selectstart",function(){return!1}),d(".get-lc:not(.dis)").hover(function(){x.removeClass("hide")},function(){x.addClass("hide")}),C.click(function(){return-1===E?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(I),d("#balance").slideDown(I),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:q,type:e?"cancel":"add"}}).then(function(n){var a=n.code;200===a?(t.toggleClass("coled"),e?t.find("em").text(A.def):t.find("em").text(A.coled)):403===a&&(location.href=n.data.url)})}).hover(function(){var e=d(this);e.hasClass("coled")&&e.find("em").text(A.hover)},function(){var e=d(this);e.hasClass("coled")&&e.find("em").text(A.coled)}),d("#keep-shopping").click(function(){d("#type-chose").slideDown(I),d("#balance").slideUp(I)}),d("#buy-now").click(function(){var e,t,n;if(-1===E)return void r();if(!d(this).hasClass("dis")){if(t=d(this).data("base"),!t)return n=new F("打开APP可抢购该商品哦~~"),void n.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(),n=d(".description-content"),a=d(".material-content");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(n.slideDown(I),a.slideUp(I)):(n.slideUp(I),a.slideDown(I)))}),d(".after-service-switch").click(function(){var e=d(this),t=e.next(".after-service-content"),n={def:"&#xe604;",spread:"&#xe603;"};"none"===t.css("display")?(t.slideDown(I),e.find(".triangle").html(n.spread)):(t.slideUp(I),e.find(".triangle").html(n.def))}),d.ajax({type:"GET",url:"/product/item/hotarea",data:{productId:q}}).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(){n||(n=!0,d.ajax({type:"GET",url:"/product/item/comments",data:{productId:q,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(){n=!1}))}function t(){a||(a=!0,d.ajax({type:"GET",url:"/product/item/consults",data:{productId:q,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(){a=!1}))}var n,a,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(),n=d(".comments"),a=d(".consults");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(a.slideDown(I),n.slideUp(I)):(a.slideUp(I),n.slideDown(I)))}).on("click",".load-more",function(){var n=d(this);n.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"),n=t.find(".my-consult"),a=d.trim(n.val()),i=t.find(".consult-warn"),o=!0;""===a?(n.addClass("error"),i.removeClass("hide"),o=!1):(n.removeClass("error"),i.addClass("hide")),o!==!1&&d.ajax({type:"POST",url:"/product/item/addconsult",data:{productId:q,content:a}}).then(function(e){var a=e.code;200===a?(t.addClass("hide"),t.siblings(".consult-success").removeClass("hide"),n.val("")):403===a&&(location.href=e.data.url)})}),e(),t()}()}),define("js/common/dialog",["jquery","handlebars","source-map"],function(e,t,n){function a(){return 0===l(".body-mask").length&&l("body").append('<div class="body-mask hide"></div>'),l(".body-mask").css({height:l(document).height(),width:l(document).width()})}function i(e){return l("body").append(p(e)),l(".yoho-dialog")}function o(e){var t=l(".yoho-dialog"),n='<p class="sub-content">'+e+"</p>";t&&t.length>0&&t.find(".content").after(n)}function s(e){function t(e){r.$el.find("#dialog-"+s.btns[e].id).on("click",function(){s.btns[e].cb&&s.btns[e].cb()})}var n,s=l.extend({},u,e),r=this;if(s.inherit)return this;if(s.mask&&(r.$mask=a()),r.$el=i(s),s.subContent&&o(s.subContent),s.subContents)for(n=s.subContents.length-1;n>=0;n--)o(s.subContents[n]);if(r.$el.find(".close").click(function(){r.close()}),r.$el.find(".btn-close").click(function(){r.close()}),s.btns)for(n=0;n<s.btns.length;n++)t(n)}function r(e){var t=this,n={content:e,className:"alert-dialog",btns:[{id:"alert-sure",btnClass:["alert-sure"],name:"确定",cb:function(){t.close()}}]};s.call(this,n)}function d(e){var t=this,n={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()}}]};s.call(this,n)}var l=e("jquery"),c=e("handlebars"),u={mask:!0,closeIcon:!0},h='<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>',p=c.compile(h);s.prototype.close=function(){this.$mask&&this.$mask.addClass("hide"),this.$el.remove()},s.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=s,r.prototype=new s({inherit:!0}),r.prototype.constructor=r,t.Alert=r,d.prototype=new s({inherit:!0}),d.prototype.constructor=d,t.Confirm=d}),define("js/common/share",["jquery"],function(e,t,n){function a(e){var t,n="",a={title:"",url:window.location.href,weixinUrl:"",image:"",desc:"",channel:""},i=["weibo","tweibo","qzone","renren","qq","douban","weixin"],s="<em><i></i></em>";if(a=o.extend(a,e),-1===o.inArray(a.channel,i))return alert("不存在的分享平台!"),!1;switch(a.channel){case"weibo":n="http://service.weibo.com/share/share.php?url="+a.url+"&title="+a.title+"&appkey=3739328910&searchPic=true&pic="+a.image;break;case"tweibo":n="http://share.v.t.qq.com/index.php?c=share&a=index&url="+a.url+"&title="+a.title+"&appkey=c0af9c29e0900813028c2ccb42021792&pic="+a.image;break;case"qzone":n="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a.url+"&title="+a.title+"&desc=&summary="+a.desc+"&site=YOHO!有货&pics="+a.image;break;case"renren":n="http://widget.renren.com/dialog/share?resourceUrl="+a.url+"&srcUrl="+a.url+"&desc="+a.desc+"&title="+a.title+"&description="+a.desc+"&pic="+a.image;break;case"qq":n="http://connect.qq.com/widget/shareqq/index.html?url="+a.url+"&desc="+a.desc+"&title="+a.title.replace("%","")+"&desc=&summary="+a.desc+"&site=YOHO!有货&pics="+a.image;break;case"weixin":n="http://s.jiathis.com/qrcode.php?url="+a.weixinUrl+"&desc="+a.desc+"&title="+a.title+"&description="+a.desc+"&pic="+a.image;break;case"douban":n="http://www.douban.com/share/service?href="+a.url+"&text="+a.desc+"&image="+a.image+"&title="+a.title+"&comment="}if("weixin"===a.channel){if(!a.self)return;t=a.self.closest(".share-to").find(".weixin-share-box"),t.length>0&&(s+='<div class="con"><h2>分享到微信朋友圈</h2><p class="pic"><img src="'+n+'" /></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(n))}function i(e,t){var n=document.title.replace(/(^\s*)|(\s*$)/g,""),i=o("#share-desc").val(),s=o("#share-img").val(),r=o("#weixin-url").val();a("weibo"===e||"tqq"===e?{channel:e,title:n,image:s}:{channel:e,title:n,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"),n=o(".weixin-share-box");"weixin"===t?i(t,e):(n.hide(),i(t))})}),define("js/index/index",["jquery","lazyload","handlebars","source-map"],function(e,t,n){var a=e("jquery"),i=e("lazyload"),o=a(".home-page").data("page"),s=a(".logo-brand").data("url");e("js/common/slider"),e("js/common/slider2"),e("js/common/logo-brand"),e("js/common/accordion"),a(document).on("mouseenter",".imgopacity a img",function(){a(this).css("opacity",.8)}),a(document).on("mouseout",".imgopacity a img",function(){a(this).css("opacity",1)}),a.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(a("img.lazy")),"boys"===o?a(".slide-container").slider({pagination:".thumb-pagination"}):(a(".center-col").slider(),a(".slide-container").slider()),"boys"===o?(a(".logo-brand").logoBrand({url:s}),a(".img-brand").slider2()):(a(".logo-brand").logoBrand({showNum:10,url:s}),a(".img-slider-wrapper").slider2())}),define("js/common/slider2",["jquery"],function(e,t,n){var a=e("jquery");!function(e){e.fn.slider2=function(t){function n(t,n,i){i===!0?(e(".next").trigger("click"),t===n-3?a(--t,n,!1):a(++t,n,!0)):(e(".prev").trigger("click"),0===t?a(++t,n,!0):a(--t,n,!1))}function a(t,a,i){window.setTimeout(n,e.fn.slider2.defaults.delaytime,t,a,i)}function i(t,n,a){var i=-(t*n);e(".img-list").animate({"margin-left":i+"px"},"slow",a)}return e.fn.slider2.defaults={index:0,shownum:3,autoplay:!1,delaytime:3e3},this.each(function(){var n=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 n=0,a=null;t.preventDefault(),i(3,d,function(){for(n=0;3>n;n++)a=r.shift(),e(".img-item").parent().append(a.outerHTML),r.push(a);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 n=0,a=null,o="";for(t.preventDefault(),n=0;3>n;n++)a=r.pop(),e(".img-item").parent().prepend(a.outerHTML),r.unshift(a);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)}),n.autoplay===!0&&a(n.index,l,!0)})}}(a)}),define("js/common/accordion",["jquery"],function(e,t,n){function a(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;a(0),i=new o({length:5,loop:!1,auto:!1,timeout:2,index:0}),i.on("change",function(e){a(e.to)}),d.mouseover(function(){i.go(s(this).index())}),i.init()}),define("js/common/yohoui/YH.slide",[],function(e,t,n){var a=e("js/common/yohoui/YH.base"),i=function(e){this.__lastTime=null,this.__isStop=!1,e=a.extend(this.defaults,e),i.superclass.constructor.call(this,e)};a.inherit(i,a.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 n,a,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,n=e===t?0:e>t?1:-1,a=u.loop,o=u.length-1,s=e,e=a?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:n};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,n=t.index,a=n+t.step;e.go(a,n)},i.prototype.prev=function(){var e=this,t=e.options,n=t.index,a=n-t.step;e.go(a,n)},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},n.exports=i}),define("js/common/yohoui/YH.base",[],function(e,t,n){var a,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 n=o.fn;n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,e.prototype.constructor===Object.prototype.constructor&&(e.prototype.constructor=t)},extend:function(e,t){var n;for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},copy:function(e,t,n){var a,i,s;if("object"!=typeof t)return t;if(a=t.valueOf(),t!==a)return new t.constructor(a);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(n)for(s in n)i.hasOwnProperty(s)&&(i[s]=n[s]);return i},clone:function(e){return o.__cloneFunc.prototype=e,new o.__cloneFunc},__cloneFunc:function(){},delegate:function(e,t){var n;return t=t||window,arguments.length>2?(n=Array.prototype.slice.call(arguments,2),function(){return e.apply(t,n)}):function(){return e.call(t)}},dom:function(e,t){var n,a,i=e,o={wrap:i},s=i[0].getElementsByTagName("*"),r=s.length;for(a=0;r>a;a++)n=s[a].className,n.indexOf(t)>-1&&(n=n.split(t)[1]),n&&(o[n]=i.find(s[a]));return o},template:function(){var e,t,n,a,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]&&(n=new RegExp("({"+t+"})","g"),e=e.replace(n,i[1][t]));else for(a=1;a<i.length;a++)void 0!==i[a]&&(n=new RegExp("({["+(a-1)+"]})","g"),e=e.replace(n,i[a]));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,n){var a,i;if(o.isArray(e))for(a=0,i=e.length;i>a&&t.call(e[a],a,e[a],n)!==!1;a++);else for(a in e)if(t.call(e[a],a,e[a],n)===!1)break;
},funManager:{__loadList:{},__loadFun:function(e,t,n){e.methord&&o.isFunction(e.methord())&&(n=n||window,e.methord()(e,function(){t()},n))},load:function(e,t,n,a){a=a||0,e[a]&&o.funManager.__loadFun(e[a],function(){o.funManager.load(e,t,n,a+1)},n),t(a,n)},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,n=t.detail?-1*t.detail:t.wheelDelta/40,a=0>n?-1:1;return{direction:a,unit:n}},__:function(e,t,n,a){var i;for(i in e)if(window[e[i].validator]){t[e[i].validator](e[i].prefix+n,a,!1);break}},add:function(e,t,n){var a=[{validator:"addEventListener",prefix:""},{validator:"attachEvent",prefix:"on"}];this.__(a,e,t,n)},remove:function(e,t,n){var a=[{validator:"removeEventListener",prefix:""},{validator:"detachEvent",prefix:"on"}];this.__(a,e,t,n)}},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"],n=document.createElement("div");for(e in t)if(void 0!==n.style[t[e]])return o.template("-{0}-",t[e].replace("Perspective","").toLowerCase())},parseURL:function(e){var t,n,a,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={},n=s.search.replace(/^\?/,"").split("&"),a=n.length,i=0,o;a>i;i++)n[i]&&(o=n[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 n;for(n=0;n<e.length;n++)if(this[n]===t)return n;return-1},remove:function(e,t){var n=this.indexOf(e,t);return n>-1&&e.splice(n,1),e}}};a=function(e){this.initialized=!1,this.registerEvent={before:[],change:[],after:[]},this.options=e,this.init(e)},a.output=function(){o.log(o.list)},a.prototype.oninit=o.fn,a.prototype.init=function(e){this.initialized=!0,this.__Uid=o.getUid("me"),this.oninit(e),o.list[this.__Uid]=this},a.prototype.destory=function(){this.initialized=!1,delete o.list[this.__Uid]},a.prototype.getUid=function(){return this.__Uid},a.prototype.getOptions=function(){return this.options},a.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]}},a.prototype.on=function(e,t){var n=this,a=n.registerEvent[e];return a&&a.push(t),a},a.prototype.off=function(e,t){var n=this,a=n.registerEvent[e],i=[];o.each(a,function(e,n){n===t&&i.push(e)}),o.each(i.reverse(),function(e,t){a.splice(t,1)})},o.assembly=a,n.exports=o}),define("js/common/new-arrivls",["jquery","lazyload","handlebars","source-map"],function(e,t,n){function a(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");a.prototype.on=function(e,t){var n=this,a=n.registerEvent[e];return a&&a.push(t),a},a.prototype.exect=function(e,t){var n,a=this;if(a.registerEvent[e]&&a.registerEvent[e].length>0)for(n in a.registerEvent[e])a.registerEvent[e].hasOwnProperty(n)&&a.registerEvent[e][n](t)},a.prototype.init=function(){function e(){n.isrun&&n.isload&&t.__directionCalculation()&&(n.isload=!1,n.index++,t.exect("after",n)),t.exect("change",n)}var t=this,n=this.options;t.exect("before",n),i(window).scroll(e)},a.prototype.emit=function(){var e=this.options;e.isload=!0},a.prototype.stop=function(){var e=this.options;e.isrun=!1,e.isload=!1},a.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},n.exports=function(e){var t,n=i("#newarrivals .goods-container"),r=i(".loading a"),d=new a({index:1,isload:!1,offset:{height:function(){return parseFloat(n.offset().top)+parseFloat(n.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,a){var l={type:"POST",url:e,success:function(e){var i,l,c,u=e.code;200===u?(l=e.goods.length%a,c=e.goods.length-l-1,e.goods.splice(c,l),i=s.compile(d.tpl),n.append(i(e.goods)),t.pageIndex=t.pageIndex+e.goods.length,o(n.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(n){e.pageCount=c*u[1],t(l,e)}),d.on("before",function(n){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,n){var a=e("jquery"),i=e("lazyload");e("js/common/slider"),e("js/brand/brands"),i(a("img.lazy")),a(".slide-container").slider({orient:!0})}),define("js/brand/brands",["jquery","handlebars","source-map","dot"],function(e,t,n){function a(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?window.unescape(n[2]):null}function i(e,t,n){var a,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(),a=c.compile(n),s.append(a(t)),u(s.find(".right")),o.right-350<0&&s.find(".brands-layer").addClass("brands-layer-right").css("left",-330-o.width)}function o(){v.unbind("mouseenter").unbind("mouseleave").hover(function(){var e=l(this),t=e.attr("data-key"),n={url:"/brands/brandinfo",type:"get",data:{brandId:t},success:function(t){200===t.code&&t.brand&&(j.hasOwnProperty(t.brand.key)||(j[t.brand.key]=t.brand),i(e,j[t.brand.key],S))}};clearTimeout(r),r=setTimeout(function(){j.hasOwnProperty(t)?i(e,j[t],S):l.ajax(n)},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"),g=p.find("dl.clearfix"),v=p.find("li>a"),y=f.find("a"),b=h.find("li>a"),w=h.find(".hoverarr"),C=y.height(),_=y.offset()?y.offset().top:0,x=m.height(),k=m.offset()?m.offset().top:0,j={},S='<div class="brands-dialog">';S+='    <div class="brands-layer">',S+='        <div class="layer-content">',S+='            <div class="title">{{title}}</div>',S+='            <div class="clearfix desc">',S+='                <img src="{{icon}}">',S+='                <p class="right">{{content}}</p>',S+="            </div> ",S+='            <div class="featured">',S+="                <p>{{subtitle}}</p> ",S+='                <div class="clearfix"> ',S+="                    {{#each imgs}}",S+='                    <img src="{{src}}">',S+="                    {{/each}}",S+="                </div>",S+="            </div>",S+="        </div>",S+="    </div>",S+="</div>",u(l(".brand-desc")),l.easing.easeOutQuint=function(e,t,n,a,i){return a*((t=t/i-1)*t*t*t*t+1)+n},m.length&&m.find("li").each(function(){var e=l(this),t=e.offset().top-k+e.height();t>x&&e.hide()}),b.eq(0).parent("li").find(".brands-content").css("z-index","1"),d=a("id")?a("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()>=_?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}),g.length<26&&l.ajax({url:"/brands/brandList",type:"POST",data:{start:g.length?g.length+1:1},success:function(e){e&&(p.append(e),v=p.find("li>a"),o())}}),o()}),define("js/passport/entry",["jquery","jquery.placeholder"],function(e,t,n){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,n){function a(){var e=new Date,t=m(".captcha-img"),n=t.attr("src").split("?")[0];t.attr("src",n+"?t="+e.getTime())}function i(e,t){var n,i;"reg"===e?(n="/passport/register/checkmobile",i={mobile:E.val(),area:L.text().split("+")[1]}):"third"===e&&(n="/passport/autouserinfo/bindCheck",i={mobile:E.val(),area:L.text().split("+")[1],openId:m("#open-id").val(),sourceType:m("#source-type").val()}),q[0].message="err",q[0].status=!1,m.ajax({url:n,type:"POST",data:i}).then(function(e){if(e){switch(e.code){case 200:E.val()!==B&&""!==B&&(a(),S.addClass("disable").attr("disabled","disabled"),q[1].message="图形验证码错误",q[1].status=!1),B=E.val(),q[0].message="",q[0].status=!0;break;case 400:a(),q[0].message=e.message,q[0].status=!1}t()}})}function o(e,t){var n;"reg"===e?n="/passport/register/piccaptcha":"third"===e&&(n="/passport/autouserinfo/checkPicCode"),m.ajax({type:"POST",url:n,data:{verifyCode:U.val()}}).then(function(e){if(e){switch(e.code){case 200:q[1].message="",q[1].status=!0;break;case 400:a(),q[1].message="图形验证码错误",q[1].status=!1}t()}})}function s(e,t){var n;"reg"===e?n="/passport/register/msgcaptcha":"third"===e&&(n="/passport/autouserinfo/checkBindMsg"),m.ajax({type:"POST",url:n,data:{code:I.val(),mobile:E.val(),area:L.text().split("+")[1]}}).then(function(e){if(e){switch(e.code){case 200:q[2].message="",q[2].status=!0;break;case 400:q[2].message="短信验证码错误",q[2].status=!1}t()}})}function r(e,t,n){var a,r=m.trim(t.val());t.hasClass("phone-num")?(a=L.text(),""===r?(q[0].message="请输入手机号码",q[0].status=!1,n()):g.phoneRegx[a].test(r)?i(e,n):(q[0].message="手机号码格式不正确,请重新输入",q[0].status=!1,n())):t.hasClass("captcha")?""===r?(q[1].message="请输入图形验证码",q[1].status=!1,n()):r.length<=3?(q[1].message="图形验证码为4位",q[1].status=!1,n()):q[0].status?o(e,n):(q[1].message="图形验证码错误",q[1].status=!1,n()):t.hasClass("msg-captcha")?""===r?(q[2].message="请输入短信验证码",q[2].status=!1,n()):r.length<=3?(q[2].message="短信验证码错误",q[2].status=!1,n()):q[1].status?s(e,n):(q[2].message="短信验证码错误",q[2].status=!1,n()):t.hasClass("pwd")?(""===r?(q[3].message="请输入密码",q[3].status=!1):r.length<6||r.length>20?(q[3].message="密码只支持6-20位字符",q[3].status=!1):z.test(t.val())?(q[3].message="",q[3].status=!0):(q[3].message="密码须字母和数字组合",q[3].status=!1),n()):t.hasClass("repwd")&&(""===r?(q[4].message="请输入密码确认",q[4].status=!1):A.val()!==r?(q[4].message="与密码不一致,请重新输入",q[4].status=!1):(q[4].message="",q[4].status=!0),n())}function d(){var e=f.offset();return C.css({top:e.top-40,left:e.left})}function l(){var e,t=!1,n=q.length;for(e=0;n>e;e++)t||(q[e].message&&"err"!==q[e].message?(C.find("span").text(q[e].message),f=m("#"+q[e].id),d().removeClass("hide"),t=!0):C.addClass("hide"))}function c(){var e,t,n=q.length;for(t=0;n>t;t++)q[t].message?(e=m("#"+q[t].id),e.addClass("error")):(e=m("#"+q[t].id),e.removeClass("error"))}function u(e){var t=e.val(),n=v(t),a=0;switch(a=0===n?0:10>=n?1:20>=n?2:3){case 0:O.removeClass("red yellow green"),P.removeClass("color");break;case 1:O.addClass("red").removeClass("yellow green"),P.filter(".low").addClass("color"),P.filter(".mid,.high").removeClass("color");break;case 2:O.addClass("yellow").removeClass("red green"),P.filter(".low,.mid").addClass("color"),P.filter(".high").removeClass("color");break;case 3:O.addClass("green").removeClass("yellow red"),P.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"),g=e("js/passport/mail-phone-regx"),v=e("js/passport/pwd-strength"),y=m(".register-page"),b=m("#pwd-tips"),w=b.find("#pwd-tip1"),C=m("#err-tip"),_=m("#register-btn"),x=m("#count-down"),k=m(".success-btn"),j=5,S=m("#send-captcha"),T=4,q=[],E=m("#phone-num"),I=m("#msg-captcha"),A=m("#pwd"),F=m("#repwd"),U=m("#captcha"),D=0,P=m(".pwd-intensity"),O=P.closest(".pwd-intensity-container"),L=m("#country-code"),N=m("#region"),$=!1,z=g.pwdValidateRegx,B="";e("jquery.placeholder"),setTimeout(function(){E.val(""),I.val(""),A.val(""),F.val(""),U.val("")},0),U.attr("maxlength",T),A.focus(function(e){b.removeClass("hide"),$=!0,p=m(this).val()}).blur(function(){b.addClass("hide"),$=!1}),m("[placeholder]").placeholder(),q=[{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),n=0;if(t.attr("notchecked")){for(t.removeAttr("notchecked"),e=0;e<q.length;e++)q[e].status&&n++;4===n&&_.removeClass("disable").removeAttr("disabled")}else _.addClass("disable").attr("disabled","disabled"),t.attr("notchecked","notchecked")}),y.on("keydown",function(e){var t=e.which;13===t&&_.click()}),y.find(".va").keyup(function(){var t,n=0,a=q.length,i=m(this);r(e,m(this),function(){for(l(),c(),t=0;a>t;t++)q[t].status&&n++;4!==n||m("#agree-terms").attr("notchecked")?_.addClass("disable").attr("disabled","disabled"):_.removeClass("disable").removeAttr("disabled"),q[1].status&&0>=D?S.removeClass("disable").removeAttr("disabled"):S.addClass("disable").attr("disabled","disabled")}),i.hasClass("pwd")&&u(i)}).blur(function(){}),N.change(function(){L.text(m("#region").val()),r(e,E,l)}),S.click(function(){var t,n;m(this).hasClass("disable")||(D=60,m("#msg-tip").removeClass("hide"),S.addClass("disable").attr("disabled","disabled"),S.val("60秒可重新发送"),t=setInterval(function(){return 0>=D?(S.removeClass("disable").removeAttr("disabled").val("获取短信验证码"),void clearInterval(t)):void S.val(D--+"秒可重新发送")},1e3),"reg"===e?n="/passport/register/sendBindMsg":"third"===e&&(n="/passport/autouserinfo/sendBindMsg"),m.ajax({type:"POST",url:n,data:{area:L.text().split("+")[1],mobile:E.val(),verifyCode:U.val()}}))}),m(".success-box").length<=0&&(A[0].onpaste=function(){return!1}),_.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:L.text().split("+")[1],mobile:E.val(),verifyCode:U.val(),code:I.val(),password:A.val()}}).then(function(e){var t,n,a=0;200===e.code?(n=e.data.href,t=setTimeout(function(){a++},1e3),m.ajax({type:"GET",url:e.data.session}).then(function(e){200===e.code&&3>t&&(clearInterval(t),location.href=n)}),t>=3&&(clearInterval(t),location.href=n)):console.log("网络超时~")})}),m(".change-captcha").click(function(){a()}),m(".success-box").length>0&&(h=setInterval(function(){0===j&&(window.location.href=k.attr("data-url"),clearInterval(h)),x.text(j--)},1e3))}}),define("js/passport/mail-phone-regx",[],function(e,t,n){var a={"+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=a,t.emailRegx=i,t.pwdValidateRegx=o}),define("js/passport/pwd-strength",[],function(e,t,n){function a(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,n){var a=e.charCodeAt(0),i=t.charCodeAt(0);return a-i===0?!0:4===n||a-i!==1&&a-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,n,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),n=a(e,c),l===n&&i(t,d,n)||(s+=n+o(n,l)),d=t,l=n;return s}n.exports=s}),define("js/passport/back",["jquery","jquery.placeholder"],function(e,t,n){function a(){var e=new Date,t=d("#captcha-img"),n=t.attr("src").split("?")[0];d("#captcha-img").attr("src",n+"?t="+e.getTime())}function i(){_&&x?y.removeClass("disable").prop("disabled",!1):y.addClass("disable").prop("disabled",!0)}function o(){return _&&x?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?x=!0:402===e.code?(_=!1,x=!0,b.removeClass("hide").find("em").text("该账号不存在"),f.addClass("error")):400===e.code&&(x=!1,a()),i()}):void i()}function s(e){var t=!0,n="";return e=d.trim(e),""!==e?/^[0-9]+$/.test(e)?u[p.val()].test(e)?t=!0:(n="手机号码格式不正确, 请重新输入",t=!1):c.test(e)?t=!0:(n="邮箱格式不正确, 请重新输入",t=!1):(n="账户名不能为空",t=!1),_=t,o(),{pass:t,errTxt:n}}function r(){var e=d.trim(m.val());return""===e||e.length<C?(x=!1,void i()):(x=!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"),g=d("#country-code-list"),v=d("#country-code"),y=d("#find-btn"),b=d("#account-err"),w=d("#captcha-err"),C=4,_=!1,x=!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(){a()}),v.on("click",function(e){e.stopPropagation(),"block"===g.css("style")?g.slideUp("fast"):g.slideDown("fast")}),g.delegate("li","click",function(e){var t,n=d(this),a=n.data("cc");e.stopPropagation(),p.val(a),v.find("em").html(n.text()),""!==d.trim(f.val())&&(t=s(f.val()),i(),_?(b.addClass("hide"),f.removeClass("error")):(b.removeClass("hide").text(t.errTxt),f.addClass("error"))),g.slideUp("fast")}),d(document).click(function(){"block"===g.css("display")&&g.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())?"验证码不能为空":"验证码不正确";x?(w.addClass("hide"),m.removeClass("error")):(w.removeClass("hide").find("em").text(e),m.addClass("error"),m.val()<C&&a())}).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:x&&_?void 0:(e.preventDefault(),!0)})}),define("js/passport/ac-email",["jquery"],function(e,t,n){var a,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"]};n.exports=function(e,t){var n,s='<ul id="email-autocomplete" class="email-autocomplete hide"></ul>';e.parent().append(s),n=i("#email-autocomplete"),e.on("keyup",function(){var e,t,a,s,r=i.trim(i(this).val()),d="";if(r.indexOf("@")>0){for(e=r.match(/^[0-9]+@(.*)/),e?(a=o.num,t=e[1]):(a=o.other,t=r.match(/@(.*)/)[1]),s=0;s<a.length;s++)a[s].indexOf(t)>-1&&(d+="<li>"+r.slice(0,r.indexOf("@"))+"@"+a[s]+"</li>");""!==d&&/.com$/.test(r)===!1?n.html(d).removeClass("hide"):n.html("").addClass("hide")}}).on("blur",function(){a=setTimeout(function(){n.addClass("hide"),t&&t()},200)}),n.on("click","li",function(){clearTimeout(a),e.val(i(this).text()).focus(),n.addClass("hide"),t&&t()})}}),define("js/passport/login",["jquery","jquery.placeholder"],function(e,t,n){function a(){var e,t=!1,n=c.trim(u.val());return""!==n?/^[0-9]+$/.test(n)?_.phoneRegx[y.val()].test(n)?t=!0:(t=!1,e="手机号码不正确,请重新输入"):_.emailRegx.test(n)?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,n=c.trim(h.val());return""!==n?n.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,n=c.trim(p.val());return S.is(":hidden")?!0:(""!==n?4!==n.length?e="请输入长度为4字符的验证码":t=!0:e="请输入验证码",t?(g.addClass("hide"),p.removeClass("error")):(g.removeClass("hide").children("em").text(e),p.addClass("error")),t)}function s(){var e=!0,t=c.trim(u.val()),n=c.trim(h.val());return""!==t?e=a()&&i()&&o():(e=!1,u.addClass("error"),""===n?(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",j+c.now()),p.val(""),S.removeClass("hide")}function d(){var e=s();e&&E===!1&&(E=!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:k.hasClass("checked")?!0:!1},success:function(e){200===e.code?e.data&&(location.href=e.data.session):("captcha"===e.data.errorType?(g.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(){E=!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"),g=p.siblings(".err-tip"),v=c("#caps-lock"),y=c("#country-code-hide"),b=c("#country-code > em"),w=c("#country-list"),C=c("#email-autocomplete"),_=e("js/passport/mail-phone-regx"),x=e("js/passport/ac-email"),k=c(".remember-me"),j="/passport/images?t=",S=c(".captcha-wrap"),p=S.find("#captcha"),T=S.find("#captcha-img"),g=S.find(".err-tip"),q={checked:"&#xe612;",unchecked:"&#xe613;"},E=!1;e("jquery.placeholder"),x(u,function(){a()&&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(),v.hasClass("hide")||v.addClass("hide")}).on("keypress",function(e){var t=e.which;return t>=65&&90>=t?void v.removeClass("hide"):void v.addClass("hide")}),p.on("blur",function(){o()}),C.on("click","li",function(){clearTimeout(l),u.val(c(this).text()).focus(),C.addClass("hide")}),k.on("click",function(){var e=c(this);e.toggleClass("checked"),e.hasClass("checked")?e.children("i").html(q.checked):e.children("i").html(q.unchecked)}),c(".va").on("focus",function(){var e=c(this);e.removeClass("error"),e.siblings(".err-tip").addClass("hide")}),S.on("click",".change-captcha, .captcha-img",function(){T.attr("src",j+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,n){function a(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,n){var a=e.charCodeAt(0),i=t.charCodeAt(0);return a-i===0?!0:4===n||a-i!==1&&a-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,n,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),n=a(e,c),l===n&&i(t,d,n)||(s+=n+o(n,l)),d=t,l=n;return s}function r(){var e=l.val(),t=s(e),n=0;switch(n=0===t?0:10>=t?1:20>=t?2:3){case 0:v.removeClass("red yellow green"),g.removeClass("color");break;case 1:v.addClass("red").removeClass("yellow green"),g.filter(".low").addClass("color"),g.filter(".mid,.high").removeClass("color");break;case 2:v.addClass("yellow").removeClass("red green"),g.filter(".low,.mid").addClass("color"),g.filter(".high").removeClass("color");break;case 3:v.addClass("green").removeClass("yellow red"),g.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,g=d(".pwd-intensity"),v=g.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,n){var a,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;a=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(a--+"秒后可重新操作"),i=setInterval(function(){0===a?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(a--+"秒后可重新操作")},1e3)}else o(this).addClass("error"),d.removeClass("hide").text("发送失败")})}),a=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(a--+"秒后可重新操作"),i=setInterval(function(){0===a?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(a--+"秒后可重新操作")},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,n){function a(){b(".choosetag").on("change",function(){var e="#f02200";"checked"===b(this).attr("checked")?b(".choosewrapper").css({"background-image":'url("'+S+'")'}):(b(".choosewrapper").css({"background-image":"none"}),e="#CCCCCC"),E.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&&(k||(k=!0,b.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:b("#mobile").val(),area:b("#areacode").val()}}).then(function(e){k=!1,200===e.code?j=!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"),n=e.text();b("#areaname").text(n),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 x-=1,0>x?(x=60,void b(".validatewrapper").html(_)):(b(".second").text(x),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 g(){b(document).on("click","#gotobindphone",function(){j===!0?(b("#inarea").val(b("#areacode").val()),b("#inmobile").val(b("#mobile").val()),m()):alert("请输入正确验证码")})}function v(){var e="",t="",n="",a="",o="",s="";b("#bindfirststep").on("click",function(r){var d;if(r.preventDefault(),n=b(".phonenum").val(),a=b("#areanum").text(),d=w["+"+a],i()){if(""===n||!d||!d.test(n))return q.find("em").text("手机格式错误"),void q.removeClass("hide");e=b("#openId").val()||"29803EC6D4AAC3AAB8ABDB6AE829D579",t=b("#sourceType").val()||"qq",b.ajax({type:"post",url:"/passport/autouserinfo/bindCheck",data:{mobile:n,area:a,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(n),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()):205===e.code?(o=e.data.user.username,s=e.data.user.headImg,b("#registphonetwo").text(n),b("#username1").text(o),""===s?b("#userphoto1").attr("src","http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100"):b("#userphoto1").attr("src",s),b("#logindirectly").attr("href",e.data.user.bindLogin),b(".backdrop").show(),b("#bindconfirm .mask").css({"padding-top":t>440?t/2:217}),b("#bindconfirm").show()):402===e.code?(q.find("em").text("手机格式错误"),q.removeClass("hide")):e&&e.message&&alert(e.message)}})}})}function y(){l(),f(),a(),r(),o(),d(),v(),c(),u(),g(),s()}var b=e("jquery"),w=e("js/passport/mail-phone-regx").phoneRegx,C=b("#nopermissionmessage").html(),_=b(".validatewrapper").html(),x=+b(".second").text(),k=!1,j=!1,S="http://cdn.yoho.cn/yohobuy/assets/img/passport/choosed.png",T=b(".bindwrapper"),q=T.find(".phone-err-tip"),E=T.find(".yohobindbtn");T.on("keydown",".phonenum",function(e){return 13===e.keyCode?(E.trigger("click"),!1):void 0}),y()}),define("js/passport/third-pwd",["jquery"],function(e,t,n){function a(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,n){var a=e.charCodeAt(0),i=t.charCodeAt(0);return a-i===0?!0:4===n||a-i!==1&&a-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,n=e.length,s="",r=0,d=0,l="",c="";for(d;n>d;d++)l=e.charAt(d),c=a(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 j-=1,0>j?(j=60,void C(".validatewrapper").html(T)):(C(".second").text(j),void window.setTimeout(d,1e3))}function l(){C(".validatewrapper").html(S),window.setTimeout(d,1e3)}function c(){C(document).on("click","#sendmessage",function(){l(),C.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:P,area:O}}).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&&(_||(_=!0,C.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:P,area:O}}).then(function(e){_=!1,200!==e.code?C("#err-info").show():x=!0})))})}function h(){var e=v.val(),t=s(e),n=0;switch(n=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?(k=!1,b.removeClass("red yes no").addClass("default")):(e.length<6||e.length>20?(k=!1,b.removeClass("default yes").addClass("no red")):(k=!0,b.removeClass("default no red").addClass("yes")),/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/.test(e)?F.removeClass("default no red").addClass("yes"):F.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="";q||(q=!0,setTimeout(function(){q=!1},5e4),e=C("#pwd").val(),t=C("#validatenum").val(),C.ajax({type:"POST",url:"/passport/autouserinfo/bindMobile",data:{area:O,openId:C("#openId").val(),sourceType:C("#sourceType").val(),mobile:P,password:e,code:t}}).then(function(e){q=!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 n=!0;e=C("#validatenum").val(),t=C("#pwd").val(),""===e?(r(I,"短信验证码不能为空"),n=!1):x===!1&&(r(I,"请输入正确的验证码"),n=!1),""===t?(r(A,"密码不能为空"),n=!1):t.length<6||t.length>20?(r(A,"密码只支持6-20位字符"),n=!1):D.test(t)?k===!1&&(r(A,"请输入符合强度的密码"),n=!1):(r(A,"密码须由字母和数字组合"),n=!1),n&&f()})}function g(){v=C("#pwd"),y=C(".safelevel"),w=C(".pwd-intensity"),b=C("#pwd-tip1"),c(),u(),p(),m(),P&&O&&U.click()}var v,y,b,w,C=e("jquery"),_=!1,x=!1,k=!1,j="",S="",T="",q=!1,E=C(".bindwrapper"),I=E.find(".code-err-tip"),A=E.find(".pwd-err-tip"),F=C("#pwd-tip2"),U=C("#sendmessage"),D=e("js/passport/mail-phone-regx").pwdValidateRegx,P=C("#mobile").val(),O=C("#area").val();S=C("#nopermissionmessage").html(),T=C(".validatewrapper").html(),j=+C(".second").text(),g()}),define("js/passport/relate",["jquery"],function(e,t,n){function a(){f.init(),o.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:p.mobile,area:p.area}}).then(function(e){e&&200!==e.code&&(f.clearTime(),alert(e.message))})}function i(){var e=l.val();e&&o.ajax({type:"POST",url:"/passport/autouserinfo/relateMobile",data:{mobile:p.mobile,area:p.area,openId:p.openid,sourceType:p.source,code:e}}).then(function(e){200===e.code?window.location.href=e.data.refer:402===e.code?u.removeClass("hide"):(u.addClass("hide"),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=r.find(".code-error"),h=o("#hide-info"),p={},f={};p=h.data(),h.remove(),f={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(){a(),s.addClass("hide"),u.addClass("hide"),r.removeClass("hide")}),r.on("keydown",".msg-code",function(e){return 13===e.keyCode?(i(),!1):void 0}),r.on("click",".get-code",function(){a()}),r.on("click",".perv-step",function(){f.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,n){function a(e){z.ajax({type:"POST",dataType:"json",url:"/cart/index/select",data:e,beforeSend:function(){z(".loading").css({top:z(document).scrollTop()+200}),z(".loading").show()}}).then(function(e){200===e.code&&window.history.go(0)})}function i(e,t){te=[],k={},w=e.attr("checked")?"Y":"N",z("."+t).each(function(){oe=z(this).data("promotionid")?!0:!1,z(this).data("id")&&te.push({product_sku:z(this).data("id"),selected:w,buy_number:z(this).data("productnum"),goods_type:z(this).data("goodstype"),promotion_id:z(this).data("promotionid")?z(this).data("promotionid"):0})}),k={skuList:JSON.stringify(te),hasPromotion:oe},a(k)}function o(e,t,n){z.ajax({type:"GET",dataType:"json",url:t,data:n}).then(function(t){200===t.code&&t.data.item&&t.data.item.length>0&&(e.html(" "),m=f(t.data),e.append(z(m)),z("#orderProduct li:last").addClass("end"),z(".gift").removeClass("none"))})}function s(e){z.ajax({type:"GET",dataType:"html",url:"/cart/index/getProductInfo",data:e}).then(function(e){K=0,Q.html(" "),Q.append(e),Q.show(),z(".detail-bigpic:not(.none) .con li:first").addClass("active"),z(".showSizeBox:not(.none) span").length<2&&z(".showSizeBox:not(.none) span:first").addClass("atcive"),1!==Number(z("#addToCart").val())&&z(".showSizeBox span").data("num",0),z.each(z(".showSizeBox span"),function(){z(this).data("num")<=0&&(z(this).addClass("null-atcivec"),console.log(z(".showSizeBox:not(.none) span:first")),z(".showSizeBox:not(.none) span:first").removeClass("atcive"))}),"undefined"!=typeof q&&(N=z(".detail-info .oldprice del").html()?z(".detail-info .oldprice del").html():$,O='<span class="oldprice">现价:<del>'+N+'</del></span><span class="newprice">活动价:<b class="promotion-price">'+q+"</b></span>",z(".detail-info .price").html(O)),z(".detail-bigpic:not(.none) .bigpic:gt(0)").hide(),z(".showSizeBox:not(.none)").find("span").each(function(){return z(this).hasClass("null-atcivec")?(z(".addcart").addClass("none"),void z(".btn_sellout").removeClass("none")):(z(".addcart").removeClass("none"),z(".btn_sellout").addClass("none"),!1)})})}function r(){Q.html(" "),Q.css({top:z(document).scrollTop()+30,left:z(document).width()/2-Q.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,n){z.ajax({type:"POST",dataType:"json",url:t,data:k,beforeSend:function(){z(".loading").css({top:z(document).scrollTop()+200}),z(".loading").show()}}).then(function(e){200===e.code?(n&&window.setCookie("cart-del-list",JSON.stringify(n),{domain:".yohobuy.com",path:"/"}),window.history.go(0)):300===e.code?(z(".loading").hide(),new M(e.message).show()):403===e.code&&e.data.url&&(window.location=e.data.url)})}function c(e){se=!0,z.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){z.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 M(e.message).show()})}function h(){z(".gift-wrapper .fold").show(),z(".pre-sell-box input:checked").length===z('.pre-sell-box input[type="checkbox"]').length&&z('.per-list input[type="checkbox"]').attr("checked",!0),z(".common-sell-box input:checked").length===z('.common-sell-box input[type="checkbox"]').length&&z('.common-list input[type="checkbox"]').attr("checked",!0),z('.common-list input[type="checkbox"]').attr("checked")&&(ie=!0),z('.per-list input[type="checkbox"]').attr("checked")&&(ae=!0),0!==z(".per-list").length&&0!==z(".common-list").length?ie&&ae&&z('.batch_div input[type="checkbox"]').attr("checked",!0):(ie||ae)&&z('.batch_div input[type="checkbox"]').attr("checked",!0),z(".cart-page").each(function(){1===z(this).data("pageall")?(z(".cart-btn-pre",this).hide(),z(".cart-btn-next",this).hide()):z(".cart-btn-pre",this).hide()}),z(".pre-sell-box input:checked").length>0&&z(".common-sell-box input:checked").length>0?(z(".go_cash_tips").show(),z(".btn_account_disabled").show(),z(".btn_account").hide()):(z(".go_cash_tips").hide(),z(".btn_account").show(),z(".btn_account_disabled").hide()),z(".pay-wapper tr").each(function(){z(this).data("pid")&&te.push(z(this).data("pid")+"")}),z.ajax({type:"POST",url:"/cart/index/checkFav",data:{pidList:JSON.stringify(te)}}).then(function(e){E='<span class="cart-yetremove-btn">已收藏</span>',I='<a href="javascript:void(0);" class="cart-remove-btn"><span>移入收藏</span></a>',z.each(e.data,function(e,t,n){z(".pay-wapper tr").each(function(){Number(z(this).data("pid"))===Number(e)&&(t?z(this).find(".cart-operation").append(E):z(this).find(".cart-operation").append(I))})})})}var p,f,m,g,v,y,b,w,C,_,x,k,j,S,T,q,E,I,A,F,U,D,P,O,L,N,$,z=e("jquery"),B=e("handlebars"),R=e("js/common/dialog"),W=R.Confirm,M=R.Alert,H=z(".cartnew-sum"),G=z(".cartnew-tips"),Y=z(".pay-wapper"),Q=z(".goods-detail"),X=z(".histroy"),V=z(".together"),Z=z(".shop-cart"),J=1,K=0,ee=1,te=[],ne=[],ae=!1,ie=!1,oe=!1,se=!1;G.find(".btn_close").click(function(){G.fadeOut()}),Y.one("click",'.common-sell-box input[type="checkbox"], .pre-sell-box input[type="checkbox"]',function(){w=z(this).attr("checked")?"Y":"N",te=[],te.push({product_sku:z(this).parents("tr").data("id"),selected:w,buy_number:z(this).parents("tr").data("productnum"),goods_type:z(this).parents("tr").data("goodstype"),promotion_id:z(this).parents("tr").data("promotionid")?z(this).parents("tr").data("promotionid"):0}),oe=z(this).parents("tr").promotion_id?!0:!1,k={skuList:JSON.stringify(te),hasPromotion:oe},a(k)}),H.one("click",'input[type="checkbox"]',function(){te=[],L={},k={},w=z(this).attr("checked")?"Y":"N",z(".pay-wapper:first tr").each(function(){z(this).data("promotionid")&&(oe=!0),z(this).data("id")&&te.push({product_sku:z(this).data("id"),selected:w,buy_number:z(this).data("productnum"),goods_type:z(this).data("goodstype"),promotion_id:z(this).data("promotionid")?z(this).data("promotionid"):0})}),k={skuList:JSON.stringify(te),hasPromotion:oe},a(k)}),z(".per-list").on("click",'input[type="checkbox"]',function(){i(z(this),"pre-sell-box")}),z(".common-list").on("click",'input[type="checkbox"]',function(){i(z(this),"common-sell-box")}),p=z("#togetherProduct").html(),f=B.compile(p),o(X,"/cart/index/getHistroyProduct"),o(V,"/cart/index/getTogetherProduct"),V.on("click",".pagenext, .pageprev",function(){o(V,"/cart/index/getTogetherProduct",{page:Math.ceil(100*Math.random())+1})}),Z.on("click",".icon-minus, .icon-add",function(){z(this).hasClass("icon-minus")?(z(this).parents(".title").next(".main").hide(),z(this).parents("h2").next(".right").hide()):(z(this).parents(".title").next(".main").show(),z(this).parents("h2").next(".right").show()),z(this).siblings("i").toggleClass("none"),z(this).toggleClass("none")}),X.on("click",".pagenext, .pageprev",function(){z(this).hasClass("pagenext")?J++:--J>0||(J=1),o(X,"/cart/index/getHistroyProduct",{page:J})}),Y.on("click",".cart-add-btn",function(){F=z(this).data("id"),T=z(this).parents("table").data("promotion"),q=z(this).parents("table").find(".subjoin-price").html(),$=z(this).parents("table").find(".wapper-price").html(),r(),s({productId:F})}),z(".clearfix").on("click",".btn_view_s",function(){F=z(this).data("id"),T=z(this).parents("table").data("promotion"),q=z(this).parents("table").find(".subjoin-price").html(),r(),s({productId:F})}),Q.on("click",".colse",function(){Q.hide(),Q.html(" "),ee=1}),Y.on("click",".icon-minusCart, .icon-addCart",function(){d(z(this))}),Y.on("click",".unfold-color",function(){d(z(this)),z(this).siblings(".icon-minusCart").removeClass("none"),z(this).siblings(".icon-addCart").addClass("none")}),Y.on("click",".cart-btn-next",function(){g=z(this).siblings("p").find(".f-red"),y=Number(z(this).siblings("p").find(".subjoinPageNum").html()),v=Number(g.html()),g.html(v+1),v>=y-1?z(this).hide():z(this).siblings("i").show(),b=z(this).parents(".cart-product-num").siblings("div").find("table"),b.addClass("none").eq(v).removeClass("none")}),Y.on("click",".cart-btn-pre",function(){g=z(this).siblings("p").find(".f-red"),y=Number(z(this).siblings("p").find(".subjoinPageNum").html()),v=Number(g.html()),g.html(v-1),2>=v?z(this).hide():z(this).siblings("i").show(),b=z(this).parents(".cart-product-num").siblings("div").find("table"),b.addClass("none").eq(v-2).removeClass("none")}),Q.on("click",".fav_count",function(){z.ajax({type:"POST",dataType:"json",url:"/product/item/togglecollect",data:{productId:F,type:"add"}}).then(function(e){200===e.code?new M(e.message).show():403===e.code?e.data.url&&(window.location=e.data.url):new M(e.message).show()})}),Y.on("click",".cart-del-btn",function(){k={},te=[],T=z(this).parents("tr").data("promotionid")?z(this).parents("tr").data("promotionid"):0,te.push({product_sku:z(this).parents("tr").data("id"),buy_number:z(this).parents("tr").data("productnum"),promotion_id:T}),oe=T?!0:!1,k={skuList:JSON.stringify(te),hasPromotion:oe},A="<div><span></span>删除商品</div><p>确定从购物车中删除此商品?</p>",z(this).data("gift")||(x={productPrice:z(this).parents("tr").find(".productPrice").text(),productTitle:z(this).parents("tr").find(".pay-pro-info a").text(),link:z(this).parents("tr").find(".pay-pro-info a").attr("href"),productNum:z(this).parents("tr").data("productnum"),productSku:z(this).parents("tr").data("id"),promotionId:z(this).parents("tr").data("promotionid")}),C="/cart/index/remove",new W({content:A,cb:function(){l(k,C,x)}}).show()}),Y.on("click",".cart-remove-btn",function(){k={},te=[],T=z(this).parents("tr").data("promotionid")?z(this).parents("tr").data("promotionid"):0,te.push({product_sku:z(this).parents("tr").data("id"),buy_number:z(this).parents("tr").data("productnum"),promotion_id:T}),oe=T?!0:!1,k={skuList:JSON.stringify(te),hasPromotion:oe},l(k,"/cart/index/fav")}),H.on("click",".delAll",function(){k={},x={},te=[],ne=[],z(".pay-wapper:first tr").each(function(){z(this).find('input[type="checkbox"]').attr("checked")&&(T=z(this).data("promotionid")?z(this).data("promotionid"):0,T&&(oe=!0),z(this).data("id")&&(z(this).find('input[type="checkbox"]').attr("checked")&&te.push({product_sku:z(this).data("id"),buy_number:z(this).data("productnum"),promotion_id:T}),x={productPrice:z(this).find(".productPrice").text(),productTitle:z(this).find(".pay-pro-info a").text(),link:z(this).find(".pay-pro-info a").attr("href"),productNum:z(this).data("productnum"),productSku:z(this).data("id"),promotionId:z(this).data("promotionid")},ne.push(x)))}),C="/cart/index/remove",A="<div><span></span>删除商品</div><p>确定从购物车中删除所有选中商品?</p>",k={skuList:JSON.stringify(te),hasPromotion:oe},z.isEmptyObject(te)?new M("请至少选择一件商品").show():new W({content:A,cb:function(){l(k,C,ne)}}).show()}),H.on("click",".removeAll",function(){k={},x={},te=[],z(".pay-wapper:first tr").each(function(){z(this).find('input[type="checkbox"]').attr("checked")&&(T=z(this).data("promotionid")?z(this).data("promotionid"):0,T&&(oe=!0),z(this).data("id")&&z(this).find('input[type="checkbox"]').attr("checked")&&te.push({product_sku:z(this).data("id"),buy_number:z(this).data("productnum"),promotion_id:T}))}),k={skuList:JSON.stringify(te),hasPromotion:oe},z.isEmptyObject(te)?new M("请至少选择一件商品").show():l(k,"/cart/index/fav")}),Y.on("click",".minus, .plus",function(){return x={},_=z(this).hasClass("minus")?"decreaseNum":"increaseNum",x[""+_]=1,se||"1"===z(this).siblings("input").val()&&z(this).hasClass("minus")?!1:void c(z.extend(x,{sku:z(this).parents("tr").data("id")}))}),z(".gift").on("click",".up, .down",function(){z(this).siblings("i").toggleClass("none"),z(this).toggleClass("none")}),Q.on("click",".addcart",function(){return 0===z(".showSizeBox:not(.none) .atcive").length?(new M("请选择尺码").show(),!1):(j=z(".showSizeBox:not(.none) .atcive").data("num"),S=z(".showSizeBox:not(.none) .atcive").data("sku"),k={productSku:S,buyNumber:z("#mnum").val(),promotionId:T},void(z("#mnum").val()>j?new M("库存不足,目前还有"+j+"个库存").show():1===Number(z("#addToCart").val())?u(k):new M("该商品无法加入购物车").show()))}),Q.on("click",".cut, .add",function(){if(_=z(this).hasClass("minus")?"decreaseNum":"increaseNum",T)z(this).hasClass("cut")?new M("-_-,已经是最后一件,不能在减了!").show():new M("最多只能购买1,您好像购买的太多了!").show();else{if(z(this).hasClass("add")?ee++:ee--,1>ee)return new M("-_-,已经是最后一件,不能在减了!").show(),ee=1,!1;z("#mnum").val(ee)}}),Q.on("click",".color",function(){K=0,z(".color").find("p").removeClass("atcive"),z(this).find("p").addClass("atcive"),z(".showSizeBox").addClass("none").eq(z(this).index()).removeClass("none"),z(".showSizeBox:not(.none) span").length<2&&z(".showSizeBox:not(.none) span:first").addClass("atcive"),z(".detail-bigpic").addClass("none").eq(z(this).index()).removeClass("none"),z(".detail-bigpic").eq(z(this).index()).find(".bigpic").hide(),z(".detail-bigpic").eq(z(this).index()).find(".bigpic:first").show(),z(".detail-bigpic").eq(z(this).index()).find(".con li").removeClass("active"),z(".detail-bigpic").eq(z(this).index()).find(".con li:first").addClass("active"),z(".showSizeBox").eq(z(this).index()).find("span").each(function(){return z(this).hasClass("null-atcivec")?(z(".addcart").addClass("none"),void z(".btn_sellout").removeClass("none")):(z(".addcart").removeClass("none"),z(".btn_sellout").addClass("none"),!1)})}),Q.on("click",".showSizeBox span",function(){j=z(this).data("num"),z(this).data("num")>0?(z(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(z(this).index()).addClass("atcive"),z(".addcart").removeClass("none"),z(".btn_sellout").addClass("none")):(z(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(z(this).index()).addClass("atcivec"),z(".addcart").addClass("none"),z(".btn_sellout").removeClass("none"))}),z(".goBack").on("click",function(){k={},D=z(".dev-revocation .goBack").index(this),te=[],z(".dev-revocation tr").each(function(e){D!==e&&(x={productPrice:z(this).find(".productPrice").text(),productTitle:z(this).find(".title").text(),link:z(this).find(".title").attr("href"),productNum:z(this).data("productnum"),productSku:z(this).data("productsku"),promotionId:z(this).data("promotionid")},te.push(x))}),k={productSku:z(this).parents("tr").data("productsku"),promotionId:z(this).parents("tr").data("promotionid"),buyNumber:z(this).parents("tr").data("productnum")},u(k,te)}),Q.on("click",".piclist li",function(){K=z(this).index(),z(".detail-bigpic:not(.none) .piclist li").removeClass("active"),z(this).addClass("active"),z(".detail-bigpic:not(.none) .bigpic").hide().eq(z(this).index()).show()}),h(),Q.on("click",".pre, .next",function(){if(z(this).hasClass("next")){if(K>=z(this).siblings(".con").find("li").length-1)return!1;K++}else{if(1>K)return!1;K--}z(this).siblings(".con").find("li").removeClass("active").eq(K).addClass("active"),z(".detail-bigpic:not(.none) .bigpic").hide().eq(K).show()}),z(".btn_account").on("click",function(){P="",z(".pay-wapper input:checked").parents("tr").find(".tipNoStore").length>0?(U=z(".pay-wapper input:checked").parents("tr").find(".tipNoStore"),z.each(U.parents("tr").find(".pay-pro-info a"),function(){P+=z(this).html()}),new M(P+"库存不足").show()):z(".zp").length>0&&!z(this).attr("title")?(z(this).attr("title","1"),new M("您有赠品没有选择,请选择完再结算!").show()):z("input:checked").length>0?z(".pre-sell-box input:checked").length>0?window.location.href="/cart/index/orderEnsure?type=2":window.location.href="/cart/index/orderEnsure?type=1":new M("请至少选择一件商品").show()}),Y.on("selectstart",function(){return!1}),Q.on("selectstart",function(){return!1})}),define("js/guang/entry",["jquery","lazyload","dot","jquery-pjax"],function(e,t,n){e("js/guang/list"),e("js/guang/detail"),e("js/guang/index")}),define("js/guang/list",["jquery","lazyload","dot"],function(e,t,n){e("js/guang/msg"),e("js/guang/img-blink"),e("js/guang/right-side")}),define("js/guang/msg",["jquery","lazyload","dot"],function(e,t,n){function a(){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),n=t.closest(".msg-content").data("id");i!==n&&(i=n,t.toggleClass("liked"),e=t.hasClass("liked")?"/guang/info/praise":"/guang/info/cancelPraise",o.ajax({type:"GET",url:e,data:{id:n,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")}),a(),t.dotLazy=a}),define("js/guang/img-blink",["jquery"],function(e,t,n){var a=e("jquery");a(".guang-page").on("mouseover","a img, a .bg-img",function(e){var t=a(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,n){var a=e("jquery"),i=e("lazyload");e("dot"),a(".ex-reco-context").dotdotdot({wrap:"letter"}),i(a(".ads img.lazy"))}),define("js/guang/detail",["jquery","lazyload","dot","jquery-pjax"],function(e,t,n){function a(){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),a(),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,n=o(this);t||(n.toggleClass("liked"),e=n.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&&n.find(".like-num").html(e.data),t=!1}))}).bind("mouseenter mouseleave",function(){o(this).toggleClass("hover")}),o("#collect-btn").click(function(){var e,t,n=!1,a=o(this);n||(a.hasClass("collected")?(e="/guang/info/cancelcollect",t=0):(e="/guang/info/collect",t=1),n=!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)/,""):a.toggleClass("collected")}n=!1}))}).bind("mouseenter mouseleave",function(){o(this).toggleClass("hover")}),a(),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(){a(),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,n){var a=e("jquery"),i=e("js/guang/msg");e("jquery-pjax"),e("js/common/slider"),e("js/guang/img-blink"),e("js/guang/right-side"),a("#slider").slider(),a(document).pjax(".pjax-link, .msg-pager a","#pjax-container",{timeout:2e3}),a(document).on("pjax:end",function(){i.dotLazy()})}),define("js/home/entry",["jquery","handlebars","source-map","dot"],function(e,t,n){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,n){var a=e("jquery");e("js/home/order-block"),a("#close-message").click(function(){a(".message-tip").slideUp(200)}),function(){var e=a(".na-pager"),t=a(".new-arrival ul"),n=Math.ceil(t.children("li").length/5),i=t.children("li:last-child").outerWidth(),o=1;t.width(t.width()*n),e.click(function(){var e,s=a(this);s.hasClass("next")?(++o,2===o&&s.siblings().removeClass("no-visible"),o===n&&s.addClass("no-visible")):(--o,o===n-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,n){function a(e){var t={mask:!1,btns:[{id:"cancel-sure",name:"确定并取消订单",btnClass:["cancel-sure"],cb:function(){var t=o(".cancel-dialog :checked"),n=o(".cancel-dialog .cancel-tip");return 0===t.length?void n.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)):n.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=a(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,n){e("js/home/order-block")}),define("js/home/favorite",["jquery","handlebars","source-map","dot"],function(e,t,n){var a,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"),g.text("订阅成功")}function n(){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(n){200===n.code?(e(n.data.num),p.addClass("hide"),f.removeClass("hide"),g.text("取消成功"),
h.removeClass("hide").css({top:t}),o.closest(".reduction-products").length>0?o.closest(".fav-good").remove():o.removeClass("noticed").text(l.on)):n.message&&(m.text(n.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 a,r,c,u,h,p,f,m,g,v,y,b={};0!==s(".fav-products").length&&(a=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"),g=f.find(".subscribe-or-cancel"),v=s("#notice-phone-num"),b.phone=v.val(),b.change=!1,y=1*u.text(),s("#spread-sort").click(function(){a.slideUp(function(){r.slideDown()})}),s("#retract-sort").click(function(){r.slideUp(function(){a.slideDown()})}),s(".price-down-clock").click(function(){o=s(this),i=o.closest(".fav-good").data("id"),n()}),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 n,a;if(h.hasClass("error")||p.hasClass("hide"))t();else{if(n=s.trim(v.val()),""===n||!d.test(n))return a=""===n?"请输入手机号码":"手机号码格式不正确",v.addClass("error"),void s("#price-notice .err-text").removeClass("hide").find("em").html(a);if(v.removeClass("error"),s("#price-notice .err-text").addClass("hide"),""!==b.phone&&b.phone!==n&&!b.change)return s("#price-notice .phone-diff").removeClass("hide"),void(b.change=!0);s.ajax({type:"GET",url:"/home/favorite/notice",data:{mobile:n,id:i}}).then(function(t){200===t.code?(e(t.data.num),f.removeClass("hide"),p.addClass("hide"),b.phone=n,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"),n=e.closest("li");t.hasClass("hide")?(t.removeClass("hide"),n.css("padding-bottom",t.outerHeight())):(t.addClass("hide"),n.css("padding-bottom",""))}))}(),function(){function e(e,t){var n=e.data("id"),i=e.find(".na-goods-ul"),o=a[n],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 n,a={};0!==s(".fav-brands").length&&(n=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"),a[e]&&a[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=n(l),o.removeClass("hide").find(".na-content").html(s),t(r,o),d.length>5&&r.find(".na-next").removeClass("hidden"),a[e]||(a[e]={}),a[e].cache=!0,a[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),n=t.hasClass("na-pre")?-1:1;e(t.closest(".fav-brand"),n)}))}(),function(){s(".fav-articles").length<0||s(".fav-articles .desc").dotdotdot()}(),c&&c.length&&(a=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:a}}).then(function(e){200===e.code&&history.go(0)})}),s("#me-del-checked").click(function(){var e=[],t="商品";if("brand"===a?t="品牌":"article"===a&&(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:a}}).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,n){var a=e("jquery");a(".filter-select").change(function(){location.href=a(this).val()})}),define("js/home/returns",["jquery","handlebars","source-map"],function(e,t,n){e("js/home/returns-detail"),e("js/home/returns-apply")}),define("js/home/returns-detail",["jquery"],function(e,t,n){function a(){g=v[f]?v[f]:"",h.html(g+" 快递单号:"+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:v[e.id]}}).then(function(t){200===t.code?(f=e.id,m=e.number,r.eq(2).addClass("act")):alert(t.message),a(),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(),g="",v={},y=!1;d.parent().hasClass("exchange-detail")&&(y=!0),c.val(f),d.find(".company-list").each(function(){var e=s(this).data();v[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,n){function a(e){c.ajax({type:"POST",url:"/home/returns/getDelivery",data:{areaCode:e}}).then(function(e){var t="";200===e.code&&(c.each(e.data,function(e,n){var a="";"Y"===n.is_default&&(a='checked="checked"'),t+='<input type="radio" name="delivery-tpye" value="'+n.id+'" '+a+'"">'+n.name}),S.html(t))})}function i(e){C.hide(),2===e?(_.show(),x.hide(),C.hide()):3===e?(x.show(),_.hide(),C.hide()):4===e&&(C.show(),_.hide(),x.hide())}function o(){var e=[],t="换货";return E&&(t="退货"),p.length||(D="没有可以"+t+"的商品"),p.each(function(){var n,a=c(this).parent().parent(),i=a.next();D.length||c(this).prop("checked")&&(n={product_skn:a.find('input[name="skn"]').val(),product_skc:a.find('input[name="skc"]').val(),product_sku:a.find('input[name="sku"]').val(),goods_type:a.find('input[name="typeid"]').val(),last_price:a.find('input[name="price"]').val(),reason:1*a.find(".return-reason").val()},E?n.returned_reason=n.reason:(n.exchange_reason=n.reason,n.new_goods_id=1*a.find(".exchange-color").val(),n.new_product_sku=1*a.find(".exchange-size").val(),D||n.new_goods_id||(D="请选择要换的颜色"),D||n.new_product_sku||(D="请选择要换的尺码")),D||n.reason||(D="请选择"+t+"原因"),(4===n.reason||6===n.reason||8===n.reason)&&(n.remark=c.trim(i.find("textarea").val()),n.evidence_images=[],i.find('input[name="imgs"]').each(function(){n.evidence_images.push(c(this).val())}),D||n.remark||(D="请填写"+t+"描述"),D||n.evidence_images.length||(D="请上传图片")),delete n.reason,e.push(n))}),D||e.length||(D="请选择要"+t+"的商品"),e}function s(){var e={};return e.goods=o(),e.payment={},g.each(function(){c(this).prop("checked")&&(e.payment.return_amount_mode=1*c(this).val())}),D||e.payment.return_amount_mode||(D="请选择退款方式"),2===e.payment.return_amount_mode?(e.payment.province=v.val(),e.payment.city=y.val(),e.payment.area_code=b.val(),!D&&1*!e.payment.area_code&&(D="请选择银行所在地"),e.payment.bank_name=c.trim(w.find('input[name="bank-name"]').val()),D||e.payment.bank_name||(D="请填写银行名称"),e.payment.payee_name=c.trim(w.find('input[name="payee-name"]').val()),D||e.payment.payee_name||(D="请填写收款人姓名"),e.payment.bank_card=c.trim(w.find('input[name="bank-card"]').val()),D||e.payment.bank_card||(D="请填写收款账户")):3===e.payment.return_amount_mode&&(e.payment.alipay_name=c.trim(w.find('input[name="alipay-name"]').val()),D||e.payment.alipay_name||(D="请填写收款人姓名"),e.payment.alipay_account=c.trim(w.find('input[name="alipay-account"]').val()),D||e.payment.alipay_account||(D="请填写收款账户")),e}function r(){var e={};return e.goods=o(),e.consigneeName=c.trim(k.find('input[name="name"]').val()),D||e.consigneeName||(D="请填写收货人姓名"),e.areaCode=b.val(),!D&&1*!e.areaCode&&(D="请选择地区"),e.address=c.trim(k.find('input[name="address"]').val()),D||e.address||(D="请填写详细地址"),e.mobile=c.trim(k.find('input[name="phone"]').val()),e.mobile===U?e.mobile=F:D||e.mobile||(D="请填写手机号"),e.zipCode=c.trim(k.find('input[name="postcode"]').val()),e.deliveryType=k.find('input[name="delivery-tpye"]:checked').val(),D||e.deliveryType||(D="请选择商品返回方式"),e}function d(e){var t="○";e?(T.addClass("applying"),l=setInterval(function(){q.text(t),t.length>3&&(t=""),t+="○"},600)):(T.addClass("applying"),clearInterval(l))}var l,c=e("jquery"),u=e("js/home/common-address"),h=c("#goods-table"),p=h.find('input[type="checkbox"]'),f=h.find(".return-reason"),m=h.find("input[type=file]"),g=c('input[name="refund-type"]'),v=c("#province"),y=c("#city"),b=c("#area"),w=c("#refund-pay-info"),C=w.find(".type-yoho"),_=w.find(".type-bank"),x=w.find(".type-alipay"),k=c(".exchange-detail"),j=k.find('input[name="hide-phone"]'),S=k.find(".refund-mode"),T=c(".submit-box"),q=T.find(".wait-gif span"),E=0,I=c("#order-code").val(),A=k.find('input[name="hide-area"]').val(),F=j.val(),U="",D="",P={};e("plugin/jquery.qupload"),F&&(j.remove(),U=F.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"),k.find('input[name="phone"]').val(U)),w.length?(E=1,g.each(function(){c(this).prop("checked")&&i(1*c(this).val())})):a(A),A=A?A:"",u.loadAllData(A,{areaDomId:"area"}),h.find(".sizeinfo").each(function(){var e=[];c(this).children().each(function(){e.push(c(this).data())}),P[c(this).data().id]=e}),f.change(function(){var e=c(this).parent().parent(),t=1*c(this).val();4===t||6===t||8===t?e.next().show():e.next().hide()}),p.change(function(){var e=c(this).parent().parent();c(this).prop("checked")?e.find("select").prop("disabled",!1):(e.find("select").val(0).prop("disabled",!0),e.next().hide())}),h.on("change",".exchange-color",function(){var e=c(this).closest(".exchange-choose-wrap"),t='<option value="0">请选择尺码</option>',n=c(this).val();P[n]&&c.each(P[n],function(e,n){t+='<option value="'+n.id+'">'+n.name+"</option>"}),e.find(".exchange-size").html(t).val(0)}),h.on("click",".btn-del",function(){c(this).parent().empty()}),m.each(function(e){var t=c("#upload-img-"+e),n=t.closest(".problem-description");t.qupload({button_image_url:"",upload_url:window.location.origin+"/home/returns/imgUpload",file_post_name:"fileData",button_text:'<span class="btn_upload_text">上传图片</span>',button_text_style:".btn_upload_text{color: #ffffff;}",button_width:116,button_height:33,button_text_left_padding:32,button_text_top_padding:8,button_action:window.SWFUpload.BUTTON_ACTION.SELECT_FILE,file_size_limit:"10240",file_types:"*.jpg;*.jpeg;*.png;*.bmp",uploadSuccessed:function(e){var t,a,i=n.find("li"),o=!1;t=JSON.parse(e).imgList[0],a='<span class="btn-del" title="删除"></span><img src="'+t.imgUrl+'" width="126" height="126"><input type="hidden" name="imgs" value="'+t.imgRelUrl+'">',i.each(function(){o||c(this).find("img").length||(o=!0,c(this).html(a))})}})}),k.on("change","#area",function(){var e=1*c(this).val();e&&a(e)}),g.change(function(){var e=1*c(this).val();i(e)}),c(".save-btn").click(function(){var e,t;return D="",E?(e="/home/returns/saveRefund",t=s()):(e="/home/returns/saveExchange",t=r()),t.orderCode=I,D?void alert(D):(d(!0),void c.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),d())}))})}),define("js/home/common-address",["jquery","handlebars","source-map"],function(e,t,n){var a=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,n,i){var s,r,d,l,c=this,u=a("#"+t),h=0,p="";u.empty(),91>e&&(a("#"+c.areaDomId).empty(),a("#county").attr("disabled","disabled")),a.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">'+n+"</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===a("#"+t.provinceDomId).data("events")&&(a("#"+t.provinceDomId).change(function(){var n=a("#"+t.provinceDomId).val();"0"!==n&&(t.loadAreaData(n,t.cityDomId,"请选择城市",n),a("#"+t.areaDomId).hide(),t.showAreaSel(e.dispDomId))}),a("#"+this.cityDomId).change(function(){var n=a("#"+t.cityDomId).val();"0"!==n&&(t.loadAreaData(n,t.areaDomId,"请选择区县",n),a("#"+t.areaDomId).show(),t.showAreaSel(e.dispDomId))}),a("#"+t.areaDomId).change(function(){t.showAreaSel(e.dispDomId)}),t.showAreaSel(e.dispDomId))},showAreaSel:function(e){var t=this,n="",i=a("#"+t.provinceDomId).find("option:selected").text(),o=a("#"+t.cityDomId).find("option:selected").text(),s=a("#"+t.areaDomId).find("option:selected").text();void 0!==e&&""!==e&&(i.indexOf("选择")<0&&(n=i),""!==o&&o.indexOf("选择")<0&&(n+=","+o),""!==s&&s.indexOf("选择")<0&&(n+=","+s),a("#"+e).html(n))},loadAllData:function(e,t){var n=this;n.initDomIds(t),e+="",91>e?(n.loadAreaData(0,n.provinceDomId,"请选择省份",""),a("#"+n.areaDomId).hide(),a("#"+n.cityDomId).html('<option value="0">请选择市</option>')):4===e.length?(n.loadAreaData(0,n.provinceDomId,"请选择省份",e),n.loadAreaData(e.substr(0,2),n.cityDomId,"请选择城市",e),n.loadAreaData(e,n.areaDomId,"请选择区县",e),a("#"+n.areaDomId).show()):6===e.length&&(n.loadAreaData(0,n.provinceDomId,"请选择省份",e),n.loadAreaData(e.substr(0,2),n.cityDomId,"请选择城市",e),n.loadAreaData(e.substr(0,4),n.areaDomId,"请选择区县",e),a("#"+this.areaDomId).show()),n.bindAreaChange(t)}};n.exports=s}),define("plugin/jquery.qupload",["jquery"],function(e,t,n){function a(){0==l&&(s("body").append('<div id="progressDialog" style="display: none;width:370px;height:80px !important;"><div style="padding:10px 20px;"><span id="curUploadStatus">图片上传中……请稍等</span><div id="progress"></div></div></div>'),l=1)}function i(e,t){s("#uploadNum").html(e),s("#totalUploadNum").html(t)}function o(e,t){function n(e,n){this.options[e]=void 0==t[e]?n:t[e]}function a(e){try{}catch(t){this.debug(t)}}function o(e,t,n){var a;try{if(t===r.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED)return void alert("您尝试上传太多文件.\n"+(0===n?"您已达到上传限制.":"您最多还可以 "+(n>1?"上传 "+n+"文件.":"一个文件.")));switch(t){case r.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:a="文件超过"+C.file_size_limit/1024+"M",alert(a),this.debug("Error Code: File too big, File name: "+e.name+", File size: "+e.size+", Message: "+n);break;case r.QUEUE_ERROR.ZERO_BYTE_FILE:alert("请上传有内容的文件!"),this.debug("Error Code: Zero byte file, File name: "+e.name+", File size: "+e.size+", Message: "+n);break;case r.QUEUE_ERROR.INVALID_FILETYPE:alert("请上传指定类型的文件!"),this.debug("Error Code: Invalid File Type, File name: "+e.name+", File size: "+e.size+", Message: "+n);break;default:alert("上传文件失败,请稍后在试!"),this.debug("Error Code: "+t+", File name: "+e.name+", File size: "+e.size+", Message: "+n)}}catch(i){this.debug(i)}}function s(){null!=y&&y()}function l(e,t){try{e>0&&(b=e,w=1,i(w,b),this.startUpload())}catch(n){this.debug(n)}}function c(e){this.addPostParam("_key",v)}function u(e,t,n){Math.ceil(t/n*100)}function h(e,t){w++,i(w,b),null!=g&&g(t)}function p(e,t,n){try{if(t===r.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED)return void alert("您尝试上传太多文件.\n"+(0===n?"您已达到上传限制.":"您最多还可以 "+(n>1?"上传 "+n+"文件.":"一个文件.")));switch(t){case r.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:alert("Error Code: 文件太大。 文件名为: "+e.name+", 大小为: "+e.size+", Message: "+n);break;case r.QUEUE_ERROR.ZERO_BYTE_FILE:alert("Error Code: 文件为0, 文件名为: "+e.name+", 大小为: "+e.size+", Message: "+n);break;case r.QUEUE_ERROR.INVALID_FILETYPE:alert("Error Code: 文件类型不合要求, 文件名为: "+e.name+", 大小为: "+e.size+", Message: "+n);break;default:alert("上传出错Error Code: "+t+", File name: "+e.name+", File size: "+e.size+", Message: "+n)}}catch(a){this.debug(a)}}function f(e){}function m(e){}var g=null;void 0!=t.uploadSuccessed&&(g=t.uploadSuccessed);var v="";void 0!=t.uploadKey&&(v=t.uploadKey);var y=null;void 0!=t.preupload&&(y=t.preupload);var b=0,w=0;this.options=t;this.options.errmsg_box;n("flash_url","http://static.yohobuy.com/admin/js/swfupload/swfupload.swf"),n("upload_url","http://upload.yohobuy.com"),n("file_post_name","Filedata"),n("file_size_limit","2 MB"),n("file_types","*.*"),n("file_types_description","All Files"),n("file_upload_limit",d),n("file_queue_limit",0),n("button_image_url","http://static.yohobuy.com/admin/images/btn_swfupload.png"),n("button_width","104"),n("button_height","20"),n("button_text",'<span class="btn_upload_xzzp">选择本地照片</span>'),n("button_text_style",".btn_upload_xzzp{color:#ffffff}"),n("button_text_left_padding",24),n("button_text_top_padding",0),n("button_window_mode","TRANSPARENT"),n("button_cursor","-2");var C={flash_url:this.options.flash_url,upload_url:this.options.upload_url,file_post_name:this.options.file_post_name,file_size_limit:this.options.file_size_limit,file_types:this.options.file_types,file_types_description:this.options.file_types_description,file_upload_limit:this.options.file_upload_limit,file_queue_limit:this.options.file_queue_limit,prevent_swf_caching:!1,preserve_relative_urls:!1,custom_settings:{},debug:!1,button_image_url:this.options.button_image_url,button_width:this.options.button_width,button_height:this.options.button_height,button_placeholder_id:e,button_text:this.options.button_text,button_text_style:this.options.button_text_style,button_text_left_padding:this.options.button_text_left_padding,button_text_top_padding:this.options.button_text_top_padding,button_window_mode:this.options.button_window_mode,button_cursor:this.options.button_cursor,file_dialog_start_handler:s,file_queued_handler:a,file_queue_error_handler:o,file_dialog_complete_handler:l,upload_start_handler:c,upload_progress_handler:u,upload_error_handler:p,upload_success_handler:h,upload_complete_handler:f,queue_complete_handler:m,button_action:this.options.button_action};new r(C)}var s=e("jquery"),r=e("plugin/swfupload.queue").SWFUpload,d=6;s.fn.extend({qupload:function(e){a(),o(s(this).attr("id"),e)}});var l=0;window.SWFUpload=r}),define("plugin/swfupload.queue",[],function(e,t,n){var a=e("plugin/swfupload").SWFUpload;"function"==typeof a&&(a.queue={},a.prototype.initSettings=function(e){return function(){"function"==typeof e&&e.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=a.queue.uploadCompleteHandler,this.settings.upload_start_handler=a.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(a.prototype.initSettings),a.prototype.startUpload=function(e){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[e])},a.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();for(var e=this.getStats();e.files_queued>0;)this.cancelUpload(),e=this.getStats()},a.queue.uploadStartHandler=function(e){var t;return"function"==typeof this.queueSettings.user_upload_start_handler&&(t=this.queueSettings.user_upload_start_handler.call(this,e)),t=t===!1?!1:!0,this.queueSettings.queue_cancelled_flag=!t,t},a.queue.uploadCompleteHandler=function(e){var t,n=this.queueSettings.user_upload_complete_handler;if(e.filestatus===a.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t="function"==typeof n?n.call(this,e)===!1?!1:!0:e.filestatus===a.FILE_STATUS.QUEUED?!1:!0){var i=this.getStats();i.files_queued>0&&this.queueSettings.queue_cancelled_flag===!1?this.startUpload():this.queueSettings.queue_cancelled_flag===!1?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0)}}),t.SWFUpload=a}),define("plugin/swfupload",[],function(require,exports,module){var SWFUpload;void 0==SWFUpload&&(SWFUpload=function(e){this.initSWFUpload(e)}),SWFUpload.prototype.initSWFUpload=function(e){try{this.customSettings={},this.settings=e,this.eventQueue=[],this.movieName="SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(t){throw delete SWFUpload.instances[this.movieName],t}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(e){if("string"!=typeof e||e.match(/^https?:\/\//i)||e.match(/^\//))return e;var t=(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),window.location.pathname.lastIndexOf("/"));return 0>=t?path="/":path=window.location.pathname.substr(0,t)+"/",path+e},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(e,t){this.settings[e]=void 0==this.settings[e]?t:this.settings[e]},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime()),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url&&(this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url))),delete this.ensureDefault},SWFUpload.prototype.loadFlash=function(){var e,t;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";if(e=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,void 0==e)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;t=document.createElement("div"),t.innerHTML=this.getFlashHTML(),e.parentNode.replaceChild(t.firstChild,e),void 0==window[this.movieName]&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")},SWFUpload.prototype.getFlashVars=function(){var e=this.buildParamString(),t=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(t),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(e),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName)),null===this.movieElement)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var e=this.settings.post_params,t=[];if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(e[n].toString()));return t.join("&amp;")},SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var e=null;if(e=this.getMovieElement(),e&&"unknown"==typeof e.CallFunction){for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}try{e.parentNode.removeChild(e)}catch(a){}}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(i){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","	","upload_url:               ",this.settings.upload_url,"\n","	","flash_url:                ",this.settings.flash_url,"\n","	","use_query_string:         ",this.settings.use_query_string.toString(),"\n","	","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","	","http_success:             ",this.settings.http_success.join(", "),"\n","	","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","	","file_post_name:           ",this.settings.file_post_name,"\n","	","post_params:              ",this.settings.post_params.toString(),"\n","	","file_types:               ",this.settings.file_types,"\n","	","file_types_description:   ",this.settings.file_types_description,"\n","	","file_size_limit:          ",this.settings.file_size_limit,"\n","	","file_upload_limit:        ",this.settings.file_upload_limit,"\n","	","file_queue_limit:         ",this.settings.file_queue_limit,"\n","	","debug:                    ",this.settings.debug.toString(),"\n","	","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","	","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","	","button_placeholder:       ",this.settings.button_placeholder?"Set":"Not Set","\n","	","button_image_url:         ",this.settings.button_image_url.toString(),"\n","	","button_width:             ",this.settings.button_width.toString(),"\n","	","button_height:            ",this.settings.button_height.toString(),"\n","	","button_text:              ",this.settings.button_text.toString(),"\n","	","button_text_style:        ",this.settings.button_text_style.toString(),"\n","	","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","	","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","	","button_action:            ",this.settings.button_action.toString(),"\n","	","button_disabled:          ",this.settings.button_disabled.toString(),"\n","	","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","	","swfupload_loaded_handler assigned:  ",("function"==typeof this.settings.swfupload_loaded_handler).toString(),"\n","	","file_dialog_start_handler assigned: ",("function"==typeof this.settings.file_dialog_start_handler).toString(),"\n","	","file_queued_handler assigned:       ",("function"==typeof this.settings.file_queued_handler).toString(),"\n","	","file_queue_error_handler assigned:  ",("function"==typeof this.settings.file_queue_error_handler).toString(),"\n","	","upload_start_handler assigned:      ",("function"==typeof this.settings.upload_start_handler).toString(),"\n","	","upload_progress_handler assigned:   ",("function"==typeof this.settings.upload_progress_handler).toString(),"\n","	","upload_error_handler assigned:      ",("function"==typeof this.settings.upload_error_handler).toString(),"\n","	","upload_success_handler assigned:    ",("function"==typeof this.settings.upload_success_handler).toString(),"\n","	","upload_complete_handler assigned:   ",("function"==typeof this.settings.upload_complete_handler).toString(),"\n","	","debug_handler assigned:             ",("function"==typeof this.settings.debug_handler).toString(),"\n"].join(""));
},SWFUpload.prototype.addSetting=function(e,t,n){return void 0==t?this.settings[e]=n:this.settings[e]=t},SWFUpload.prototype.getSetting=function(e){return void 0!=this.settings[e]?this.settings[e]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>"),returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}return void 0!=returnValue&&"object"==typeof returnValue.post&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(e){this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelUpload=function(e,t){t!==!1&&(t=!0),this.callFlash("CancelUpload",[e,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(e){this.callFlash("SetStats",[e])},SWFUpload.prototype.getFile=function(e){return"number"==typeof e?this.callFlash("GetFileByIndex",[e]):this.callFlash("GetFile",[e])},SWFUpload.prototype.addFileParam=function(e,t,n){return this.callFlash("AddFileParam",[e,t,n])},SWFUpload.prototype.removeFileParam=function(e,t){this.callFlash("RemoveFileParam",[e,t])},SWFUpload.prototype.setUploadURL=function(e){this.settings.upload_url=e.toString(),this.callFlash("SetUploadURL",[e])},SWFUpload.prototype.setPostParams=function(e){this.settings.post_params=e,this.callFlash("SetPostParams",[e])},SWFUpload.prototype.addPostParam=function(e,t){this.settings.post_params[e]=t,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(e){delete this.settings.post_params[e],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(e,t){this.settings.file_types=e,this.settings.file_types_description=t,this.callFlash("SetFileTypes",[e,t])},SWFUpload.prototype.setFileSizeLimit=function(e){this.settings.file_size_limit=e,this.callFlash("SetFileSizeLimit",[e])},SWFUpload.prototype.setFileUploadLimit=function(e){this.settings.file_upload_limit=e,this.callFlash("SetFileUploadLimit",[e])},SWFUpload.prototype.setFileQueueLimit=function(e){this.settings.file_queue_limit=e,this.callFlash("SetFileQueueLimit",[e])},SWFUpload.prototype.setFilePostName=function(e){this.settings.file_post_name=e,this.callFlash("SetFilePostName",[e])},SWFUpload.prototype.setUseQueryString=function(e){this.settings.use_query_string=e,this.callFlash("SetUseQueryString",[e])},SWFUpload.prototype.setRequeueOnError=function(e){this.settings.requeue_on_error=e,this.callFlash("SetRequeueOnError",[e])},SWFUpload.prototype.setHTTPSuccess=function(e){"string"==typeof e&&(e=e.replace(" ","").split(",")),this.settings.http_success=e,this.callFlash("SetHTTPSuccess",[e])},SWFUpload.prototype.setAssumeSuccessTimeout=function(e){this.settings.assume_success_timeout=e,this.callFlash("SetAssumeSuccessTimeout",[e])},SWFUpload.prototype.setDebugEnabled=function(e){this.settings.debug_enabled=e,this.callFlash("SetDebugEnabled",[e])},SWFUpload.prototype.setButtonImageURL=function(e){void 0==e&&(e=""),this.settings.button_image_url=e,this.callFlash("SetButtonImageURL",[e])},SWFUpload.prototype.setButtonDimensions=function(e,t){this.settings.button_width=e,this.settings.button_height=t;var n=this.getMovieElement();void 0!=n&&(n.style.width=e+"px",n.style.height=t+"px"),this.callFlash("SetButtonDimensions",[e,t])},SWFUpload.prototype.setButtonText=function(e){this.settings.button_text=e,this.callFlash("SetButtonText",[e])},SWFUpload.prototype.setButtonTextPadding=function(e,t){this.settings.button_text_top_padding=t,this.settings.button_text_left_padding=e,this.callFlash("SetButtonTextPadding",[e,t])},SWFUpload.prototype.setButtonTextStyle=function(e){this.settings.button_text_style=e,this.callFlash("SetButtonTextStyle",[e])},SWFUpload.prototype.setButtonDisabled=function(e){this.settings.button_disabled=e,this.callFlash("SetButtonDisabled",[e])},SWFUpload.prototype.setButtonAction=function(e){this.settings.button_action=e,this.callFlash("SetButtonAction",[e])},SWFUpload.prototype.setButtonCursor=function(e){this.settings.button_cursor=e,this.callFlash("SetButtonCursor",[e])},SWFUpload.prototype.queueEvent=function(e,t){void 0==t?t=[]:t instanceof Array||(t=[t]);var n=this;if("function"==typeof this.settings[e])this.eventQueue.push(function(){this.settings[e].apply(this,t)}),setTimeout(function(){n.executeNextEvent()},0);else if(null!==this.settings[e])throw"Event handler "+e+" is unknown or is not a function"},SWFUpload.prototype.executeNextEvent=function(){var e=this.eventQueue?this.eventQueue.shift():null;"function"==typeof e&&e.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(e){var t,n=/[$]([0-9a-f]{4})/i,a={};if(void 0!=e){for(var i in e.post)if(e.post.hasOwnProperty(i)){t=i;for(var o;null!==(o=n.exec(t));)t=t.replace(o[0],String.fromCharCode(parseInt("0x"+o[1],16)));a[t]=e.post[i]}e.post=a}return e},SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(e){return!1}},SWFUpload.prototype.flashReady=function(){var e=this.getMovieElement();return e?(this.cleanUp(e),void this.queueEvent("swfupload_loaded_handler")):void this.debug("Flash called back ready but the flash movie can't be found.")},SWFUpload.prototype.cleanUp=function(e){try{if(this.movieElement&&"unknown"==typeof e.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}}}catch(a){}window.__flash__removeCallback=function(e,t){try{e&&(e[t]=null)}catch(n){}}},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("file_queued_handler",e)},SWFUpload.prototype.fileQueueError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("file_queue_error_handler",[e,t,n])},SWFUpload.prototype.fileDialogComplete=function(e,t,n){this.queueEvent("file_dialog_complete_handler",[e,t,n])},SWFUpload.prototype.uploadStart=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("return_upload_start_handler",e)},SWFUpload.prototype.returnUploadStart=function(e){var t;if("function"==typeof this.settings.upload_start_handler)e=this.unescapeFilePostParams(e),t=this.settings.upload_start_handler.call(this,e);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===t&&(t=!0),t=!!t,this.callFlash("ReturnUploadStart",[t])},SWFUpload.prototype.uploadProgress=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_progress_handler",[e,t,n])},SWFUpload.prototype.uploadError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_error_handler",[e,t,n])},SWFUpload.prototype.uploadSuccess=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_success_handler",[e,t,n])},SWFUpload.prototype.uploadComplete=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("upload_complete_handler",e)},SWFUpload.prototype.debug=function(e){this.queueEvent("debug_handler",e)},SWFUpload.prototype.debugMessage=function(e){if(this.settings.debug){var t,n=[];if("object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.message){for(var a in e)e.hasOwnProperty(a)&&n.push(a+": "+e[a]);t=n.join("\n")||"",n=t.split("\n"),t="EXCEPTION: "+n.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(t)}else SWFUpload.Console.writeLine(e)}},SWFUpload.Console={},SWFUpload.Console.writeLine=function(e){var t,n;try{t=document.getElementById("SWFUpload_Console"),t||(n=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(n),t=document.createElement("textarea"),t.id="SWFUpload_Console",t.style.fontFamily="monospace",t.setAttribute("wrap","off"),t.wrap="off",t.style.overflow="auto",t.style.width="700px",t.style.height="350px",t.style.margin="5px",n.appendChild(t)),t.value+=e+"\n",t.scrollTop=t.scrollHeight-t.clientHeight}catch(a){alert("Exception: "+a.name+" Message: "+a.message)}},exports.SWFUpload=SWFUpload}),define("js/home/comment",["jquery"],function(e,t,n){var a,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(),n=t.orderid;f[n]={},f[n].productSkn=t.productskn,f[n].productId=t.productid,f[n].goodsId=t.goodsid,f[n].orderId=t.orderid,f[n].erpSkuId=t.erpskuid,e.remove(),i(this).data("code",n)}),s.click(function(){var e=i(document).scrollTop();a=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,n;p.canmove&&(t=e.pageY-p.offset.y,n=e.pageX-p.offset.x,t=t<p.maxtop?t:p.maxtop,n=n<p.maxleft?n:p.maxleft,r.css({top:t>0?t:0,left:n>0?n: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(a.length&&(e=f[a.data().code],e.content=t,i.ajax({type:"POST",url:"/home/comment/saveComment",data:e}).then(function(e){var n=a.parent();200===e.code?(n.prev().text(t),n.html('<span class="remarked">已评论!</span>'),a.length=0,r.addClass("hide")):alert(e.message)})))}),r.on("click",".dialog-close-btn",function(){a.length=0,r.addClass("hide")})}),define("js/home/complaints",["jquery"],function(e,t,n){function a(){return m?!0:(m=!0,setTimeout(function(){m=!1},1e3),!1)}function i(e){var t=e.dom.siblings(".option-tip"),n=d.trim(e.dom.val()),a=n.length;return e.min&&a<e.min?(t.text(e.onmin),!1):e.max&&a>e.max?(t.text(e.onmax),!1):e.regexp&&!e.regexp.test(n)?(t.text(e.onerror),!1):(t.text("输入正确"),!0)}function o(){var e,t={};return d.each(g,function(n,a){i(a)?t[n]=d.trim(a.dom.val()):e||(e=n,a.dom.focus())}),t.complaintsType=h.val(),e?!1:t}function s(){var e=o();!a()&&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 n=t;a()||d.ajax({type:"POST",url:"/home/complaints/cancelcomplaints",data:{id:e}}).then(function(e){m=!1,200===e.code?(n.prev().remove(),n.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,g={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(g,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,n){function a(){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 n;switch(e){case"del":n="/home/message/delMessage";break;case"read":n="/home/message/readMessage"}s.ajax({type:"GET",url:n,data:t}).then(function(t){t.code?200===t.code?"read"===e&&(o.removeAttr("checked"),o.parent().parent().removeClass("new-msg"),a()):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")),a()}),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,n){var a=e("jquery"),i=a(".pick-coupon-btn"),o=!1;i.click(function(){var e=a(this).data();o||(o=!0,a.ajax({type:"GET",url:"/home/message/pickCoupon",data:e}).then(function(e){var t=e.message;200===e.code&&(t="领取成功",a(this).removeClass("pick-coupon-btn")),o=!1,alert(t)}))})}),define("js/home/edit",["jquery","handlebars","source-map"],function(e,t,n){function a(){var e=u("#nickname").val().length,t=u("#username").val().length,n=u('input[name="gender"]'),a=u("#year"),i=u("#month"),o=u("#day");return 0===e?(alert("请输入昵称"),!1):0===t?(alert("请输入用户名"),!1):e>=20?(alert("昵称最长为20个字符"),!1):n.is(":checked")?"0"===a.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,n){var a='<li id="brand-'+t+'">'+n+'<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(a),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 n=u("#"+t).closest("form");u.post(e,n.serialize(),function(e){return 200===e.code?(alert(e.message),setTimeout(function(){n.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,n){var a=u("#year"),i=u("#month"),o=u("#day"),s=this;this.createDay(a.val(),i.val(),o.val()),a.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,n){var a,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++)a="",parseInt(n)===i&&(a="selected"),o+='<option value="'+i+'" '+a+">"+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(){a()&&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,n){function a(){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(),a()):window.location.href="/home/gift?type=2"},"json"):!1}),o(document).on("click","#imgcode,.check-img",function(){a()}),o(function(){a(),p.bindGiftCardForm()})}),define("js/home/validate",["jquery","handlebars","source-map"],function(e,t,n){function a(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 v.post(e.url,e.data,function(n){"undefined"!=typeof n.code&&200===n.code?t=i(e.opt):(e.txt=""!==e.txt&&null!==e.txt?e.txt:n.message,t=a(e.opt,e.txt))}),t}function s(e){var t=e.val(),n=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===n?a(h,"密码不能为空!"):(v.extend(p,{url:"/home/account/checkpassword",data:{password:t},txt:"密码错误!"}),o(p)):"verifyCode"===d?(v.extend(p,{url:"/home/account/checkverifycode",data:{verifyCode:t},txt:"验证码错误!"}),o(p)):"email"===d?(l=b.emailRegx,null===t.match(l)?a(h,"邮箱错误!"):(v.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===n?a(h,"手机号不能为空!"):null!==l&&l?(v.extend(p,{url:"/home/account/checkmobile",data:{mobile:t},txt:"手机号已经存在!"}),o(p)):a(h,"手机号错误!")):"newPwd"===d?(l=b.pwdValidateRegx,l.test(t)?i(h):a(h,"建议6~20个数字+字母组合!")):"confirm_password"===d?v("#newPwd").val()!==t?a(h,"两次密码不一致!"):i(h):"code"!==d?!0:(u=v("#realAccount").length>0?v("#realAccount").val():v("#mobilevalue").val(),""!==t?(v.extend(p,{url:"/home/account/checkmobilemsg",data:{mobile:u,code:v("#inputcode").val()},txt:"验证码错误!"}),o(p)):void 0)}function r(){var e=[];return k=!1,v.each(_,function(t,n){e[t]=s(v(n))}),e.indexOf(!1)>=0?!1:!0}function d(){var e=(new Date).getTime();v("#the-code-img").attr("src","/passport/images?len=6&time="+e)}function l(){var e="";j>0?(e="重新发送"+j+"秒",v("#sendButton").text(e),j-=1):(j=60,v("#sendButton").text("发送验证码"),clearInterval(m),x=!0)}function c(e){var t=v("#inputcode"),n=t.parent().find("check-info");v.post("/home/account/sendmobilemsg",{mobile:e},function(e){"undefined"!=typeof e.code&&200===e.code?(x=!1,m=setInterval(function(){l()},1e3),n.html("")):n.html('<div class="form-error">验证码发送失败</div>')})}function u(){var e,t,n,a=v("#mobilevalue");if(a.length>0?(e=a.next(),t=a.val(),n=t.split("-"),n=1===n.length?t.match("^1[35847]{1}[0-9]{9}"):b.phoneRegx["+"+n[0]].test(n[1])):t=v("#realAccount").val(),!x)return!1;if(a.length>0){if(null===n||!n)return e.html('<div class="form-error">手机号错误!</div>'),a.addClass("input-error"),!1;e.find(".form-success").length>0&&c(t)}v("#realAccount").length>0&&c(t)}function h(){window.location.href="/home/account"}function p(e,t){v.post(e.url,e.data,function(n){return 200!==n.code?(k=!0,g=new w(n.message),g.show(),!1):(t&&(e.hrefUrl+="&checkCode="+n.data),void(window.location.href=e.hrefUrl))},"json")}function f(){var e=v(".progress-bar .cur").index(),t=v("#verifyType").val(),n="",a={};v(".email").length>0&&(n="email"),v(".mobile").length>0&&(n="mobile"),v(".userpwd").length>0&&(n="userpwd"),0===e?"1"===t?(a={url:"/home/account/verifypassword",data:v("#pwdform").serialize(),hrefUrl:"/home/account/"+n+"?step=2"},p(a,"step1")):"2"===t?(a={url:"/home/account/sendemail",data:{checkType:n,email:v("#realAccount").val()},hrefUrl:"/home/account/sendemailsuccess?email="+v("#realAccount").val()+"&type=1&checkType="+n},p(a)):(a={url:"/home/account/checkmobilemsg",data:{mobile:v("#realAccount").val(),code:v("#inputcode").val()},hrefUrl:"/home/account/"+n+"?step=2"},p(a,"step1")):1===e&&("userpwd"===n?(a={url:"/home/account/modifypwd",data:v("#pwdform").serialize(),hrefUrl:"/home/account/userpwd?step=3&success=true"},p(a)):"email"===n?(a={url:"/home/account/modifyemail",data:{email:v("#email").val()},hrefUrl:"/home/account/sendemailsuccess?email="+v("#email").val()+"&type=2&checkType=email"},p(a)):(a={url:"/home/account/modifymobile",data:{mobile:v("#mobilevalue").val(),code:v("#inputcode").val()},hrefUrl:"/home/account/mobile?step=3&success=true"},p(a)))}var m,g,v=e("jquery"),y=e("js/common/dialog"),b=e("js/passport/mail-phone-regx"),w=y.Alert,C=v(".check-user"),_=C.find("input").not("input[type=button],input[type=hidden],input[type=reset]"),x=!0,k=!0,j=60;v.ajaxSetup({async:!1}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n,a;for(n=t||0,a=this.length;a>n;n++)if(this[n]===e)return n;return-1}),v(function(){var e=null;v(".res-info").length>0&&(e=setTimeout(function(){h()},5e3)),d(),v("#pwdform").submit(function(){return!1}),_.blur(function(){s(v(this))}),v(".sub-btn").on("click",function(){return k===!1?!1:r()?void f():!1}),v("input[name=verifyCode]").keydown(function(e){if(13===e.keyCode){if(k===!1)return!1;if(!r())return!1;f()}}),v(".the-code").on("click",function(){d()}),v("#send-mobile-code").on("click",function(){u()}),v("#newPwd").length>0&&v("#newPwd").on("input",function(e){var t=v("input[name=confirm_password]"),n=t.val(),i=v("#newPwd").val(),o={dom:t,$checkInfo:t.next()};n.length>0&&i!==n&&a(o,"两次密码不一致!")})})}),define("js/home/address",["jquery","handlebars","source-map"],function(e,t,n){function a(e){var t=e.parents(".address-content"),n=t.attr("addressId");return n}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="",n=!0,a="输入正确",i="form-info form-success",o=e.val;return"addressName"===e.inputName&&(t=/^[\u4e00-\u9fa5]{2,5}$/,e.len<1||e.len>12?(a="真实姓名在2到5个汉字之间,请确认",n=!1,i="form-info form-error"):t.test(e.val)===!1&&(a="真实姓名至少2个中文,最多5个中文",n=!1,i="form-info form-error")),"address"===e.inputName&&e.len<2&&(a="请填写详细地址",n=!1,i="form-info form-error"),"zipCode"===e.inputName&&(t=/^[0-9]{6}$/,0===e.len?(a="请输入收货人所在地邮编号",n=!1,i="form-info form-error"):t.test(e.val)===!1&&(a="你输入的邮编式不正确",n=!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?(a="你真的不想留联系电话了吗?",n=!0,i="form-info form-success"):t.test(e.val)===!1&&(a="你输入的联系电话格式不正确",n=!1,i="form-info form-error")),"mobile"===e.inputName&&(t=/^1[3|4|5|8|7][0-9]{9}$/,11!==e.len?(a="手机号码必须是11位的,请确认",n=!1,i="form-info form-error"):t.test(e.val)===!1&&(a="您输入的手机号格式不正确",n=!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)&&(a="你输入的邮件地址格式不正确",n=!1,i="form-info form-error")),e.$checkInfo.removeClass().addClass(i).html(a),n}function s(e,t){var n=e.val(),a=e.parent(),s={val:n,len:n.length,$domParent:e.parent(),$checkInfo:a.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(g,function(t,n){e.push(s(c(n),"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"),g=c(".input-1"),v={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()&&v.clearAddrForm()):(l=new p("删除失败"),l.show())})},setDefaultAddr:function(e){var t=c(".address-list").find(".default-btn"),n=c(".address-list").find(".default-btn").parents("li"),a=c(".address-list").find("li[addressId="+e+"]"),i=a.find(".set-default-btn");c.getJSON("/home/address/defaultAddress?id="+e,function(e){200===e.code?(t.attr("class","btn-c3 set-default-btn"),n.removeClass("preferred"),t.html("<span>设为常用地址</span>"),i.attr("class","btn-c2 default-btn"),t.html("<span>设为常用地址</span>"),a.addClass("preferred")):(l=new p("设置失败"),l.show())})}};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n,a;for(n=t||0,a=this.length;a>n;n++)if(this[n]===e)return n;return-1}),c(document).on("click",".set-default-btn",function(){var e=a(c(this));v.setDefaultAddr(e)}),f.on("click",function(){var e=a(c(this));v.delAddr(e)}),m.on("click",function(){var e=a(c(this));v.editAddr(e),c("#btn-reset").show()}),g.on("focus",function(){s(c(this),"focus")}),g.on("blur",function(){s(c(this),"blur")}),c("#address-info").on("click",function(){d()&&v.saveAddr()}),c(document).ready(function(){u.loadAllData(0,{provinceDomId:"province",cityDomId:"city",areaDomId:"areaCode"}),v.clearAddrForm(),c("#btn-reset").click(function(){v.clearAddrForm()})})}),define("js/help/entry",["jquery","handlebars","source-map"],function(e,t,n){e("js/help/search")}),define("js/help/search",["jquery","handlebars","source-map"],function(e,t,n){var a=e("jquery"),i=e("handlebars"),o=a(".search-content"),s=a("#help-dialog-widget"),r=a("#help-dialog-bg"),d=a(document).width(),l=a(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=a(this).data(),t=a(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,n){var a=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:a(".pan"),$jc:a("#juancode"),$bp:a("#biprice"),$statistics:a("li",".play-total"),$tobi:a("p em",".play-bi-pan .play-pan"),$cancel:a(".cancel",".btn-group"),$total:a("em",".to-play"),$tbody:a("table tbody",".pay-wapper"),$orderSelectionSave:a(".address-list h2 span"),$addAddress:a(".add-address"),$addressManage:a(".address-manage"),$spanPayTypeLegend:a("span.pay-type-legend"),$supportType:a(".support-type"),$existAddressListWrap:a(".exist-address-list"),$existAddressList:a(".exist-address-list").find("li"),$existAddress:a(".exist-address-list").find('input[name="exist-address"]'),$payTimeModify:a(".pay-time-modify"),$switchPayModify:a(".switch-pay-modify"),$modityPayInfo:a(".modity-pay-info"),$payTotal:a(".play-total"),$toPay:a(".to-play em"),$redEnvelopes:a(".red-envelopes"),$useEnvelopes:a(".use-envelopes"),$hasEnvelopes:a(".has-envelopes span"),$useEnvelopesInput:a(".use-envelopes").find("input")},init:function(){var e=this.e,t=s.Data,n=s.Common;e.$tbody.find("tr").each(function(i){var o=a(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("¥"+n.strFixed(r)),
r=0):o.eq(4).html("¥"+n.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>¥"+n.strFixed(t.product)+"</strong>")}),e.$pan.find("dt").click(function(){var e=a(this).parent("dl.pan");e.find("dd").is(":hidden")?(n.winShow(e),a(this).addClass("active")):(n.winHide(e),a(this).removeClass("active"))}),e.$orderSelectionSave.click(function(){var t=0,n=a(".exist-address-list li"),i=n.length,o=0;if(a(this).attr("expand")){for(t=0;i>t;t++)n.eq(t).hasClass("address_select")&&o++,n.eq(t).hasClass("address_select")||n.eq(t).addClass("hide");0===o&&(a('.exist-address-list li:not(".use-new-address")').removeClass("hide"),a(".use-new-address input").removeAttr("checked")),a(".address-list-inner li.address_select input").attr("checked","checked"),a(".address-list-inner li").removeClass("active"),a(".address-list-inner li.address_select").addClass("active"),a(this).removeAttr("expand").text("[修改]"),a(".save-btn").addClass("hide"),e.$existAddressListWrap.removeClass("address-expand"),e.$addressManage.addClass("hide")}else a(this).attr("expand","expand").text("[不保存并关闭]"),a(".exist-address-list li").removeClass("hide"),a(".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"),a(this).text("[不保存并关闭]")):(e.$payTimeModify.addClass("hide"),e.$modityPayInfo.removeClass("hide"),a(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(){a(this).toggleClass("active"),e.$supportType.toggleClass("hide")}),a(document).on("click",".exist-address-list li",function(){a(".exist-address-list li").removeClass("active"),a(this).addClass("active"),a(this).find("input").attr("checked","checked"),a(this).hasClass("use-new-address")&&(e.$addressManage.removeClass("hide"),a(".address-manage input").val(""),a(".save-btn").removeAttr("data-id"),i.newAddress(0,"000000"))})},render:function(e,t){var n,i,o,s=this.e,r=e.promotion_formula_list,d="",l="";for(i=t?t:"",n=0;n<r.length;n++)"优惠券:"===r[n].promotion&&(r[n].promotion=(i?i:"优惠券")+'<span class="juan-modify">[修改]</span>:'),"YOHO币:"===r[n].promotion&&(r[n].promotion='YOHO币<span class="bi-modify">[修改]</span>:'),l=r[n].isExpress?"total-express-w":"",d+='<li class="'+l+'"><label>'+r[n].promotion+"</label><em>"+r[n].promotion_amount+"</em></li>";s.$payTotal.html(d),s.$toPay.html(e.last_order_amount.toFixed(2)),a("#biprice").val(100*e.use_yoho_coin),0===~~e.use_yoho_coin?a(".errbitip").text(""):a(".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 a.each(s.Data,function(t,n){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:a("#juansubmit"),$juantip:a(".errtip",".play-juan-pan"),$biok:a("#bisubmit"),$carriageGroup:a('input[name="carriagegroup"]'),$selectExpress:a(".express-list input"),$bp:a("#biprice"),$errorTip:a(".errbitip"),$useEnvelopes:a(".use-envelopes"),$hasEnvelopes:a(".has-envelopes span"),$useEnvelopesInput:a(".use-envelopes").find("input"),$redEnvelopes:a(".red-envelopes"),$loading:a(".loading")},init:function(){function e(e){var t,n=a('.play-juan.is-select input[name="juangroup"]:checked'),i=a('.express-list input[name="carriagegroup"]').val(),o=a("#biprice.is-select").val(),s=n.val(),r=a(".address-manage").attr("cart-type"),d=a(".use-envelopes input:checked").attr("data-use");s=s?s:n.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 n=e;n.keyup(function(){n.val().length>t&&n.val(n.val().substr(0,t))})}var n,i,r=this.e,d=s.UI,l=s.Common;r.$selectExpress.click(function(){var t=a(this).val();r.$loading.show(),e(function(e){e.deliveryWay=t,n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data),"1"===t?a(".express-list.sf").addClass("hide"):"2"===t&&a(".express-list.sf").removeClass("hide")):new o.Alert(e.message).show()}},a.ajax(n)})}),r.$juanok.click(function(){var t=a(this).parents("dl.pan"),i="";a(".play-juan").addClass("is-select"),e(function(e){var o=e.couponCode;o?(r.$loading.show(),n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(i=a('.play-juan input[value="'+o+'"]').next().text(),d.render(e.data,i),l.winHide(t),r.$juantip.html("")):(r.$juantip.html(e.message),a(".play-juan").removeClass("is-select"))}},a.ajax(n)):(r.$juantip.html("请选择或填写一个优惠券"),a(".play-juan").removeClass("is-select"))})}),a(document).on("click",".juan-modify",function(){var e=a(".play-juan-pan");l.winShow(e)}),r.$biok.click(function(){var t,i=a(this).parents("dl.pan");a("#biprice").addClass("is-select"),e(function(e){e.couponCode&&(t=a('.play-juan input[value="'+e.couponCode+'"]').next().text()),/^\d+$/.test(e.yohoCoin+"")&&1*e.yohoCoin!==0?1*e.yohoCoin>1*a(".play-pan em").text()?(a(".errbitip").html("您的YOHO币不足"),a("#biprice").removeClass("is-select")):(r.$loading.show(),n={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)):(a(".errbitip").html(e.message),a("#biprice").removeClass("is-select"))}},a.ajax(n)):(a(".errbitip").html("请输入一个正整数"),a("#biprice").removeClass("is-select"))})}),a(document).on("click",".bi-modify",function(){var e=a(".play-bi-pan");l.winShow(e)}),r.$bp.keyup(function(){var e=a(this).val();/^\d+$/.test(e+"")?1*e>1*a(this).data("bi")?r.$errorTip.html("您的YOHO币不足"):r.$errorTip.html("抵扣"+(e/100).toFixed(2)+"元"):r.$errorTip.html("请输入一个正整数")}),a(".cancel-bi").click(function(){var t,i=a(".play-bi-pan");a(".errbitip").html(""),a("#biprice").hasClass("is-select")?(r.$loading.show(),e(function(e){e.yohoCoin=0,e.couponCode&&(t=a('.play-juan input[value="'+e.couponCode+'"]').next().text()),n={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),a("#biprice").val("0"),a("#biprice").removeClass("is-select"),a(".errbitip").html("")):a(".errbitip").html(e.message)}},a.ajax(n)})):(l.winHide(i),a("#biprice").val("0"))}),a(".cancel-code").click(function(){var t=a(".play-juan-pan");a(".play-juan").hasClass("is-select")?(r.$loading.show(),e(function(e){e.couponCode="",n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){r.$loading.hide(),200===e.code?(d.render(e.data),l.winHide(t),a(".play-juan").removeClass("is-select"),a("#juancode").val("").siblings('input[name="juangroup"]').attr("checked","checked")):r.$juantip.html(e.message)}},a.ajax(n)})):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=a(this);r.$loading.show(),i.attr("disabled","disabled"),e(function(e){i.attr("checked")?e.redEnvelopes=i.data("use"):e.redEnvelopes=0,t=a('.play-juan input[value="'+e.couponCode+'"]').next().text(),n={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()}},a.ajax(n)})}),t(a("#piaodesc"),30),t(a("#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,n){function a(e,t,n){var a,i,o="",s="";for(a=0;a<t.length;a++)s="Y"===t[a].is_support_express?"*":"",o+=t[a].id===n?'<option selected value="'+t[a].id+'">'+s+t[a].caption+"</option>":'<option value="'+t[a].id+'">'+s+t[a].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 n,i=e.selectId;"getProvince"===e.type?n=f:"getCity"===e.type?n=m:"getCounty"===e.type&&(n=g),c.ajax({type:"GET",url:"/cart/index/getAreaList",dataType:"json",data:{id:1*e.id}}).then(function(e){a(n,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")),_.val(e.attr("data-addressDesc")),w.val(e.attr("data-mobile")),C.val(e.attr("data-email")),x.val(e.attr("data-zipcode")),j.val(e.attr("data-phoneCode")),S.val(e.attr("data-phoneNum"))}function r(){T.removeClass("active"),q.find('li:not(".active")').addClass("hide"),q.find("li.active").addClass("address_select"),p.addClass("hide"),k.addClass("hide").removeAttr("data-id"),q.removeClass("address-expand"),c(".address-list h2 span").text("[修改]")}function d(){var e,t,n,a=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,n=0;e>n;n++)i+='<li><input name="juangroup" type="radio" value="'+t[n].code+'" '+(t[n].valid?"":'disabled="disabled"')+"><label>"+t[n].desc+"</label></li>";a.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"]'),g=p.find('.text-input[name="county"]'),v=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"]'),_=p.find('.text-input[name="address"]'),x=p.find('.text-input[name="code"]'),k=c(".save-btn"),j=p.find('.text-input[name="tel-code"]'),S=p.find('.text-input[name="tel"]'),T=c(".use-new-address"),q=c(".exist-address-list"),E=c(".loading"),I=c("#order-edit-main"),A=p.attr("cart-type");E.show(),t.getUserAddressList=function(){var e,t,n="",a="",i="",o="",s=0;c.ajax({type:"GET",url:"/cart/index/getAddress",dataType:"json"}).then(function(r){if(E.hide(),200===r.code){if(e=r.data.list,!e)return I.attr("data-new")&&(k.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?(a="checked",i="active address_select",s++,o="默认地址"):(a="",i="hide",o="设为默认地址"),n+='<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" '+a+' /><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(n)),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 n=e||0,a=/[0-9]{2}/gi,o=!!t&&t.match(a);i({id:n,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>'))}),v.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 n=c(e.target),a=n.closest("li").attr("data-id"),i=n.closest("li").find(".radio").attr("data-areaCode");n.hasClass("address-modify")?(p.removeClass("hide"),t.newAddress(0,i),s(n.closest("li").find(".radio")),c(".address-list-inner .save-btn").removeClass("hide"),k.attr("data-id",a),h=!0):n.hasClass("address-del")?(E.show(),c.ajax({type:"POST",url:"/cart/index/delAddress",data:{id:a}}).then(function(e){E.hide(),200===e.code?n.closest("li").remove():new u.Alert(e.message).show()}).fail(function(){})):n.hasClass("default-address")&&!n.parents("li").hasClass("address_select")&&(E.show(),c.ajax({type:"post",url:"/cart/index/setDefaultAddress",data:{id:a}}).then(function(e){E.hide(),200===e.code?(c(".exist-address-list li").removeClass("address_select").find(".default-address").text("设为默认地址"),n.parents("li").addClass("address_select"),n.text("默认地址")):new u.Alert(e.message).show()}))})},t.saveAddress=function(){k.click(function(){function e(e){return e===y?e?e+"-":" ":e?e+" ":" "}var t,n,a,i=c(this),s=b.val(),d=f.val(),l=m.val(),h=g.val(),p=_.val(),v=w.val(),y=j.val(),T=S.val(),q=C.val(),E=x.val(),I=f.find('option[value="'+d+'"]').text().replace(/\*/,""),A=m.find('option[value="'+l+'"]').text().replace(/\*/,""),F=g.find('option[value="'+h+'"]').text().replace(/\*/,""),U={consignee:s,areaCode:h,address:p,email:q,mobile:v,zipCode:E,phoneCode:y,phoneNum:T},D=/^[\u4e00-\u9fa5]{2,5}$/,P=/^[\s\S]{2,100}$/,O=/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/,L=/^[0-9]{6}$/,N=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,$=/^[0-9]{3,5}$/,z=/^[0-9]{5,10}$/;if(a=c('.exist-address-list li:not(".use-new-address")').find('input[name="address"]:checked').length>0,c(".add-address").attr("checked")||!a||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(!D.test(s))return void new u.Alert("真实姓名至少2个中文,最多5个中文").show();if(!P.test(p))return void new u.Alert("你输入的地址格式不正确").show();if(!O.test(v))return void new u.Alert("你输入的联系电话格式不正确").show();if(y&&!$.test(y)||T&&!z.test(T)||$.test(y)&&!z.test(T)||!$.test(y)&&z.test(T))return void new u.Alert("你输入的电话格式不正确").show();if(q&&!N.test(q))return void new u.Alert("你输入的邮箱格式不正确").show();if(E&&!L.test(E))return void new u.Alert("你输入的邮编格式不正确").show();k.attr("data-id")&&(U.id=k.attr("data-id")),c.ajax({type:"post",url:"/cart/index/saveAddress",data:U}).then(function(a){var d;200===a.code?(d=a.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=U.id?'<li class="active" data-id="'+U.id+'" data-express="'+d.is_support+'"><input data-name="'+U.consignee+'" data-areaCode="'+U.areaCode+'" data-addressDesc="'+U.address+'" data-mobile="'+U.mobile+'" data-phoneNum="'+U.phoneNum+'" data-phoneCode="'+U.phoneCode+'" data-zipCode="'+U.zipCode+'" data-email="'+U.email+'" checked="checked" class="radio" type="radio" name="address" /><label><strong>'+s+"</strong><span>"+I+" "+A+" "+F+" "+p+" "+e(E)+o(v)+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="'+U.phoneNum+'" data-phoneCode="'+U.phoneCode+'" data-zipCode="'+d.zip_code+'" data-email="'+d.email+'" checked="checked" class="radio" type="radio" name="address" /><label><strong>'+s+"</strong><span>"+I+" "+A+" "+F+" "+p+" "+e(E)+o(v)+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")?(n=c('.exist-address-list li[data-id="'+i.attr("data-id")+'"]'),n.after(c(t)).remove()):c(".use-new-address").before(c(t)),c(".address-list span").removeAttr("expand"),r()):new u.Alert(a.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"),n=c(".pay-time-modify"),a=n.find('input[name="pay-type"]:checked').val(),i=n.find('input[name="pay-type"]:checked').next("label").text(),o=n.find('input[name="pay-time-radio"]:checked').next("label").text(),s=n.find('input[name="pay-time-radio"]:checked').val(),r=n.find('input[name="call-me"]:checked').next("label").text(),d=n.find('input[name="call-me"]:checked').val();E.show(),c.ajax({type:"POST",url:"/cart/index/orderCompute",dataType:"json",data:{cartType:A,paymentType:a}}).then(function(n){E.hide(),200===n.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='+a+"]").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(n.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"),n=c('.pay-time-modify input[name="pay-time-radio"]:checked').val(),a=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"),g=c('.play-juan.is-select input[name="juangroup"]:checked'),v=g.val(),y=v?v:g.closest("li").find("#juancode").val();E.show(),e.attr("disabled")||(e.attr("disabled","disabled"),c.ajax({type:"POST",dataType:"json",url:"/cart/index/orderSub",data:{addressId:t,cartType:A,deliveryTimeId:n,deliveryWayId:a,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){E.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,n){function a(){y?h('.mode div[id="'+y+'"]').addClass("choosed-tag").parent().addClass("choose-type"):(f.eq(0).addClass("choose-type").show(),f.eq(0).find("div").addClass("choosed-tag")),g.attr("value","前往"+h("#"+b).attr("alt")),m.attr("src",h("#"+b).attr("src"))}function i(e,t){h.ajax({type:"get",url:"/common/addpaymentinterval",dataType:"json",data:{orderCode:t,payment:e}})}var o,s,r,d,l,c,u,h=e("jquery"),p=h(".mode div"),f=h(".mode"),m=h("#show-pay-img"),g=h("#btnby"),v=h(".light-box"),y=h("#choosePay").val(),b=h('.mode div[id="'+y+'"]').parent().data("value"),w=y?b:h(".mode").eq(0).data("value"),C=h("#payUrl").val();h.jqtab=function(e,t){h(e+" li").click(function(){return s=h(this).find("a").attr("tab"),h(e+" li").removeClass("thistab"),h(this).addClass("thistab"),h(t).hide(),h("#"+s).fadeIn(),!1})},h.jqtab("#tabs",".tab-con"),a(),f.click(function(){return o=h(this).data(),r=o.id,w=o.value,d=h("#"+w).attr("alt"),l=h("#"+w).attr("src"),f.removeClass("choose-type"),h(this).addClass("choose-type"),p.removeClass("choosed-tag"),h("#"+r).addClass("choosed-tag"),g.attr("value","前往"+d),m.attr("src",l),!1}),h(".close").click(function(){v.hide()}),h(".change").click(function(){v.hide()}),h("#btnby").click(function(){u=h(".choose-type").attr("data-id"),c=h(".order-num").text(),i(u,c),window.open(C+"?order_code="+c+"&payment_type="+w),v.show()}),h(".pay-over").unbind("click").bind("click",function(){var e=this;h.post("/shopping/pay/sendPay",{orderCode:c,paymentId:u},function(){window.location.href=h(e).data("url")})})}),define("js/pay/wechatqrcode",["jquery"],function(e,t,n){function a(){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({render:"table",text:d.data("url")}),setInterval(a,3e3)}),define("plugin/jquery.qrcode",["jquery"],function(e,t,n){var a=e("jquery");!function(e){e.fn.qrcode=function(t){function n(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 n=0;n<e.length&&0==e[n];)n++;this.num=Array(e.length-n+t);for(var a=0;a<e.length-n;a++)this.num[a]=e[a+n]}function s(e,t){this.totalCount=e,this.dataCount=t}function r(){this.buffer=[],this.length=0}var d;n.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 n(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),n=new r,a=0,i=0;i<t.length;i++)a+=t[i].dataCount;for(i=0;i<this.dataList.length;i++)t=this.dataList[i],n.put(t.mode,4),n.put(t.getLength(),l.getLengthInBits(t.mode,e)),t.write(n);if(n.getLengthInBits()<=8*a)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 n=0;n<this.moduleCount;n++){this.modules[n]=Array(this.moduleCount);for(var a=0;a<this.moduleCount;a++)this.modules[n][a]=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 n=-1;7>=n;n++)if(!(-1>=e+n||this.moduleCount<=e+n))for(var a=-1;7>=a;a++)-1>=t+a||this.moduleCount<=t+a||(this.modules[e+n][t+a]=n>=0&&6>=n&&(0==a||6==a)||a>=0&&6>=a&&(0==n||6==n)||n>=2&&4>=n&&a>=2&&4>=a?!0:!1)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;8>n;n++){this.makeImpl(!0,n);var a=l.getLostPoint(this);(0==n||e>a)&&(e=a,t=n)}return t},createMovieClip:function(e,t,n){for(e=e.createEmptyMovieClip(t,n),this.make(),t=0;t<this.modules.length;t++)for(var n=1*t,a=0;a<this.modules[t].length;a++){var i=1*a;this.modules[t][a]&&(e.beginFill(0,100),e.moveTo(i,n),e.lineTo(i+1,n),e.lineTo(i+1,n+1),e.lineTo(i,n+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 n=0;n<e.length;n++){var a=e[t],i=e[n];if(null==this.modules[a][i])for(var o=-2;2>=o;o++)for(var s=-2;2>=s;s++)this.modules[a+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),n=0;18>n;n++){var a=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=a}for(n=0;18>n;n++)a=!e&&1==(t>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=a},setupTypeInfo:function(e,t){for(var n=l.getBCHTypeInfo(this.errorCorrectLevel<<3|t),a=0;15>a;a++){var i=!e&&1==(n>>a&1);6>a?this.modules[a][8]=i:8>a?this.modules[a+1][8]=i:this.modules[this.moduleCount-15+a][8]=i}for(a=0;15>a;a++)i=!e&&1==(n>>a&1),8>a?this.modules[8][this.moduleCount-a-1]=i:9>a?this.modules[8][15-a-1+1]=i:this.modules[8][15-a-1]=i;this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,a=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[a][s-r]){var d=!1;o<e.length&&(d=1==(e[o]>>>i&1)),l.getMask(t,a,s-r)&&(d=!d),this.modules[a][s-r]=d,i--,-1==i&&(o++,i=7)}if(a+=n,0>a||this.moduleCount<=a){a-=n,n=-n;break}}}},i.PAD0=236,i.PAD1=17,i.createData=function(e,t,n){for(var t=s.getRSBlocks(e,t),a=new r,o=0;o<n.length;o++){var d=n[o];a.put(d.mode,4),a.put(d.getLength(),l.getLengthInBits(d.mode,e)),d.write(a)}for(o=e=0;o<t.length;o++)e+=t[o].dataCount;if(a.getLengthInBits()>8*e)throw Error("code length overflow. ("+a.getLengthInBits()+">"+8*e+")");for(a.getLengthInBits()+4<=8*e&&a.put(0,4);0!=a.getLengthInBits()%8;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*e)&&(a.put(i.PAD0,8),!(a.getLengthInBits()>=8*e));)a.put(i.PAD1,8);return i.createBytes(a,t)},i.createBytes=function(e,t){for(var n=0,a=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,a=Math.max(a,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+n];for(n+=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(n=Array(d),h=c=0;a>h;h++)for(d=0;d<t.length;d++)h<s[d].length&&(n[c++]=s[d][h]);for(h=0;i>h;h++)for(d=0;d<t.length;d++)h<r[d].length&&(n[c++]=r[d][h]);return n},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,n){switch(e){case 0:return 0==(t+n)%2;case 1:return 0==t%2;case 2:return 0==n%3;case 3:return 0==(t+n)%3;case 4:return 0==(Math.floor(t/2)+Math.floor(n/3))%2;case 5:return 0==t*n%2+t*n%3;case 6:return 0==(t*n%2+t*n%3)%2;case 7:return 0==(t*n%3+(t+n)%2)%2;default:throw Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new o([1],0),n=0;e>n;n++)t=t.multiply(new o([1,c.gexp(n)],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(),n=0,a=0;t>a;a++)for(var i=0;t>i;i++){for(var o=0,s=e.isDark(a,i),r=-1;1>=r;r++)if(!(0>a+r||a+r>=t))for(var d=-1;1>=d;d++)0>i+d||i+d>=t||0==r&&0==d||s==e.isDark(a+r,i+d)&&o++;o>5&&(n+=3+o-5)}for(a=0;t-1>a;a++)for(i=0;t-1>i;i++)o=0,e.isDark(a,i)&&o++,e.isDark(a+1,i)&&o++,e.isDark(a,i+1)&&o++,e.isDark(a+1,i+1)&&o++,(0==o||4==o)&&(n+=3);for(a=0;t>a;a++)for(i=0;t-6>i;i++)e.isDark(a,i)&&!e.isDark(a,i+1)&&e.isDark(a,i+2)&&e.isDark(a,i+3)&&e.isDark(a,i+4)&&!e.isDark(a,i+5)&&e.isDark(a,i+6)&&(n+=40);for(i=0;t>i;i++)for(a=0;t-6>a;a++)e.isDark(a,i)&&!e.isDark(a+1,i)&&e.isDark(a+2,i)&&e.isDark(a+3,i)&&e.isDark(a+4,i)&&!e.isDark(a+5,i)&&e.isDark(a+6,i)&&(n+=40);for(i=o=0;t>i;i++)for(a=0;t>a;a++)e.isDark(a,i)&&o++;return e=Math.abs(100*o/t/t-50)/5,n+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),n=0;n<this.getLength();n++)for(var a=0;a<e.getLength();a++)t[n+a]^=c.gexp(c.glog(this.get(n))+c.glog(e.get(a)));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)),n=Array(this.getLength()),a=0;a<this.getLength();a++)n[a]=this.get(a);for(a=0;a<e.getLength();a++)n[a]^=c.gexp(c.glog(e.get(a))+t);return new o(n,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 n=s.getRsBlockTable(e,t);if(void 0==n)throw Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var a=n.length/3,i=[],o=0;a>o;o++)for(var r=n[3*o+0],d=n[3*o+1],l=n[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 n=0;t>n;n++)this.putBit(1==(e>>>t-n-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 n;if("canvas"==t.render){n=new i(t.typeNumber,t.correctLevel),n.addData(t.text),n.make();var o=document.createElement("canvas");o.width=t.width,o.height=t.height;for(var s=o.getContext("2d"),r=t.width/n.getModuleCount(),d=t.height/n.getModuleCount(),l=0;l<n.getModuleCount();l++)for(var c=0;c<n.getModuleCount();c++){s.fillStyle=n.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(n=new i(t.typeNumber,t.correctLevel),n.addData(t.text),n.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/n.getModuleCount(),r=t.height/n.getModuleCount(),d=0;d<n.getModuleCount();d++)for(l=e("<tr></tr>").css("height",r+"px").appendTo(o),c=0;c<n.getModuleCount();c++)e("<td></td>").css("width",s+"px").css("background-color",n.isDark(d,c)?t.foreground:t.background).appendTo(l);n=o,a(n).appendTo(this)})}}(a)}),define("js/about/entry",["jquery","jquery.placeholder","handlebars","source-map"],function(e,t,n){e("js/about/settled")}),define("js/about/settled",["jquery","jquery.placeholder","handlebars","source-map"],function(e,t,n){var a=e("jquery"),i=e("js/passport/mail-phone-regx");e("jquery.placeholder"),e("plugin/jquery.qupload"),function(){function e(){var e=a(window).height();n.removeClass("hide"),i.css({"max-height":e-60}).removeClass("hide")}function t(){n.addClass("hide"),i.addClass("hide")}var n,i;0!==a(".settled-page").length&&(n=a("#mask"),i=a("#notice-container"),a("#fake-link").click(e),a("#fake-close").click(t),a("#mask").click(t))}(),function(){function t(e){a.each(e,function(e,t){a("#"+t.dom).qupload({uploadKey:w,button_image_url:"",button_text:'<span class="btn_upload_text">上传</span>',button_text_style:".btn_upload_text{color:#000;margin-left:30px;line-height: 2em;font-size:14px;}",button_text_left_padding:32,button_text_top_padding:8,button_width:160,button_height:35,button_action:x.BUTTON_ACTION.SELECT_FILE,file_size_limit:"10240",file_types:t.type,uploadSuccessed:function(e){var n=JSON.parse(e);return 12!==n.code?(alert(n.message),!1):void t.callback(n.data.hit.Filedata.return_file_path)}})})}function n(){var e=!0,t=/[0-9]\d{5}(?!\d)/,n=i.emailRegx,o=i.phoneRegx["+86"],s=/^(0|[1-9][0-9]*)$/;return a(".va, .category-item select, .for-other, .category-item").removeClass("error"),a(".va-null").each(function(){""===a(this).val()&&(a(this).addClass("error"),e=!1)}),""!==f.val()&&t.test(f.val())||(f.addClass("error"),e=!1),""!==m.val()&&n.test(m.val())||(m.addClass("error"),e=!1),""!==g.val()&&o.test(g.val())||(g.addClass("error"),e=!1),""!==y.val()&&s.test(y.val())||(y.addClass("error"),e=!1),a(".category-item").each(function(){0===a(this).get(0).selectedIndex&&(a(this).addClass("error"),e=!1)}),3===a('input[name="seller-role"]:checked').index()&&""===r.val()&&(e=!1,r.addClass("error")),5===a('input[name="new_cycle"]:checked').index()&&""===d.val()&&(e=!1,d.addClass("error")),5===a('input[name="supply_cycle"]:checked').index()&&""===l.val()&&(e=!1,l.addClass("error")),e}function o(){c.closest("tr").removeClass("hide"),c.append("<li>"+C+"</li>")}function s(){var e=a(this).val(),t=a(this).parent().find(".category-two"),n="<option>选择二级分类</option>";return""===e?void t.html(n):void a.ajax({url:"/shop/settled/getTwoCategory",type:"GET",data:{id:e}}).then(function(e){var a,i=[];if(200===e.code)for(i=e.data,a=0;a<i.length;a++)n+='<option value="'+i[a].id+'" >'+i[a].name+"</option>";t.html(n)})}var r,d,l,c,u,h,p,f,m,g,v,y,b,w,C=a("#category-tpl").html(),_=e("js/common/dialog").Dialog,x=window.SWFUpload;if(!(a(".settled-apply-page").length<0)){if(a("[placeholder]").placeholder(),r=a("#other-brand-relation"),d=a("#other-new-period"),l=a("#other-replenishment-period"),c=a("#category-list"),u=a("#shop-list"),h=a("#shops"),p=a("#mask, #submit-success"),f=a("#postcode"),m=a("#email"),g=a("#phone-number"),v=a("#upload-key"),y=a("#style-count"),w=v.val(),v.remove(),t([{dom:"upload-brand-material",type:"*.ppt;*.pdf;*.zip;*.rar",callback:function(e){a("#brand-material").val(e),a(".brand-tip").html("上传成功"),alert("上传成功!")}},{dom:"upload-goods-material",type:"*.xls;*.xlsx;*.zip;*.rar",callback:function(e){a("#goods-material").val(e),a(".goods-tip").html("上传成功"),alert("上传成功!")}}]),location.search.indexOf("state=1")>-1)return b=new _({className:"settled-success",closeIcon:!1,content:'<h1 class="main-title">恭喜您已提交成功</h1><h2 class="sub-title">我们将尽快与您联系</h2>',btns:[{id:"apply-success-ok",btnClass:["apply-success-ok"],name:"确认",cb:function(){location.href="/shop/settled/index"}}]}),void b.show();a('input[name="seller_role"]').change(function(){3===a(this).index()?r.removeClass("hide"):r.addClass("hide")}),a('input[name="new-cycle"]').change(function(){5===a(this).index()?d.removeClass("hide"):d.addClass("hide")}),a('input[name="supply-cycle"]').change(function(){5===a(this).index()?l.removeClass("hide"):l.addClass("hide")}),a('input[name="have-store"]').change(function(){1===a(this).index()?u.addClass("hide"):u.removeClass("hide")}),a(".form-container").on("change",".category-one",s),a("#category-add").click(o),h.delegate(".shop-add","click",function(){h.append('<li><input class="shop-addres" name="store-address[]" type="text" placeholder="输入店铺地址"><span>月均销售:</span><input class="shop-sales-volume" type="text" name="store-sales-volume[]" placeholder="输入价格"><span>元</span></li>')}),a("#apply-post").click(function(){var e;n()?(p.removeClass("hide"),a("form").submit()):(a(".error").first().focus(),e=a(".error").first().offset().top,a(window).scrollTop(e-10))}),navigator.userAgent.indexOf("MSIE")>=0&&a("[placeholder]").focus(function(){var e=a(this);e.removeClass("placeholder")}).blur(function(){var e=a(this);""===e.val()&&e.addClass("placeholder")})}}()}),define("js/coupon/entry",["jquery","lazyload","handlebars","source-map"],function(e,t,n){e("js/coupon/coupon")}),define("js/coupon/coupon",["jquery","lazyload","handlebars","source-map"],function(e,t,n){function a(e){var t=new l(e);t.show()}function i(t){r.ajax({type:"GET",url:"/coupon/sendcoupon",data:{id:t},success:function(e){var t=e.code;e.url&&e.url.length>0&&c[t]&&c[t](e.url+"?"+location.href.split("?")[1]),s[t]?s[t]():s[400]()},error:function(t){var n=e("js/common/dialog").Alert;new n("网络异常").show()}})}var o,s,r=e("jquery"),d=e("lazyload"),l=e("js/common/dialog").Dialog,c={gunangSrc:null,checkCouponSrc:null,goToGuang:function(){window.location.href=this.gunangSrc},goToCheck:function(){window.location.href=this.checkCouponSrc},403:function(e){window.location.href=e},200:function(e){this.checkCouponSrc=e}};d(r("img.lazy")),e("js/common/slider"),r(".slide-container").slider(),o={success:{content:"恭喜您,成功领取优惠券",subContents:["特殊情况下到账有延时","请耐心等待"],className:"subcontent-dialog",btns:[{id:1,name:"去购物啦",btnClass:["black","btn-close"],cb:function(){c.goToGuang()}},{id:2,name:"查看优惠券",btnClass:["btn-close"],cb:function(){c.goToCheck()}}]},alreadyGot:{content:"您已领取过优惠券",subContent:"快去选购心仪的潮品吧",className:"subcontent-dialog",btns:[{id:1,name:"去使用",btnClass:["btn-close"],cb:function(){c.goToGuang()}}]},expired:{content:"优惠券已过期",subContent:"去领最新的优惠券吧",className:"subcontent-dialog",btns:[{id:1,name:"关闭",btnClass:["btn-close"]}]},failed:{content:"领取失败",subContents:["请刷新重试,","多次无效请联系客服"],className:"subcontent-dialog",btns:[{id:1,name:"刷新",btnClass:["btn-close"],cb:function(){window.location.reload()}}]}},s={200:function(){a(o.success)},401:function(){a(o.alreadyGot)},315:function(){a(o.expired)},400:function(){a(o.failed)},403:function(){}},r(".enable .info").on("click",function(e){e.preventDefault(),i(r(this).closest("a").data("id")),c.gunangSrc=r(this).closest("a").get(0).href})});