index.js
251 KB
define("index",["jquery","handlebars","source-map","index","lazyload","jquery-pjax","dot","jquery.placeholder"],function(e,t,n){var i;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=i}),define("js/common",["jquery"],function(e,t,n){function i(e){var t=new RegExp(e+"=([^;$]*)","i"),n="$1";return t.test(decodeURIComponent(document.cookie))?RegExp[n]:""}function a(e,t,n){var i,a,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()),i=n.path?"; path="+n.path:"",a=n.domain?"; domain="+n.domain:"",o=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,i,a,o].join(""))}function o(){var e,t=i("_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=i("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function d(){var e,t,n={},i=window.location.search,a=i?decodeURIComponent(i).slice(1).split("&"):[];for(t=0;t<a.length;t++)e=a[t].split("="),n[e[0]]=e[1];return n}var l=e("jquery"),c=l("body");e("js/footer"),function(e,t,n,i,a){var o=t.createElement(n),s=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=a,e[a]=function(){e[a].p=arguments},o.async=1,o.src=i,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"),l.extend({queryString:function(){var e,t,n=[],i=window.location.search.slice(1).split("&");for(t=0;t<i.length;t++)e=i[t].split("="),n.push(e[0]),n[e[0]]=e[1];return n}}),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=i,window.setCookie=a,window.getUser=o,window.getUid=s,window.getShoppingKey=r,window.queryString=d}),define("js/footer",["jquery"],function(e,t,n){function i(){var e=s("#subscriber-box"),t=s("#subscriber-btn"),n=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,i={mail:"",tick:""};e.focus(function(){s(this).val("").css("color",""),t.removeClass("done").html(i.mail)}),t.click(function(){var a=s.trim(e.val());if(""!==a&&n.test(a))try{s.ajax({url:"http://www.yohobuy.com/common/emailSubscriber",dataType:"jsonp",data:{email:a,tmp:Math.random(),uid:window.getUid()},success:function(n){1===n.data.result?(e.val("已订阅到:"+a),t.addClass("done").html(i.tick)):e.css("color","red")}})}catch(o){console.log(o.message)}else e.css("color","red")})}function a(){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 i=s(this),a=i.closest("li"),o=a.index(),r=[],d=a.find(".feedback-answer").val(),l=a.find(".feedback-id").val(),c=a.find(".question-id").val();a.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(i){var s=o+1;if(1===~~i.data.result){if(o===n-1)return void alert("感谢您的参与!");a.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),i(),a(),window.rePosReturnTop=o}),define("js/header",["jquery","handlebars","source-map","index"],function(e,t,n){function i(e,t,n){try{ee.push({louceng:e,weizhi:t,event:n})}catch(i){}}function a(){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="",i=0,a=0,o=0,s=0,r="";H.fn.miniCart=function(i){if(t=H.extend(e,i),"undefined"==typeof window.cookie(t.cookie))n=null;else if(t.cookie)try{n=Y.parse(window.cookie(t.cookie))}catch(a){}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),i=H(".search-list").children("li").length,a=-1,i>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("+a+")").children("a").css("background-color","#eee"),r=H(".search-list li:eq("+a+")").children("a").attr("title"),H("#query_key").val(r)}return this.each(function(){H(this).keyup(function(e){if(38===e.which){if(0===i)return!1;-1===a&&(a=0),o=a,a=(a-1+i)%i,n(this)}else if(40===e.which){if(0===i)return!1;o=a,a=(a+1)%i,n(this)}else 13===e.which?window.submitSearch():t(this)})})},H.extend({getData:function(e,t,n){var i={page:1,method:"",v:1,return_type:"jsonp",open_key:"12345",tmp:Math.random()},a="";if(void 0===typeof e||""===e)return!1;a=H.extend(i,t),a.page=a.page||1;try{H.getJSON(e+"/?callback=?",a,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;"> </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=le+e+"&client_type=web&callback=JsonPCallBack",document.getElementsByTagName("head")[0].appendChild(t)}function d(e,t){var n,i;H(e).hover(function(e){e.preventDefault(),n=H(this),i=H(t)[0],""===i.style.display?(n.addClass("acttags"),i.style.display="block"):(n.removeClass("acttags"),i.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]}function h(){var e=["webkit","moz","ms"],t=e[0]+"RequestAnimationFrame",n=e[1]+"RequestAnimationFrame",i=e[2]+"RequestAnimationFrame";return window[t]?function(e){requestAnimationFrame(e)}:window[n]?function(e){window[n](e)}:window[i]?function(e){window[i](e)}:function(e){window.setTimeout(e,67)}}function p(){ne+=10,ie.css({transform:"rotateX("+ne+"deg)","-webkit-transform":"rotateX("+ne+"deg)","-moz-transform":"rotateX("+ne+"deg)"}),ne/90%2===1&&(ae?(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo1.png)"),ae=!1):(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ae=!0)),ne/90%2===0&&ne%360!==0?window.setTimeout(p,3e3):ne%360===0?window.setTimeout(p,6e4):te(function(){p()})}function f(){M&&window.clearTimeout(M),ie.fadeOut(oe,function(){ae=!1,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo.png)"),ie.fadeIn(oe,function(){W=window.setTimeout(function(){ie.fadeOut(oe,function(){window.clearTimeout(W),ae=!0,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ie.fadeIn(oe,function(){M=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"),i="hot"===t.attr("hot"),a={};a=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:i},window.valueIndex++,window.newArr.push(a)})}function v(){var e=window.newArr.length,t=0,n=[],i=[],a=[],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++)i=window.targetArr1[l]||{},"title"===i.type?window.inner1=window.inner1+'<li class="cattitle"><h3><a href="'+i.href+'">'+i.content+"</a></h3></li>":i.hot===!0?window.inner1=window.inner1+'<li class="catdetail"><a class="thirdcatelink hot" href="'+i.href+'">'+i.content+"</a></li>":window.inner1=window.inner1+'<li class="catdetail"><a class="thirdcatelink" href="'+i.href+'">'+i.content+"</a></li>";for(c;c<window.targetArr2.length;c++)a=window.targetArr2[c]||{},"title"===a.type?window.inner2=window.inner2+'<li class="cattitle"><h3><a href="'+a.href+'">'+a.content+"</a></h3></li>":a.hot===!0?window.inner2=window.inner2+'<li class="catdetail"><a class="thirdcatelink hot" href="'+a.href+'">'+a.content+"</a></li>":window.inner2=window.inner2+'<li class="catdetail"><a class="thirdcatelink" href="'+a.href+'">'+a.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="",i="",a="",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"),i=H(this).find(".showdetail").find(".title"),a=H(this).find(".showdetail").find("a"),H.get(le+t+"&width=337&height=250&client_type=web",function(e){n.attr("src",e.data.src),a.attr("href",e.data.url),i.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="",a="",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),a=H(window).height(),o=H(".guide-box").height(),e=a/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){i("弹窗","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){i("弹窗","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){i("弹窗","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}),i("弹窗","LIEFSTYLE","homepage_lifestyle")}),H("#cover .guide-box").bind("click",function(e){e.stopPropagation()})})}function a(){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,i=document.cookie,a=i.split(";");for(e=0;e<a.length;e++)t=a[e].split("="),"undefined"!=typeof t[0]&&(n=t[0].replace(/\s/g,""),de[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(i){""===V&&(V=G.compile(H("#mini-cart-tpl").html())),H("#miniCartBox").children(".gobuy-wrapper").html(V({carData:i})),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),i='{"_k":"'+n._k+'","_nac":'+e.total_goods_num+',"_ac":0,"_r":0}';window.setCookie("_g",i,{path:"/",domain:".yohobuy.com"}),S(),j()})}function q(){var e,t,n,i;H(document).on("click",".goodscardelete",function(a){e=H(this),t=e.attr("product_sku"),n=e.attr("promotion_id"),i=e.prev("h3").find(".num").html(),T(t,n,i)})}function I(){var e;H(document).on("click",".mycart_i_down",function(t){e=H(this),e.toggleClass("mycart_i_up"),H("#mycartmore").slideToggle(300)})}function E(){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",i="indexboys",a="indexgirls",o="uniquebrand",s=window.location.href,d=window.location.host,l="";-1!==s.indexOf("search")&&(l=re["search"+de._Channel]),-1!==s.indexOf("list")&&(l=re["list"+de._Channel]),-1!==s.indexOf("brands")&&(l=re["brands"+de._Channel]),-1!==s.indexOf("new")&&(l=re["new"+de._Channel]),-1!==s.indexOf("sale")&&(l=re["sale"+de._Channel]),-1!==s.indexOf("home")&&(l=re["home"+de._Channel]),-1!==s.indexOf("kids")&&(l=re[t]),-1===s.indexOf("woman")&&-1===s.indexOf("girls")||(l=re[a]),-1!==s.indexOf("lifestyle")&&(l=re[n]),-1!==s.indexOf("www.yohobuy.com")&&"/"===window.location.pathname&&(l=re[i]),e=d.split(".")[0],"list"!==e&&"search"!==e&&"www"!==e&&"new"!==e&&"item"!==e&&"guang"!==e&&(l=re[o+de._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 N(){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 L(){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>] [<a href="http://www.yohobuy.com/reg.html" class="list-a login-out" onclick="">免费注册</a>]',i='<span>Hi~<a href="http://www.yohobuy.com/home?t='+t+'">{{user_name}}</a></span> {{#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>] [<a href="http://www.yohobuy.com/reg.html" onclick="" class="list-a login-out">免费注册</a>]{{/unless}}',a=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(a.html("").show(),X=G.compile(i),"undefined"==typeof o||null===o)return a.html(n),!1;if("undefined"==typeof c||c.length<4)return a.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,a.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){e&&-1!==e.result?($(e),z(e)):(window.setCookie("_UID","",{path:"/",domain:".yohobuy.com",expires:-1}),se.show())})}function R(){y(),b(),N(),C(),_(),x(),k(),o(),c(),l(),m(),U(),P(),F(),j(),O(),L(),E(),q(),I(),B(),a()}var M,W,H=e("jquery"),G=e("handlebars"),Y=e("index"),Q=null,X=null,V="",Z=/^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/]{0,}$/g,J="",K="",ee=[],te=null,ne=0,ie=H(".icon-logo"),ae=!0,oe=500,se=H("#loginBox"),re={listboys:"4f78b0f418fc42314d8b6e791cfb7fa8",listgirls:"00c1f025a51b6b597dc37925951ea27d",listkids:"b02df11184727701ade1b6de9737d08c",listlifestyle:"fd35c52dced0c880976ba858346d1fc5",searchboys:"9fb8986ea700cc27a8057361c3924394",searchgirls:"e3e207a1443ca60c8037fe52a5560c18",searchkids:"620fc77f479da8feaeb06f2324e5d0bb",searchlifestyle:"a3c93301c6ffaf3ed0f36a4a451be36d",uniquebrandboys:"2ebb0810c0d1a67e5229149c9c3aba7d",uniquebrandgirls:"99e23385f4ba4b65f406b7e2968ac821",uniquebrandkids:"a74ebc9b17840c91b9ea46568111fe6b",uniquebrandlifestyle:"0e8c81ead53f56302baa4d0ad967f527",brandsboys:"77b352db07129c76a9d532acad149f9f",brandsgirls:"bf047f16e52ebc38be5ce9c7623831e6",brandskids:"e3ae1ce9b5e13c6d271ef3eccb831652",brandslifestyle:"e4ac8029c30f65d7f1af030980d140fe",newboys:"869d3c5f3b450fb52101d00a61ce87cb",newgirls:"d953b6dfdac02483d1dcce8d96055954",newkids:"0874cb6d75df8e0e78f2d475e53ecc08",newlifestyle:"43e8fc8e178115c262bbce2bd0012db7",saleboys:"c846e3165c994769b4201d8c32f3ae9b",salegirls:"52b1d389edcbc62d65de71b80c4d6ad0",salekids:"ad8b1703c761ba00973868ab5199cc27",salelifestyle:"7acc64905c70ac91846f43fb2cec4bbd",homeboys:"b0856a771ef1b59ab1234c74688fa42d",homegirls:"2bd61fa12e4933211518f70fe5ce3c48",homekids:"895c59e8c64b40399c9533509507320c",homelifestyle:"2e037d4e25d2767352ca3e0a4627f7bd",indexboys:"0c911d3000f52e8ca7cffb74f5864c29",indexgirls:"b645b8980c423ab30485e0a9d08c2ef7",indexkids:"17f6d5d5d454d2c507bc5fcbc90f7756",indexlifestyle:"735cd393e841762af8793c346abbbc36"},de={},le="http://new.yohobuy.com/common/getbanner?content_code=";H("#api-domain").remove(),window.submitSearch=function(){var e,t,n=H("#query_key").val(),a=H("#defaultsearch").val(),o="Search",s="Head Search",r="Search";if(e=H.trim(J.toLowerCase()),t=H.trim(n.toLowerCase()),i(o,s,r),""!==K&&""!==J&&e===t)location.href=K.replace("'","");else{if(!Z.test(n)||""===n)return""===n&&H("#query_key").val(a),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 i(e){var t,n,i,a=0,o=0;for(i=0;i<e.length;i++)n=e.substr(i,1),o+=/.*[\u4e00-\u9fa5]+.*$/.test(n)?2:1;if(10>=o)t=e;else{for(a=0,t="",i=0;i<e.length;i++)10>a&&(n=e.substr(i,1),"*"!==n&&(a+=/.*[\u4e00-\u9fa5]+.*$/.test(n)?2:1),t+=n);t.length<e.length&&(t+="...")}return t}function a(e){var t,n,a=e.data;-1!==e.result?(n=i(a.profile_name),t='<span>Hi~</span><a href="http://www.yohobuy.com/home?t='+a.random+'">'+n+'</a> <a href="http://www.yohobuy.com/logout.html">[退出]</a>'):t='<span>Hi~</span> <a href="http://www.yohobuy.com/signin.html">[请登录]</a> <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&&a(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","jquery-pjax"],function(e,t,n){e("js/product/list"),e("js/product/brand"),e("js/product/hotrank"),e("js/product/item"),e("js/product/shop-index")}),define("js/product/list",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var i=e("jquery");e("js/product/filter"),e("js/product/sort-pager"),e("js/product/latest-walk"),e("js/product/product"),function(){var e,t=i(".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 i(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 a(){w.addClass("hide"),_.removeClass("hide")}function o(){_.addClass("hide"),w.removeClass("hide"),S.children("span").removeClass("hover")}function s(e,t){var n,i=window.queryString();i[e]=t,delete i.page,n="?"+decodeURIComponent(g.param(i)),window.location.href=n}function r(e){E.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:"",checked:""},b={up:"",down:""},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+$/,I=g(".sort-sub-wrap"),E=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"),I.children(":eq("+t+")").addClass("hide"),void D.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),I.children(":not(.hide)").addClass("hide"),I.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"),a(),_.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")):(a(),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"),i(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,i=g.trim(g(this).val()),a=q.test(i);a||(e=parseInt(i,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"),E.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 i=e("jquery"),a=i("#count-per-page"),o=a.next("ul"),s=200;i(document).click(function(e){i(e.target).closest(".page-count").length>0||o&&o.slideUp(s)}),a.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 i=e("jquery"),a=e("handlebars"),o=e("lazyload"),s=i("#latest-walk-count");!function(){var e;0!==s.length&&(e=a.compile(i("#latest-walk-tpl").html()),i.ajax({url:"http://www.yohobuy.com/common/recentReview",dataType:"jsonp",data:{limit:s.val()},success:function(t){var n,a,s,r=[];if(200===t.code){if(n=t.data,0===n.length)return void i(".latest-walk").addClass("hide");for(a=0;a<n.length;a++)s=n[a],r.push({href:s.url,img:s.pic_url,name:s.product_name,salePrice:s.price,marketPrice:s.market_price});r.length>0&&(i("#latest-walk-goods").html(e({latestWalk:r})),o(i("#latest-walk-goods .lazy")))}}}))}()}),define("js/product/product",["jquery","lazyload","handlebars","source-map"],function(e,t,n){var i,a=e("jquery"),o=e("lazyload"),s=e("handlebars"),r=e("js/common/product-event"),d=a(".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=a(".product-list-nav");o(a("img.lazy")),t.init=function(e){function t(e,t){var n,i,a,o="",s=e.length,r=4,d=Math.ceil(s/r),l=0;for(n=0;d>n;n++)for(o+="<ul>",i=0;r>i&&(a=n*r+i,a!==s);i++)o+='<li><a target="_blank" href="'+e[n*r+i].url+t+'"><img src="'+e[n*r+i].src+'" data-cover="'+e[n*r+i].coverImg+'" /></a></li>',i===r-1&&(o+="</ul>",l++);return d>l&&(o+="</ul>"),{colorListStr:o,ulNum:d}}function n(){u.html(""),h.html(""),c.css({display:"none"})}var o=a(".shop-entry"),s=a(".shop-entry-area"),p=o.length;p>1?(3===p?o.css({width:"32%"}):p%2&&a(".shop-entry:gt("+(p-4)+")").css({width:"32%"}),a(".shop-entry:nth-child(2n+1)").css({marginLeft:0}),o.last().css({marginLeft:"2%"}),p%2===0?o.find(".name").css({width:"50%"}):p%3===0&&o.find(".name").css({width:"26%"})):o.css({width:"100%"}),s.slideDown(),i=null,l.unbind(),i=r(l,e),i.addHandler("MouseEnter",function(e){var i,o,s,r,l,p,f,m,g=10,v=35,y="",b=e.target.attr("data-from")||"";a.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,i=_.ulNum,u.append(e.targetDuplicate),h.append(a(y)),p=c.css("paddingLeft"),f=c.css("paddingTop"),m=d.css("paddingTop"),o=10+65*i+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*i+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)})}),i.addHandler("MouseLeave",function(){n()}),c.mouseleave(function(){n()})},a(document).on("hover",".good-select-color li",function(){var e=a(this).find("img").attr("data-cover"),t=a(this).closest(".good-item-wrapper").find(".good-detail-img").find("img");t.attr("src",e)}),p.find("h3").click(function(e){var t=a(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=a("#brand-card"),n=a("#brand-favor");t.length&&a.ajax({type:"POST",url:"/product/index/getNodeContent",data:{node:t.data("node")}}).then(function(e){t.html(e)}),n.length&&(e=a("#pic-link-tpl").html(),a.ajax({type:"POST",url:"/product/index/getAdnav",data:{brandId:n.data("id")}}).then(function(t){t&&a("#brand-ad").html(s.compile(e)({picLink:t}))}))}()}),define("js/common/product-event",["jquery"],function(e,t,n){function i(){this.handlers={}}var a=e("jquery");i.prototype={constructor:i,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,i;if(this.handlers[e]instanceof Array){for(n=this.handlers[e],i=0;i<n.length&&n[i]!==t;i++);n.splice(i,1)}}},n.exports=function(e,t){function n(e){var n,i=0,u=0,h=t,p=0,f="",m=0,g=0;switch(e.type){case"mouseenter":n=a(this),o=setTimeout(function(){s=!0,f=n.clone(),p=n.index()+1,i=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:i,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 i,d=e.eq(0).width(),l=e.eq(0).height(),c=a(window).width();return e.bind({mouseenter:n,mouseleave:n}),r}}),define("js/product/brand",["jquery"],function(e,t,n){var i=e("jquery"),a=i("#brand-favor"),o=i("#shop-favor"),s=o.data("id"),r=a.data("id"),d=o.find("i").hasClass("coled");a.on("click",function(){i.ajax({type:"post",url:"/product/index/favoriteBrand",data:{brandId:r}}).then(function(e){200===e.code?a.find("i").toggleClass("coled"):403===e.code&&(location.href="//www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})}),o.on("click",function(){i.ajax({type:"post",url:"/product/index/favoriteShop",data:{isFavorite:d?0:1,shopId:s}}).then(function(e){200===e.code?o.find("i").toggleClass("coled"):403===e.code&&(location.href="//www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})}),i.ajax({type:"POST",url:"/product/index/isFavoriteBrand",data:{brandId:r}}).then(function(e){200===e.code?a.find("i").addClass("coled"):404===e.code&&a.find("i").removeClass("coled")})}),define("js/product/hotrank",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var i=e("jquery"),a=e("handlebars"),o=e("lazyload");e("js/common/slider"),e("js/common/logo-brand"),o(i("img.lazy")),i(".slide-container").slider(),i(".logo-brand").logoBrand({showNum:10,url:i(".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=a.compile(i),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,i,s,r=e(".hot-week").find(".floatlayer"),d=(e(".hot-cate").find("li").eq(0).data("sid"),1),l=0,c=!1;i='{{# 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 i,a=n+e(".hot-week").outerHeight();n=e(".hot-week").offset().top,e(this).scrollTop()>=n-e(window).height()/2?r.offset().top+r.outerHeight()>=a?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||(i=e(".hot-cate").find("li.current").data("sid"),d++,c=!0,t(i,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 i=e(this).index(),a=e(this).data("sid");e(this).hasClass("current")||(e(this).addClass("current").siblings().removeClass("current"),e(".floatlayer").find("li").removeClass("current").eq(i).addClass("current"),e("body,html").stop().animate({scrollTop:n-110},500),t(a),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")}(i)}),define("js/common/slider",["jquery","lazyload"],function(e,t,n){var i=e("jquery"),a=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 a(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"></span></a><a class="next" href="javascript:;"><span class="iconfont"></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")&&(a(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 i=e(this),a=i.data("Slider"),o="object"==typeof n&&n;a||i.data("Slider",a=new t(this,o)),"string"==typeof n&&a[n]()})},e.fn.slider.Constructor=t,e.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(i)}),define("js/common/logo-brand",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var i=e("jquery"),a=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;a.registerHelper("brandList",function(t,n){var i="<ul>",a=0,o=null,s=0;if(t.length%e!==0)for(s=e-t.length%e,a=0;s>a;a++)t.push({href:"javascript:;",img:""});for(a=0;a<t.length;a++)o=n.fn(t[a]),i=a%e===5||5===a?i+'<li class="logo-brand-switch" data-page="'+Math.floor(a/e)+'"><a class="prev iconfont" href="javascript:;"></a><a class="next iconfont" href="javascript:;"></a></li><li data-page="'+Math.floor(a/e)+'">'+o+"</li>":0!==a&&a%e===0?i+'<li class="brand-more" data-page="'+Math.floor(a/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li><li data-page="'+Math.floor(a/e)+'">'+o+"</li>":i+'<li data-page="'+Math.floor(a/e)+'">'+o+"</li>";return i+'<li class="brand-more" data-page="'+Math.floor(a/(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,i;e&&0!==e.length&&(t._createHelper(),i='{{#brandList logoBrand}}<a href="{{href}}" target="_blank"><img class="lazy" data-original="{{img}}" alt=""></a>{{/brandList}}',n=a.compile(i),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 i=this;o(e("li[data-page="+n+"]").find("img.lazy").trigger("appear")),i.$element.find("li[data-page="+t+"]").find("img").fadeOut("normal",function(){i.$element.find("li").hide(),i.$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"),i=0,a=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;i=n===a?0:n+1,t._brandShow(n,i)}),t.$element.on("click",".prev",function(){var n=e(this).parent().data("page"),i=0,a=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;i=0===n?a:n-1,t._brandShow(n,i)})}},e.fn.logoBrand=function(n){return this.each(function(){var i=e(this),a=i.data("LogoBrand"),o="object"==typeof n&&n;a||i.data("LogoBrand",a=new t(this,o)),"string"==typeof n&&a[n]()})},e.fn.logoBrand.Constructor=t,e.fn.logoBrand.defaults={showNum:16,url:"/boys/getBrand"}}(i)}),define("js/product/item",["jquery","lazyload","handlebars","source-map","index"],function(e,t,n){function i(e){h.attr("src",e)}function a(){return+y.text()}function o(){y.text("1"),1===I||0===I?(b.addClass("dis"),w.addClass("dis")):(b.removeClass("dis"),w.addClass("dis"))}function s(e){0!==k.length&&(0===I||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"),I=-1,E=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"),I=-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),i(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(){i(d(this).data("shower"))}),f.on("click","li",function(){var e=d(this);e.hasClass("focus")||(I=+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=a();if(!d(this).hasClass("dis"))return-1===I?void r():void(0!==I&&(e===I-1&&d(this).addClass("dis"),1===e&&w.removeClass("dis"),y.text(e+1>I?I:e+1)))}).on("selectstart",function(){return!1}),w.click(function(){var e=a();d(this).hasClass("dis")||(2===e&&d(this).addClass("dis"),e===I&&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===I?void r():void d.ajax({type:"POST",url:"/cart/index/add",data:{productSku:d(".size:not(.hide) li.focus").data("sku"),buyNumber:a()}}).then(function(e){var t=e.code;200===t&&(d("#type-chose").slideUp(E),d("#balance").slideDown(E),d("#cart-num").text(e.data.goods_count))})}),d("#collect-product").click(function(){var e,t=d(this);t.hasClass("coled")&&(e=!0),d.ajax({type:"POST",url:"/product/item/togglecollect",data:{productId:q,type:e?"cancel":"add"}}).then(function(n){var i=n.code;200===i?(t.toggleClass("coled"),e?t.find("em").text(A.def):t.find("em").text(A.coled)):403===i&&(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(E),d("#balance").slideUp(E)}),d("#buy-now").click(function(){var e,t,n;if(-1===I)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"),i=d(".material-content");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(n.slideDown(E),i.slideUp(E)):(n.slideUp(E),i.slideDown(E)))}),d(".after-service-switch").click(function(){var e=d(this),t=e.next(".after-service-content"),n={def:"",spread:""};"none"===t.css("display")?(t.slideDown(E),e.find(".triangle").html(n.spread)):(t.slideUp(E),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:a}}).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})),a++}}).always(function(){n=!1}))}function t(){i||(i=!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(){i=!1}))}var n,i,a=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"),i=d(".consults");e.hasClass("cur")||(e.addClass("cur"),e.siblings(".cur").removeClass("cur"),0===t?(i.slideDown(E),n.slideUp(E)):(i.slideUp(E),n.slideDown(E)))}).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"),i=d.trim(n.val()),a=t.find(".consult-warn"),o=!0;""===i?(n.addClass("error"),a.removeClass("hide"),o=!1):(n.removeClass("error"),a.addClass("hide")),o!==!1&&d.ajax({type:"POST",url:"/product/item/addconsult",data:{productId:q,content:i}}).then(function(e){var i=e.code;200===i?(t.addClass("hide"),t.siblings(".consult-success").removeClass("hide"),n.val("")):403===i&&(location.href=e.data.url)})}),e(),t()}()}),define("js/common/dialog",["jquery","handlebars","source-map"],function(e,t,n){function i(){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 a(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=i()),r.$el=a(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(),e.refreshOnClose&&window.location.reload()}),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,refreshOnClose:!1},h='<div class="yoho-dialog {{className}} hide">{{#if closeIcon}}<span class="close"><i class="iconfont"></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 i(e){var t,n="",i={title:"",url:window.location.href,weixinUrl:"",image:"",desc:"",channel:""},a=["weibo","tweibo","qzone","renren","qq","douban","weixin"],s="<em><i></i></em>";if(i=o.extend(i,e),-1===o.inArray(i.channel,a))return alert("不存在的分享平台!"),!1;switch(i.channel){case"weibo":n="http://service.weibo.com/share/share.php?url="+i.url+"&title="+i.title+"&appkey=3739328910&searchPic=true&pic="+i.image;break;case"tweibo":n="http://share.v.t.qq.com/index.php?c=share&a=index&url="+i.url+"&title="+i.title+"&appkey=c0af9c29e0900813028c2ccb42021792&pic="+i.image;break;case"qzone":n="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+i.url+"&title="+i.title+"&desc=&summary="+i.desc+"&site=YOHO!BUY 有货&pics="+i.image;break;case"renren":n="http://widget.renren.com/dialog/share?resourceUrl="+i.url+"&srcUrl="+i.url+"&desc="+i.desc+"&title="+i.title+"&description="+i.desc+"&pic="+i.image;break;case"qq":n="http://connect.qq.com/widget/shareqq/index.html?url="+i.url+"&desc="+i.desc+"&title="+i.title.replace("%","")+"&desc=&summary="+i.desc+"&site=YOHO!BUY 有货&pics="+i.image;break;case"weixin":n="http://s.jiathis.com/qrcode.php?url="+i.weixinUrl+"&desc="+i.desc+"&title="+i.title+"&description="+i.desc+"&pic="+i.image;break;case"douban":n="http://www.douban.com/share/service?href="+i.url+"&text="+i.desc+"&image="+i.image+"&title="+i.title+"&comment="}if("weixin"===i.channel){if(!i.self)return;t=i.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 a(e,t){var n=document.title.replace(/(^\s*)|(\s*$)/g,""),a=o("#share-desc").val(),s=o("#share-img").val(),r=o("#weixin-url").val();i("weibo"===e||"tqq"===e?{channel:e,title:n,image:s}:{channel:e,title:n,desc:a,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?a(t,e):(n.hide(),a(t))})}),define("js/product/shop-index",["jquery","lazyload","handlebars","source-map","jquery-pjax"],function(e,t,n){function i(){var e=d.find(".shop-collect-ico"),t=d.find(".shop-collect-text"),n=e.hasClass("on"),i=window.cookie("needColloect");a.ajax({type:"post",url:"/shoplist/setFavorite",data:{isFavorite:n?0:1,needColloect:i,shopId:d.data("id")},success:function(a){200===a.code?(n?(e.removeClass("on"),t.html("收藏")):(e.addClass("on"),t.html("已收藏")),i&&(e.addClass("on"),t.html("已收藏"))):401===a.code&&(window.setCookie("needColloect","1",{path:"/",domain:".yohobuy.com",expires:90}),location.href=a.url)}})}var a=e("jquery"),o=e("lazyload"),s=e("js/product/product"),r=a(".shop-intro"),d=a(".shop-collect"),l=a(".slider-left"),c=a(".all-goods"),u=c.find(".fixed-area"),h=u.offset()?u.offset().top:0;e("jquery-pjax"),e("js/common/slider"),e("js/product/list"),s.init(4),o(a("img.lazy")),l.length&&l.slider(),r.on("click",function(){a(".pop-shop-intro").show(),a(".mask").show()}),a(".close-btn, .mask").on("click",function(){a(".pop-shop-intro").hide(),a(".mask").hide()}),d.on("click",function(){i()}),1*window.cookie("needColloect")===1&&window.getUid()&&(i(),window.setCookie("needColloect","",{path:"/",domain:".yohobuy.com",expires:1})),c.pjax("a.pjax",".goods-wrap",{timeout:5e3,scrollTo:!1}).on("pjax:end",function(){s.init(4),o(a("img.lazy")),u=c.find(".fixed-area"),a("html, body").animate({scrollTop:c.offset().top-30})}).on("click",".menu-list li",function(){var e=a(this);e.siblings().removeClass("on"),e.addClass("on")}),a(window).on("scroll",function(){var e=a(this).scrollTop();e>h?u.css({position:"fixed",top:0}):u.css({position:"static",top:0})})}),define("js/index/index",["jquery","lazyload","handlebars","source-map"],function(e,t,n){var i=e("jquery"),a=e("lazyload"),o=i(".home-page").data("page"),s=i(".logo-brand").data("url");e("js/common/slider"),e("js/common/slider2"),e("js/common/logo-brand"),e("js/common/accordion"),i(document).on("mouseenter",".imgopacity a img",function(){i(this).css("opacity",.8)}),i(document).on("mouseout",".imgopacity a img",function(){i(this).css("opacity",1)}),i.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})),a(i("img.lazy")),"boys"===o?i(".slide-container").slider({pagination:".thumb-pagination"}):(i(".center-col").slider(),i(".slide-container").slider()),"boys"===o?(i(".logo-brand").logoBrand({url:s}),i(".img-brand").slider2()):(i(".logo-brand").logoBrand({showNum:10,url:s}),i(".img-slider-wrapper").slider2())}),define("js/common/slider2",["jquery"],function(e,t,n){var i=e("jquery");!function(e){e.fn.slider2=function(t){function n(t,n,a){a===!0?(e(".next").trigger("click"),t===n-3?i(--t,n,!1):i(++t,n,!0)):(e(".prev").trigger("click"),0===t?i(++t,n,!0):i(--t,n,!1))}function i(t,i,a){window.setTimeout(n,e.fn.slider2.defaults.delaytime,t,i,a)}function a(t,n,i){var a=-(t*n);e(".img-list").animate({"margin-left":a+"px"},"slow",i)}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,i=null;t.preventDefault(),a(3,d,function(){for(n=0;3>n;n++)i=r.shift(),e(".img-item").parent().append(i.outerHTML),r.push(i);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,i=null,o="";for(t.preventDefault(),n=0;3>n;n++)i=r.pop(),e(".img-item").parent().prepend(i.outerHTML),r.unshift(i);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"}),a(0,d)}),n.autoplay===!0&&i(n.index,l,!0)})}}(i)}),define("js/common/accordion",["jquery"],function(e,t,n){function i(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 a,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;i(0),a=new o({length:5,loop:!1,auto:!1,timeout:2,index:0}),a.on("change",function(e){i(e.to)}),d.mouseover(function(){a.go(s(this).index())}),a.init()}),define("js/common/yohoui/YH.slide",[],function(e,t,n){var i=e("js/common/yohoui/YH.base"),a=function(e){this.__lastTime=null,this.__isStop=!1,e=i.extend(this.defaults,e),a.superclass.constructor.call(this,e)};i.inherit(a,i.assembly),a.prototype.oninit=function(){var e=this,t=e.options;return t.auto&&e.play(),e.go(t.index),this},a.prototype.go=function(e,t){var n,i,a,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,i=u.loop,o=u.length-1,s=e,e=i?e>o?e-o-1:0>e?e+o+1:e:e>o?o:0>e?0:e,a=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);a!==o||e?!c.__isStop&&u.auto&&c.play():c.__lastTime&&clearTimeout(c.__lastTime)},a.prototype.play=function(){var e=this,t=e.options;return e.__lastTime=setTimeout(function(){e.next()},1e3*t.timeout),this},a.prototype.next=function(){
var e=this,t=e.options,n=t.index,i=n+t.step;e.go(i,n)},a.prototype.prev=function(){var e=this,t=e.options,n=t.index,i=n-t.step;e.go(i,n)},a.prototype.pause=function(){var e=this;e.__lastTime&&clearTimeout(e.__lastTime),e.__isStop=!0},a.prototype.resume=function(){var e=this;e.__isStop=!1,e.play()},a.prototype.defaults={index:0,timeout:5,step:1,per:1,auto:!1,loop:!1},n.exports=a}),define("js/common/yohoui/YH.base",[],function(e,t,n){var i,a={"[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 i,a,s;if("object"!=typeof t)return t;if(i=t.valueOf(),t!==i)return new t.constructor(i);if(t instanceof t.constructor&&t.constructor!==Object){a=e?new e:o.clone(t.constructor.prototype);for(s in t)(e||t.hasOwnProperty(s))&&(a[s]=t[s])}else{a={};for(s in t)a.hasOwnProperty(s)&&(a[s]=t[s])}if(n)for(s in n)a.hasOwnProperty(s)&&(a[s]=n[s]);return a},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,i,a=e,o={wrap:a},s=a[0].getElementsByTagName("*"),r=s.length;for(i=0;r>i;i++)n=s[i].className,n.indexOf(t)>-1&&(n=n.split(t)[1]),n&&(o[n]=a.find(s[i]));return o},template:function(){var e,t,n,i,a=arguments;if(a.length>0&&o.isString(a[0]))if(e=a[0],2===a.length&&o.isObject(a[1]))for(t in a[1])void 0!==a[1][t]&&(n=new RegExp("({"+t+"})","g"),e=e.replace(n,a[1][t]));else for(i=1;i<a.length;i++)void 0!==a[i]&&(n=new RegExp("({["+(i-1)+"]})","g"),e=e.replace(n,a[i]));return e},__type:function(e){return null==e?String(e):a[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 i,a;if(o.isArray(e))for(i=0,a=e.length;a>i&&t.call(e[i],i,e[i],n)!==!1;i++);else for(i in e)if(t.call(e[i],i,e[i],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,i){i=i||0,e[i]&&o.funManager.__loadFun(e[i],function(){o.funManager.load(e,t,n,i+1)},n),t(i,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,i=0>n?-1:1;return{direction:i,unit:n}},__:function(e,t,n,i){var a;for(a in e)if(window[e[a].validator]){t[e[a].validator](e[a].prefix+n,i,!1);break}},add:function(e,t,n){var i=[{validator:"addEventListener",prefix:""},{validator:"attachEvent",prefix:"on"}];this.__(i,e,t,n)},remove:function(e,t,n){var i=[{validator:"removeEventListener",prefix:""},{validator:"detachEvent",prefix:"on"}];this.__(i,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)},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,i,a,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("&"),i=n.length,a=0,o;i>a;a++)n[a]&&(o=n[a].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}}};i=function(e){this.initialized=!1,this.registerEvent={before:[],change:[],after:[]},this.options=e,this.init(e)},i.output=function(){o.log(o.list)},i.prototype.oninit=o.fn,i.prototype.init=function(e){this.initialized=!0,this.__Uid=o.getUid("me"),this.oninit(e),o.list[this.__Uid]=this},i.prototype.destory=function(){this.initialized=!1,delete o.list[this.__Uid]},i.prototype.getUid=function(){return this.__Uid},i.prototype.getOptions=function(){return this.options},i.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]}},i.prototype.on=function(e,t){var n=this,i=n.registerEvent[e];return i&&i.push(t),i},i.prototype.off=function(e,t){var n=this,i=n.registerEvent[e],a=[];o.each(i,function(e,n){n===t&&a.push(e)}),o.each(a.reverse(),function(e,t){i.splice(t,1)})},o.assembly=i,n.exports=o}),define("js/common/new-arrivls",["jquery","lazyload","handlebars","source-map"],function(e,t,n){function i(e){var t={index:0,isload:!0,isrun:!0,offset:{height:null,width:null}};return this.registerEvent={before:[],change:[],after:[]},this.options=a.extend(!0,{},t,e),this}var a=e("jquery"),o=e("lazyload"),s=e("handlebars");i.prototype.on=function(e,t){var n=this,i=n.registerEvent[e];return i&&i.push(t),i},i.prototype.exect=function(e,t){var n,i=this;if(i.registerEvent[e]&&i.registerEvent[e].length>0)for(n in i.registerEvent[e])i.registerEvent[e].hasOwnProperty(n)&&i.registerEvent[e][n](t)},i.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),a(window).scroll(e)},i.prototype.emit=function(){var e=this.options;e.isload=!0},i.prototype.stop=function(){var e=this.options;e.isrun=!1,e.isload=!1},i.prototype.__directionCalculation=function(){var e=this.options;return!!(e.offset.height&&e.offset.height()>0&&a(window).scrollTop()+a(window).height()>=e.offset.height())},n.exports=function(e){var t,n=a("#newarrivals .goods-container"),r=a(".loading a"),d=new i({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,i){var l={type:"POST",url:e,success:function(e){var a,l,c,u=e.code;200===u?(l=e.goods.length%i,c=e.goods.length-l-1,e.goods.splice(c,l),a=s.compile(d.tpl),n.append(a(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,a.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}}"></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 i=e("jquery"),a=e("lazyload");e("js/common/slider"),e("js/brand/brands"),a(i("img.lazy")),i(".slide-container").slider({orient:!0})}),define("js/brand/brands",["jquery","handlebars","source-map","dot"],function(e,t,n){function i(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?window.unescape(n[2]):null}function a(e,t,n){var i,a=e,o={width:a.width(),left:a.offset().left,right:parseFloat(l(window).width())-parseFloat(a.offset().left)-parseFloat(a.width())},s=a.parent("li");p.find(".brands-dialog").remove(),i=c.compile(n),s.append(i(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),a(e,j[t.brand.key],S))}};clearTimeout(r),r=setTimeout(function(){j.hasOwnProperty(t)?a(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,i,a){return i*((t=t/a-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=i("id")?i("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 i(){var e=new Date,t=m(".captcha-img"),n=t.attr("src").split("?")[0];t.attr("src",n+"?t="+e.getTime())}function a(e,t){var n,a;"reg"===e?(n="/passport/register/checkmobile",a={mobile:I.val(),area:N.text().split("+")[1]}):"third"===e&&(n="/passport/autouserinfo/bindCheck",a={mobile:I.val(),area:N.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:a}).then(function(e){if(e){switch(e.code){case 200:I.val()!==B&&""!==B&&(i(),S.addClass("disable").attr("disabled","disabled"),q[1].message="图形验证码错误",q[1].status=!1),B=I.val(),q[0].message="",q[0].status=!0;break;case 400:i(),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:i(),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:E.val(),mobile:I.val(),area:N.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 i,r=m.trim(t.val());t.hasClass("phone-num")?(i=N.text(),""===r?(q[0].message="请输入手机号码",q[0].status=!1,n()):!/^[0-9]+$/.test(r)||"+86"===i&&!g.phoneRegx[i].test(r)?(q[0].message="手机号码格式不正确,请重新输入",q[0].status=!1,n()):a(e,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),i=0;switch(i=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=[],I=m("#phone-num"),E=m("#msg-captcha"),A=m("#pwd"),F=m("#repwd"),U=m("#captcha"),D=0,P=m(".pwd-intensity"),O=P.closest(".pwd-intensity-container"),N=m("#country-code"),L=m("#region"),$=!1,z=g.pwdValidateRegx,B="";e("jquery.placeholder"),setTimeout(function(){I.val(""),E.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,i=q.length,a=m(this);r(e,m(this),function(){for(l(),c(),t=0;i>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")}),a.hasClass("pwd")&&u(a)}).blur(function(){}),L.change(function(){N.text(m("#region").val()),r(e,I,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:N.text().split("+")[1],mobile:I.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:N.text().split("+")[1],mobile:I.val(),verifyCode:U.val(),code:E.val(),password:A.val()}}).then(function(e){var t,n,i=0;200===e.code?(n=e.data.href,t=setTimeout(function(){i++},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(){i()}),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 i={"+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}$/},a=/^[.\-_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=i,t.emailRegx=a,t.pwdValidateRegx=o}),define("js/passport/pwd-strength",[],function(e,t,n){function i(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 a(e,t,n){var i=e.charCodeAt(0),a=t.charCodeAt(0);return i-a===0?!0:4!==n&&(i-a===1||i-a===-1)}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=i(e,c),l===n&&a(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 i(){var e=new Date,t=d("#captcha-img"),n=t.attr("src").split("?")[0];d("#captcha-img").attr("src",n+"?t="+e.getTime())}function a(){_&&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,i()),a()}):void a()}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 a()):(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(){i()}),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),i=n.data("cc");e.stopPropagation(),p.val(i),v.find("em").html(n.text()),""!==d.trim(f.val())&&(t=s(f.val()),a(),_?(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&&i())}).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 i,a=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=a("#email-autocomplete"),e.on("keyup",function(){var e,t,i,s,r=a.trim(a(this).val()),d="";if(r.indexOf("@")>0){for(e=r.match(/^[0-9]+@(.*)/),e?(i=o.num,t=e[1]):(i=o.other,t=r.match(/@(.*)/)[1]),s=0;s<i.length;s++)i[s].indexOf(t)>-1&&(d+="<li>"+r.slice(0,r.indexOf("@"))+"@"+i[s]+"</li>");""!==d&&/.com$/.test(r)===!1?n.html(d).removeClass("hide"):n.html("").addClass("hide")}}).on("blur",function(){i=setTimeout(function(){n.addClass("hide"),t&&t()},200)}),n.on("click","li",function(){clearTimeout(i),e.val(a(this).text()).focus(),n.addClass("hide"),t&&t()})}}),define("js/passport/login",["jquery","jquery.placeholder"],function(e,t,n){function i(){var e,t=!1,n=c.trim(u.val()),i=y.val();return""!==n?/^[0-9]+$/.test(n)?"+86"!==i||_.phoneRegx[i].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 a(){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=i()&&a()&&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&&I===!1&&(I=!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")},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(){I=!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:"",unchecked:""},I=!1;e("jquery.placeholder"),x(u,function(){i()&&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(){a(),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 i(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 a(e,t,n){var i=e.charCodeAt(0),a=t.charCodeAt(0);return i-a===0?!0:4!==n&&(i-a===1||i-a===-1)}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=i(e,c),l===n&&a(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)}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()),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 i,a,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;i=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(i--+"秒后可重新操作"),a=setInterval(function(){0===i?(clearInterval(a),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(i--+"秒后可重新操作")},1e3)}else o(this).addClass("error"),d.removeClass("hide").text("发送失败")})}),i=60,s.addClass("disable").attr("disabled",!0),
r.removeClass("hide"),s.val(i--+"秒后可重新操作"),a=setInterval(function(){0===i?(clearInterval(a),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(i--+"秒后可重新操作")},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 i(){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"),I.css({"background-color":e})})}function a(){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="",i="",o="",s="";b("#bindfirststep").on("click",function(r){var d;if(r.preventDefault(),n=b(".phonenum").val(),i=b("#areanum").text(),d=w["+"+i],a()){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:i,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(),i(),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"),I=T.find(".yohobindbtn");T.on("keydown",".phonenum",function(e){return 13===e.keyCode?(I.trigger("click"),!1):void 0}),y()}),define("js/passport/third-pwd",["jquery"],function(e,t,n){function i(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 a(e,t,n){var i=e.charCodeAt(0),a=t.charCodeAt(0);return i-a===0?!0:4!==n&&(i-a===1||i-a===-1)}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=i(e,d),r===c&&a(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(E,"短信验证码不能为空"),n=!1):x===!1&&(r(E,"请输入正确的验证码"),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,I=C(".bindwrapper"),E=I.find(".code-err-tip"),A=I.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 i(){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 a(){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(){i(),s.addClass("hide"),u.addClass("hide"),r.removeClass("hide")}),r.on("keydown",".msg-code",function(e){return 13===e.keyCode?(a(),!1):void 0}),r.on("click",".get-code",function(){i()}),r.on("click",".perv-step",function(){f.clearTime(),s.removeClass("hide"),r.addClass("hide"),l.val("")}),o("#relate-btn").click(function(){a()})}),define("js/cart/cart",["jquery","handlebars","source-map"],function(e,t,n){function i(e){B.ajax({type:"POST",dataType:"json",url:"/cart/index/select",data:e,beforeSend:function(){B(".loading").css({top:B(document).scrollTop()+200}),B(".loading").show()}}).then(function(e){200===e.code&&window.history.go(0)})}function a(){var e=B(".pay-wapper tbody tr").find(".cart-item-check:checked"),t=0;return e.length>0&&(e=e.eq(0)),t=e.offset().top-36,B("html,body").scrollTop(t),!1}function o(e,t){ne=[],j={},C=e.attr("checked")?"Y":"N",B("."+t).each(function(){se=!!B(this).data("promotionid"),B(this).data("id")&&ne.push({product_sku:B(this).data("id"),selected:C,buy_number:B(this).data("productnum"),goods_type:B(this).data("goodstype"),promotion_id:B(this).data("promotionid")?B(this).data("promotionid"):0})}),j={skuList:JSON.stringify(ne),hasPromotion:se},i(j)}function s(e,t,n){B.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(" "),g=m(t.data),e.append(B(g)),B("#orderProduct li:last").addClass("end"),B(".gift").removeClass("none"))})}function r(e){B.ajax({type:"GET",dataType:"html",url:"/cart/index/getProductInfo",data:e}).then(function(e){ee=0,X.html(" "),X.append(e),X.show(),B(".detail-bigpic:not(.none) .con li:first").addClass("active"),B(".showSizeBox:not(.none) span").length<2&&B(".showSizeBox:not(.none) span:first").addClass("atcive"),1!==Number(B("#addToCart").val())&&B(".showSizeBox span").data("num",0),B.each(B(".showSizeBox span"),function(){B(this).data("num")<=0&&(B(this).addClass("null-atcivec"),console.log(B(".showSizeBox:not(.none) span:first")),B(".showSizeBox:not(.none) span:first").removeClass("atcive"))}),"undefined"!=typeof I&&($=B(".detail-info .oldprice del").html()?B(".detail-info .oldprice del").html():z,N='<span class="oldprice">现价:<del>'+$+'</del></span><span class="newprice">活动价:<b class="promotion-price">'+I+"</b></span>",B(".detail-info .price").html(N)),B(".detail-bigpic:not(.none) .bigpic:gt(0)").hide(),B(".showSizeBox:not(.none)").find("span").each(function(){return B(this).hasClass("null-atcivec")?(B(".addcart").addClass("none"),void B(".btn_sellout").removeClass("none")):(B(".addcart").removeClass("none"),B(".btn_sellout").addClass("none"),!1)})})}function d(){X.html(" "),X.css({top:B(document).scrollTop()+30,left:B(document).width()/2-X.width()/2})}function l(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 c(e,t,n){B.ajax({type:"POST",dataType:"json",url:t,data:j,beforeSend:function(){B(".loading").css({top:B(document).scrollTop()+200}),B(".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?(B(".loading").hide(),new H(e.message).show()):403===e.code&&e.data.url&&(window.location=e.data.url)})}function u(e){re=!0,B.ajax({type:"POST",dataType:"json",url:"/cart/index/modify",data:e}).then(function(e){200===e.code&&window.history.go(0),re=!1})}function h(e,t){B.ajax({type:"POST",url:"/cart/index/add",data:e}).then(function(e){200===e.code?(window.history.go(0),t&&window.setCookie("cart-del-list",JSON.stringify(t),{domain:".yohobuy.com",path:"/"})):500===e.code&&new H(e.message).show()})}function p(){B(".gift-wrapper .fold").show(),B(".pre-sell-box input:checked").length===B('.pre-sell-box input[type="checkbox"]').length&&B('.per-list input[type="checkbox"]').attr("checked",!0),B(".common-sell-box input:checked").length===B('.common-sell-box input[type="checkbox"]').length&&B('.common-list input[type="checkbox"]').attr("checked",!0),B('.common-list input[type="checkbox"]').attr("checked")&&(oe=!0),B('.per-list input[type="checkbox"]').attr("checked")&&(ae=!0),0!==B(".per-list").length&&0!==B(".common-list").length?oe&&ae&&B('.batch_div input[type="checkbox"]').attr("checked",!0):(oe||ae)&&B('.batch_div input[type="checkbox"]').attr("checked",!0),B(".cart-page").each(function(){1===B(this).data("pageall")?(B(".cart-btn-pre",this).hide(),B(".cart-btn-next",this).hide()):B(".cart-btn-pre",this).hide()}),B(".pre-sell-box input:checked").length>0&&B(".common-sell-box input:checked").length>0?(B(".go_cash_tips").show(),B(".btn_account_disabled").show(),B(".btn_account").hide()):(B(".go_cash_tips").hide(),B(".btn_account").show(),B(".btn_account_disabled").hide()),B(".pay-wapper tr").each(function(){B(this).data("pid")&&ne.push(B(this).data("pid")+"")}),B.ajax({type:"POST",url:"/cart/index/checkFav",data:{pidList:JSON.stringify(ne)}}).then(function(e){E='<span class="cart-yetremove-btn">已收藏</span>',A='<a href="javascript:void(0);" class="cart-remove-btn"><span>移入收藏</span></a>',B.each(e.data,function(e,t,n){B(".pay-wapper tr").each(function(){Number(B(this).data("pid"))===Number(e)&&(t?B(this).find(".cart-operation").append(E):B(this).find(".cart-operation").append(A))})})})}var f,m,g,v,y,b,w,C,_,x,k,j,S,T,q,I,E,A,F,U,D,P,O,N,L,$,z,B=e("jquery"),R=e("handlebars"),M=e("js/common/dialog"),W=M.Confirm,H=M.Alert,G=B(".cartnew-sum"),Y=B(".cartnew-tips"),Q=B(".pay-wapper"),X=B(".goods-detail"),V=B(".histroy"),Z=B(".together"),J=B(".shop-cart"),K=1,ee=0,te=1,ne=[],ie=[],ae=!1,oe=!1,se=!1,re=!1;Y.find(".btn_close").click(function(){Y.fadeOut()}),Q.one("click",'.common-sell-box input[type="checkbox"], .pre-sell-box input[type="checkbox"]',function(){C=B(this).attr("checked")?"Y":"N",ne=[],ne.push({product_sku:B(this).parents("tr").data("id"),selected:C,buy_number:B(this).parents("tr").data("productnum"),goods_type:B(this).parents("tr").data("goodstype"),promotion_id:B(this).parents("tr").data("promotionid")?B(this).parents("tr").data("promotionid"):0}),se=!!B(this).parents("tr").promotion_id,j={skuList:JSON.stringify(ne),hasPromotion:se},i(j)}),G.one("click",'input[type="checkbox"]',function(){ne=[],L={},j={},C=B(this).attr("checked")?"Y":"N",B(".pay-wapper:first tr").each(function(){B(this).data("promotionid")&&(se=!0),B(this).data("id")&&ne.push({product_sku:B(this).data("id"),selected:C,buy_number:B(this).data("productnum"),goods_type:B(this).data("goodstype"),promotion_id:B(this).data("promotionid")?B(this).data("promotionid"):0})}),j={skuList:JSON.stringify(ne),hasPromotion:se},i(j)}),B(".per-list").on("click",'input[type="checkbox"]',function(){o(B(this),"pre-sell-box")}),B(".common-list").on("click",'input[type="checkbox"]',function(){o(B(this),"common-sell-box")}),f=B("#togetherProduct").html(),m=R.compile(f),s(V,"/cart/index/getRecommendProduct"),s(Z,"/cart/index/getTogetherProduct"),Z.on("click",".pagenext, .pageprev",function(){s(Z,"/cart/index/getTogetherProduct",{page:Math.ceil(100*Math.random())+1})}),J.on("click",".icon-minus, .icon-add",function(){B(this).hasClass("icon-minus")?(B(this).parents(".title").next(".main").hide(),B(this).parents("h2").next(".right").hide()):(B(this).parents(".title").next(".main").show(),B(this).parents("h2").next(".right").show()),B(this).siblings("i").toggleClass("none"),B(this).toggleClass("none")}),V.on("click",".pagenext, .pageprev",function(){B(this).hasClass("pagenext")?5!==K?K++:K=1:--K>0||(K=1),s(V,"/cart/index/getRecommendProduct",{page:K})}),Q.on("click",".cart-add-btn",function(){U=B(this).data("id"),q=B(this).parents("table").data("promotion"),I=B(this).parents("table").find(".subjoin-price").html(),z=B(this).parents("table").find(".wapper-price").html(),d(),r({productId:U})}),B(".clearfix").on("click",".btn_view_s",function(){U=B(this).data("id"),q=B(this).parents("table").data("promotion"),I=B(this).parents("table").find(".subjoin-price").html(),d(),r({productId:U})}),X.on("click",".colse",function(){X.hide(),X.html(" "),te=1}),Q.on("click",".icon-minusCart, .icon-addCart",function(){l(B(this))}),Q.on("click",".unfold-color",function(){l(B(this)),B(this).siblings(".icon-minusCart").removeClass("none"),B(this).siblings(".icon-addCart").addClass("none")}),Q.on("click",".cart-btn-next",function(){v=B(this).siblings("p").find(".f-red"),b=Number(B(this).siblings("p").find(".subjoinPageNum").html()),y=Number(v.html()),v.html(y+1),y>=b-1?B(this).hide():B(this).siblings("i").show(),w=B(this).parents(".cart-product-num").siblings("div").find("table"),w.addClass("none").eq(y).removeClass("none")}),Q.on("click",".cart-btn-pre",function(){v=B(this).siblings("p").find(".f-red"),b=Number(B(this).siblings("p").find(".subjoinPageNum").html()),y=Number(v.html()),v.html(y-1),2>=y?B(this).hide():B(this).siblings("i").show(),w=B(this).parents(".cart-product-num").siblings("div").find("table"),w.addClass("none").eq(y-2).removeClass("none")}),X.on("click",".fav_count",function(){B.ajax({type:"POST",dataType:"json",url:"/product/item/togglecollect",data:{productId:U,type:"add"}}).then(function(e){200===e.code?new H(e.message).show():403===e.code?e.data.url&&(window.location=e.data.url):new H(e.message).show()})}),Q.on("click",".cart-del-btn",function(){j={},ne=[],q=B(this).parents("tr").data("promotionid")?B(this).parents("tr").data("promotionid"):0,ne.push({product_sku:B(this).parents("tr").data("id"),buy_number:B(this).parents("tr").data("productnum"),promotion_id:q}),se=!!q,j={skuList:JSON.stringify(ne),hasPromotion:se},F="<div><span></span>删除商品</div><p>确定从购物车中删除此商品?</p>",B(this).data("gift")||(k={productPrice:B(this).parents("tr").find(".productPrice").text(),productTitle:B(this).parents("tr").find(".pay-pro-info a").text(),link:B(this).parents("tr").find(".pay-pro-info a").attr("href"),productNum:B(this).parents("tr").data("productnum"),productSku:B(this).parents("tr").data("id"),promotionId:B(this).parents("tr").data("promotionid")}),_="/cart/index/remove",new W({content:F,cb:function(){c(j,_,k)}}).show()}),Q.on("click",".cart-remove-btn",function(){j={},ne=[],q=B(this).parents("tr").data("promotionid")?B(this).parents("tr").data("promotionid"):0,ne.push({product_sku:B(this).parents("tr").data("id"),buy_number:B(this).parents("tr").data("productnum"),promotion_id:q}),se=!!q,j={skuList:JSON.stringify(ne),hasPromotion:se},c(j,"/cart/index/fav")}),G.on("click",".delAll",function(){j={},k={},ne=[],ie=[],B(".pay-wapper:first tr").each(function(){B(this).find('input[type="checkbox"]').attr("checked")&&(q=B(this).data("promotionid")?B(this).data("promotionid"):0,q&&(se=!0),B(this).data("id")&&(B(this).find('input[type="checkbox"]').attr("checked")&&ne.push({product_sku:B(this).data("id"),buy_number:B(this).data("productnum"),promotion_id:q}),k={productPrice:B(this).find(".productPrice").text(),productTitle:B(this).find(".pay-pro-info a").text(),link:B(this).find(".pay-pro-info a").attr("href"),productNum:B(this).data("productnum"),productSku:B(this).data("id"),promotionId:B(this).data("promotionid")},ie.push(k)))}),_="/cart/index/remove",F="<div><span></span>删除商品</div><p>确定从购物车中删除所有选中商品?</p>",j={skuList:JSON.stringify(ne),hasPromotion:se},B.isEmptyObject(ne)?new H("请至少选择一件商品").show():new W({content:F,cb:function(){c(j,_,ie)}}).show()}),G.on("click",".removeAll",function(){j={},k={},ne=[],B(".pay-wapper:first tr").each(function(){B(this).find('input[type="checkbox"]').attr("checked")&&(q=B(this).data("promotionid")?B(this).data("promotionid"):0,q&&(se=!0),B(this).data("id")&&B(this).find('input[type="checkbox"]').attr("checked")&&ne.push({product_sku:B(this).data("id"),buy_number:B(this).data("productnum"),promotion_id:q}))}),j={skuList:JSON.stringify(ne),hasPromotion:se},B.isEmptyObject(ne)?new H("请至少选择一件商品").show():c(j,"/cart/index/fav")}),Q.on("click",".minus, .plus",function(){return k={},x=B(this).hasClass("minus")?"decreaseNum":"increaseNum",k[""+x]=1,re||"1"===B(this).siblings("input").val()&&B(this).hasClass("minus")?!1:void u(B.extend(k,{sku:B(this).parents("tr").data("id")}))}),B(".gift").on("click",".up, .down",function(){B(this).siblings("i").toggleClass("none"),B(this).toggleClass("none")}),X.on("click",".addcart",function(){return 0===B(".showSizeBox:not(.none) .atcive").length?(new H("请选择尺码").show(),!1):(S=B(".showSizeBox:not(.none) .atcive").data("num"),T=B(".showSizeBox:not(.none) .atcive").data("sku"),j={productSku:T,buyNumber:B("#mnum").val(),promotionId:q},void(B("#mnum").val()>S?new H("库存不足,目前还有"+S+"个库存").show():1===Number(B("#addToCart").val())?h(j):new H("该商品无法加入购物车").show()))}),X.on("click",".cut, .add",function(){if(x=B(this).hasClass("minus")?"decreaseNum":"increaseNum",q)B(this).hasClass("cut")?new H("-_-,已经是最后一件,不能在减了!").show():new H("最多只能购买1,您好像购买的太多了!").show();else{if(B(this).hasClass("add")?te++:te--,1>te)return new H("-_-,已经是最后一件,不能在减了!").show(),te=1,!1;B("#mnum").val(te)}}),X.on("click",".color",function(){ee=0,B(".color").find("p").removeClass("atcive"),B(this).find("p").addClass("atcive"),B(".showSizeBox").addClass("none").eq(B(this).index()).removeClass("none"),B(".showSizeBox:not(.none) span").length<2&&B(".showSizeBox:not(.none) span:first").addClass("atcive"),B(".detail-bigpic").addClass("none").eq(B(this).index()).removeClass("none"),B(".detail-bigpic").eq(B(this).index()).find(".bigpic").hide(),B(".detail-bigpic").eq(B(this).index()).find(".bigpic:first").show(),B(".detail-bigpic").eq(B(this).index()).find(".con li").removeClass("active"),B(".detail-bigpic").eq(B(this).index()).find(".con li:first").addClass("active"),B(".showSizeBox").eq(B(this).index()).find("span").each(function(){return B(this).hasClass("null-atcivec")?(B(".addcart").addClass("none"),void B(".btn_sellout").removeClass("none")):(B(".addcart").removeClass("none"),B(".btn_sellout").addClass("none"),!1)})}),X.on("click",".showSizeBox span",function(){S=B(this).data("num"),B(this).data("num")>0?(B(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(B(this).index()).addClass("atcive"),B(".addcart").removeClass("none"),B(".btn_sellout").addClass("none")):(B(".showSizeBox:not(.none) span").removeClass("atcivec atcive").eq(B(this).index()).addClass("atcivec"),B(".addcart").addClass("none"),B(".btn_sellout").removeClass("none"))}),B(".goBack").on("click",function(){j={},P=B(".dev-revocation .goBack").index(this),ne=[],B(".dev-revocation tr").each(function(e){P!==e&&(k={productPrice:B(this).find(".productPrice").text(),productTitle:B(this).find(".title").text(),link:B(this).find(".title").attr("href"),productNum:B(this).data("productnum"),productSku:B(this).data("productsku"),promotionId:B(this).data("promotionid")},ne.push(k))}),j={productSku:B(this).parents("tr").data("productsku"),promotionId:B(this).parents("tr").data("promotionid"),buyNumber:B(this).parents("tr").data("productnum")},h(j,ne)}),X.on("click",".piclist li",function(){ee=B(this).index(),B(".detail-bigpic:not(.none) .piclist li").removeClass("active"),B(this).addClass("active"),B(".detail-bigpic:not(.none) .bigpic").hide().eq(B(this).index()).show()}),p(),X.on("click",".pre, .next",function(){if(B(this).hasClass("next")){if(ee>=B(this).siblings(".con").find("li").length-1)return!1;ee++}else{if(1>ee)return!1;ee--}B(this).siblings(".con").find("li").removeClass("active").eq(ee).addClass("active"),B(".detail-bigpic:not(.none) .bigpic").hide().eq(ee).show()}),B(".btn_account").on("click",function(){O="",B(".pay-wapper input:checked").parents("tr").find(".tipNoStore").length>0?(D=B(".pay-wapper input:checked").parents("tr").find(".tipNoStore"),B.each(D.parents("tr").find(".pay-pro-info a"),function(){O+=B(this).html()}),new H(O+"库存不足").show()):B(".zp").length>0&&!B(this).attr("title")?(B(this).attr("title","1"),new H("您有赠品没有选择,请选择完再结算!").show()):B("input:checked").length>0?B(".pre-sell-box input:checked").length>0?window.location.href="/cart/index/orderEnsure?type=2":window.location.href="/cart/index/orderEnsure?type=1":new H("请至少选择一件商品").show()}),Q.on("selectstart",function(){return!1}),X.on("selectstart",function(){return!1}),a()}),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 i(){o(".msg-title, .msg-content .content").dotdotdot({wrap:"letter"}),s(o("#msg-list img.lazy"))}var a,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");a!==n&&(a=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)),a=!1}))}).on("mouseenter mouseleave",".like-icon",function(){o(this).closest(".like").toggleClass("hover")}),i(),t.dotLazy=i}),define("js/guang/img-blink",["jquery"],function(e,t,n){var i=e("jquery");i(".guang-page").on("mouseover","a img, a .bg-img",function(e){var t=i(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 i=e("jquery"),a=e("lazyload");e("dot"),i(".ex-reco-context").dotdotdot({wrap:"letter"}),a(i(".ads img.lazy"))}),define("js/guang/detail",["jquery","lazyload","dot","jquery-pjax"],function(e,t,n){function i(){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 a(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),i(),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,i=o(this);n||(i.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 a;switch(e.code){case 401:a=/\?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(a);break;case 400:break;case 200:/\?col=(1|0)/.test(location.href)?location.href=location.href.replace(/\?col=(1|0)/,""):i.toggleClass("collected")}n=!1}))}).bind("mouseenter mouseleave",function(){o(this).toggleClass("hover")}),i(),p.click(function(e){return h||u?!1:void(o("#comment-info").val().length-f>0||(e.preventDefault(),a(d)))}),o(document).pjax(".comment-pager a","#pjax-container",{timeout:5e3}),o(document).on("pjax:end",function(){i(),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 i=e("jquery"),a=e("js/guang/msg");e("jquery-pjax"),e("js/common/slider"),e("js/guang/img-blink"),e("js/guang/right-side"),i("#slider").slider(),i(document).pjax(".pjax-link, .msg-pager a","#pjax-container",{timeout:2e3}),i(document).on("pjax:end",function(){a.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){function i(e,t,n,i,a,o){var s,r=e;r.hasClass("next")?(2===a&&r.siblings().removeClass("no-visible"),a===n&&r.addClass("no-visible")):(a===n-1&&r.siblings().removeClass("no-visible"),1===a&&r.addClass("no-visible")),s=-o*(a-1)*i,t.animate({marginLeft:s},400)}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(".rc-pager"),n=a(".new-arrival ul"),o=a(".recommend ul"),s=Math.ceil(n.children("li").length/5),r=Math.ceil(o.children("li").length/6),d=n.children("li:last-child").outerWidth(),l=o.children("li:last-child").outerWidth(),c=1,u=1;n.width(n.width()*s),o.width(o.width()*r),e.click(function(){var e=a(this);s>1&&(e.hasClass("next")?++c:--c,i(e,n,s,d,c,5))}),t.click(function(){var e=a(this);r>1&&(e.hasClass("next")?++u:--u,i(e,o,r,l,u,6))})}()}),define("js/home/order-block",["jquery","handlebars","source-map"],function(e,t,n){function i(e){var t={mask:!0,btns:[{id:"cancel-sure",name:"确定并取消订单",btnClass:["cancel-sure"],cb:function(){var t=x(".cancel-dialog :checked"),n=x(".cancel-dialog .cancel-tip"),i="";return i="10"===t.val()?t.parent().find("#reason_other").val():t.siblings("label").text(),0===t.length?void n.html("请选择要取消订单的原因"):void x.ajax({type:"POST",url:"/home/orders/cancelorder",data:{orderCode:e,reasonId:t.val(),reason:i}}).then(function(e){200===e.code?(h.close(),h=a("icon-success","订单修改","您已成功取消了该订单",function(){location.reload(!0)}),h.show()):n.html(e.message)})}},{id:"cancel-no",name:"暂不取消",btnClass:["cancel-no"],cb:function(){h.close()}}],content:I,className:"cancel-dialog"};return new S(t)}function a(e,t,n,i){var a=k.compile(E),o=a({messageIcon:e,messageTitle:t,messageSummary:n}),s={mask:!0,btns:[{id:"message-sure",name:"确定",btnClass:["message-sure"],cb:function(){h.close(),i&&i()}}],content:o,className:"message-dialog"};return new S(s)}function o(e){var t={mask:!0,btns:[{id:"edit-sure",name:"确定",btnClass:["edit-sure"],cb:function(){c(e)}},{id:"edit-no",name:"取消",btnClass:["edit-no"],cb:function(){h.close()}}],content:A.html(),className:"edit-order-dialog"};return new S(t)}function s(e){x.ajax({type:"post",url:"/home/orders/reAdd",data:{orderCode:e}}).then(function(e){200===e.code?location.href="/shopping/cart":new j.Alert(e.message).show()})}function r(e){var t,n,i=e||0,a=/[0-9]{2}/gi;p=x(".edit-order-dialog"),f=p.find('select[name="province"]'),m=p.find('select[name="city"]'),g=p.find('select[name="county"]'),v=p.find('select[name="province"],select[name="city"]'),y=p.find('.inp[name="name"]'),b=p.find('.inp[name="phone"]'),w=p.find('.inp[name="address"]'),C=p.find('.inp[name="tel-code"]'),_=p.find('.inp[name="tel"]');var o=u();t=f.data("areacode")+"",n=!!t&&t.match(a),d({id:i,type:"getProvince",selectId:n[0]},function(){var e=f.val();"0"!==e?(F=!0,d({id:e,type:"getCity",selectId:""+n[0]+n[1]},function(){var e=m.val();"0"!==e&&d({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=x(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>')):(d({id:e.val(),type:"getCity"},function(){F=!0}),p.find('select[name="county"]').html('<option value="0">请选择区县</option>'))),"city"===e.attr("name")&&F&&("0"===e.val()?p.find('select[name="county"]').html('<option value="0">请选择区县</option>'):d({id:e.val(),type:"getCounty"}))}),y.on("blur",function(){o.name(x.trim(y.val()))}),w.on("blur",function(){o.address(x.trim(w.val()))}),b.on("blur",function(){o.mobile(x.trim(b.val()))}),_.on("blur",function(){o.tel(x.trim(C.val()),x.trim(_.val()))}),g.on("change",function(){o.city(f.val(),m.val(),g.val())})}function d(e,t){var n,i=e.selectId;"getProvince"===e.type?n=f:"getCity"===e.type?n=m:"getCounty"===e.type&&(n=g),x.ajax({type:"GET",url:"/cart/index/getAreaList",dataType:"json",data:{id:1*e.id}}).then(function(e){l(n,e.data,i),"function"==typeof t&&t()})}function l(e,t,n){var i,a,o="",s="";for(i=0;i<t.length;i++)s="Y"===t[i].is_support_express?"*":"",o+=t[i].id===n?'<option selected value="'+t[i].id+'">'+s+t[i].caption+"</option>":'<option value="'+t[i].id+'">'+s+t[i].caption+"</option>";"province"===e.attr("name")?a='<option value="0">请选择省份</option>':"city"===e.attr("name")?a='<option value="0">请选择城市</option>':"county"===e.attr("name")&&(a='<option value="0">请选择区县</option>'),e.html(a+o)}function c(e){var t=y.val(),n=f.val(),i=m.val(),o=g.val(),s=w.val(),r=b.val(),d=C.val(),l=_.val(),c={orderCode:e,userName:t,areaCode:o,address:s,mobile:r,phoneCode:d,phoneNum:l},p=u();p.name(t)&&p.city(n,i,o)&&p.address(s)&&p.mobile(r)&&p.tel(d,l)&&x.ajax({type:"post",url:"/home/orders/modifyAddress",data:c}).then(function(e){200===e.code?(h.close(),h=a("icon-waiting","订单修改","您的订单正在尝试修改,请耐心等待。稍后可在订单详情页查看修改情况!",function(){location.reload(!0)}),h.show()):new j.Alert(e.message).show()})}function u(){var e=y.siblings(".error"),t=f.siblings(".error"),n=w.siblings(".error"),i=b.siblings(".error"),a=_.siblings(".error"),o=/^[\u4e00-\u9fa5]{2,5}$/,s=/^[a-zA-Z0-9-#()()\u4e00-\u9fa5]+$/,r=/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/,d=/^[0-9]{3,4}$/,l=/^[0-9]{8}$/,c='<i class="order-icon icon-right"></i>',u='<i class="order-icon icon-error"></i><b></b>';return{name:function(t){return o.test(t)?(e.html(c).show(),!0):(e.html(u),e.find("b").html("真实姓名至少2个中文,最多5个中文"),e.show(),!1)},city:function(e,n,i){return"0"===e||"0"===n||"0"===i?(t.html(u),t.find("b").html("请填写完整的省市区信息"),t.show(),!1):(t.html(c).show(),!0)},address:function(e){if(s.test(e))return n.html(c).show(),!0;var t="详细地址不能为空";return""!==x.trim(e)&&(t="只能包含数字、字母、汉字、#、-、()及其组合"),n.html(u),n.find("b").html(t),n.show(),!1},mobile:function(e){if(r.test(e))return i.html(c).show(),!0;var t="手机号码不能为空";return""!==x.trim(e)&&(t="你输入的联系电话格式不正确"),i.html(u),i.find("b").html(t),i.show(),!1},tel:function(e,t){return""===e&&""===t&&(c=""),e&&!d.test(e)||t&&!l.test(t)||d.test(e)&&!l.test(t)||!d.test(e)&&l.test(t)?(a.html(u),a.find("b").html("你输入的电话格式不正确"),a.show(),!1):(a.html(c).show(),!0)}}}var h,p,f,m,g,v,y,b,w,C,_,x=e("jquery"),k=e("handlebars"),j=e("js/common/dialog"),S=j.Dialog,T=j.Confirm,q=x("#cancel-dialog-tpl"),I=q.html(),E='<p class="message-title"><i class="order-icon {{messageIcon}}"></i>{{messageTitle}}</p><p class="message-summary">{{messageSummary}}</p>',A=x("#edit-dialog-tpl"),F=!1;q.remove(),A.remove(),x(".check-logistics").click(function(){x(this).siblings(".logistics").removeClass("hide")}),x(".close-logistics").click(function(){x(this).closest(".logistics").addClass("hide")}),x(".me-orders, .order-detail").on("click",".cancel-order",function(e){h=i(x(this).closest(".order, .order-detail").data("id")),h.show()}).on("click",".confirm-received",function(e){var t=x(this).closest(".order, .order-detail").data("id");h=new T({cb:function(){x.ajax({type:"POST",url:"/home/orders/confirmorder",data:{orderCode:t}}).then(function(e){200===e.code&&(h.close(),history.go(0))})},content:"您确定要确认收货吗?"}),h.show()}).on("click",".edit-order",function(){x(this).addClass("edit-order-active"),h=o(x(this).closest(".order, .order-detail").data("id")),h.show(),r(0)}).on("click",".rebuy",function(){var e=x(this).closest(".order, .order-detail").data("id");s(e)})}),define("js/home/orders",["jquery","handlebars","source-map"],function(e,t,n){function i(e,t,n,i){var a=1,o=1,s=0,r=!1;e.click(function(){r||("0px"===n.css("left")?s=0:(s+=o*i,r=!0),n.stop().animate({left:s},300,function(){r=!1}))}),t.click(function(){var e=n.parent().width()-n.width()+"px";r||(n.css("left")===e?n.css("left",e):(s+=-a*i,r=!0),n.stop().animate({left:s},300,function(){r=!1}))})}var a=e("jquery");e("js/home/order-block"),a(".why").click(function(){return a("#differentBag").show(),!1}),a("#differentBag").click(function(){return!1}),a(document).click(function(){a("#differentBag").hide()}),a(".bag").find("ul").each(function(){var e=a(this).parent().parent().find(".pre"),t=a(this).parent().parent().find(".next"),n=a(this).find("li").eq(0).width(),o=a(this).find("li").size(),s=n*o;a(this).css("width",s),o>5?(e.show(),t.show(),i(e,t,a(this),n)):(e.hide(),t.hide())})}),define("js/home/favorite",["jquery","handlebars","source-map","dot"],function(e,t,n){var i,a,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:a}}).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 i,r,c,u,h,p,f,m,g,v,y,b={};0!==s(".fav-products").length&&(i=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(){i.slideUp(function(){r.slideDown()})}),s("#retract-sort").click(function(){r.slideUp(function(){i.slideDown()})}),s(".price-down-clock").click(function(){o=s(this),a=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,i;if(h.hasClass("error")||p.hasClass("hide"))t();else{if(n=s.trim(v.val()),""===n||!d.test(n))return i=""===n?"请输入手机号码":"手机号码格式不正确",v.addClass("error"),void s("#price-notice .err-text").removeClass("hide").find("em").html(i);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:a}}).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"),a=e.find(".na-goods-ul"),o=i[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"),a.animate({marginLeft:-(s-1)*a.parent(".na-goods").width()},200),o.cur=s}function t(e,t){e.css("padding-bottom",t.outerHeight()+10)}var n,i={};0!==s(".fav-brands").length&&(n=r.compile(s("#na-tpl").html()),s(".na-trigger").click(function(){var e,a=s(this),o=a.next(".na-list"),r=a.closest("li");return o.hasClass("hide")?(e=r.data("id"),i[e]&&i[e].cache?(o.removeClass("hide"),void t(r,o)):void s.ajax({type:"GET",url:"/home/favorite/newproduct",data:{id:e}}).then(function(a){var s,d,l;200===a.code&&(d=a.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"),i[e]||(i[e]={}),i[e].cache=!0,i[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&&(i=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"),n=s(this).closest(".fav-row").data("shopid"),a=s(this).closest(".fav-row").data("brandorshoptype");e.preventDefault(),s.ajax({type:"GET",url:"/home/favorite/cancel",data:{id:t,shopid:n,brandorshoptype:a,type:i}}).then(function(e){200===e.code&&history.go(0)})}),s("#me-del-checked").click(function(){var e=[],t="商品";if("brand"===i?t="品牌":"article"===i&&(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:i}}).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 i=e("jquery");i(".filter-select").change(function(){location.href=i(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 i(){g=v[f]?v[f]:"",h.html(g+" 快递单号:"+m),c.val(f),u.val(m)}function a(){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=a();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),i(),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 i(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 i="";"Y"===n.is_default&&(i='checked="checked"'),t+='<input type="radio" name="delivery-tpye" value="'+n.id+'" '+i+'"">'+n.name}),S.html(t))})}function a(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 I&&(t="退货"),p.length||(D="没有可以"+t+"的商品"),p.each(function(){var n,i=c(this).parent().parent(),a=i.next();D.length||c(this).prop("checked")&&(n={product_skn:i.find('input[name="skn"]').val(),product_skc:i.find('input[name="skc"]').val(),product_sku:i.find('input[name="sku"]').val(),goods_type:i.find('input[name="typeid"]').val(),last_price:i.find('input[name="price"]').val(),reason:1*i.find(".return-reason").val()},I?n.returned_reason=n.reason:(n.exchange_reason=n.reason,n.new_goods_id=1*i.find(".exchange-color").val(),n.new_product_sku=1*i.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(a.find("textarea").val()),n.evidence_images=[],a.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.removeClass("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"),I=0,E=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?(I=1,g.each(function(){c(this).prop("checked")&&a(1*c(this).val())})):A&&i(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,i,a=n.find("li"),o=!1;t=JSON.parse(e).imgList[0],i='<span class="btn-del" title="删除"></span><img src="'+t.imgUrl+'" width="126" height="126"><input type="hidden" name="imgs" value="'+t.imgRelUrl+'">',a.each(function(){o||c(this).find("img").length||(o=!0,c(this).html(i))})}})}),k.on("change","#area",function(){var e=1*c(this).val();e&&i(e)}),g.change(function(){var e=1*c(this).val();a(e)}),c(".save-btn").click(function(){var e,t;return D="",I?(e="/home/returns/saveRefund",t=s()):(e="/home/returns/saveExchange",t=r()),t.orderCode=E,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(!1))}))})}),define("js/home/common-address",["jquery","handlebars","source-map"],function(e,t,n){var i=e("jquery"),a=e("js/common/dialog"),o=a.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,a){var s,r,d,l,c=this,u=i("#"+t),h=0,p="";u.empty(),91>e&&(i("#"+c.areaDomId).empty(),i("#county").attr("disabled","disabled")),i.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 a&&0!==a&&d===a.substr(0,d.length)&&(l="selected"),u.append('<option value="'+d+'" '+l+">"+p+r.text+"</option>"))}})},bindAreaChange:function(e){var t=this;void 0===i("#"+t.provinceDomId).data("events")&&(i("#"+t.provinceDomId).change(function(){var n=i("#"+t.provinceDomId).val();"0"!==n&&(t.loadAreaData(n,t.cityDomId,"请选择城市",n),i("#"+t.areaDomId).hide(),t.showAreaSel(e.dispDomId))}),i("#"+this.cityDomId).change(function(){var n=i("#"+t.cityDomId).val();"0"!==n&&(t.loadAreaData(n,t.areaDomId,"请选择区县",n),i("#"+t.areaDomId).show(),t.showAreaSel(e.dispDomId))}),i("#"+t.areaDomId).change(function(){t.showAreaSel(e.dispDomId)}),t.showAreaSel(e.dispDomId))},showAreaSel:function(e){var t=this,n="",a=i("#"+t.provinceDomId).find("option:selected").text(),o=i("#"+t.cityDomId).find("option:selected").text(),s=i("#"+t.areaDomId).find("option:selected").text();void 0!==e&&""!==e&&(a.indexOf("选择")<0&&(n=a),""!==o&&o.indexOf("选择")<0&&(n+=","+o),""!==s&&s.indexOf("选择")<0&&(n+=","+s),i("#"+e).html(n))},loadAllData:function(e,t){var n=this;n.initDomIds(t),e+="",91>e?(n.loadAreaData(0,n.provinceDomId,"请选择省份",""),i("#"+n.areaDomId).hide(),i("#"+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),i("#"+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),i("#"+this.areaDomId).show()),n.bindAreaChange(t)}};n.exports=s}),define("plugin/jquery.qupload",["jquery"],function(e,t,n){function i(){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 a(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 i(e){try{}catch(t){this.debug(t)}}function o(e,t,n){var i;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:i="文件超过"+C.file_size_limit/1024+"M",alert(i),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(a){this.debug(a)}}function s(){null!=y&&y()}function l(e,t){try{e>0&&(b=e,w=1,a(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++,a(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(i){this.debug(i)}}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:i,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){i(),o(s(this).attr("id"),e)}});var l=0;window.SWFUpload=r}),define("plugin/swfupload.queue",[],function(e,t,n){var i=e("plugin/swfupload").SWFUpload;"function"==typeof i&&(i.queue={},i.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=i.queue.uploadCompleteHandler,this.settings.upload_start_handler=i.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(i.prototype.initSettings),i.prototype.startUpload=function(e){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[e])},i.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()},i.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,this.queueSettings.queue_cancelled_flag=!t,t},i.queue.uploadCompleteHandler=function(e){var t,n=this.queueSettings.user_upload_complete_handler;if(e.filestatus===i.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t="function"==typeof n?n.call(this,e)!==!1:e.filestatus!==i.FILE_STATUS.QUEUED){var a=this.getStats();a.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=i}),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),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(t),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(e),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&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("&")},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(i){}}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(a){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,i={};if(void 0!=e){for(var a in e.post)if(e.post.hasOwnProperty(a)){t=a;for(var o;null!==(o=n.exec(t));)t=t.replace(o[0],String.fromCharCode(parseInt("0x"+o[1],16)));i[t]=e.post[a]}e.post=i}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(i){}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 i in e)e.hasOwnProperty(i)&&n.push(i+": "+e[i]);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(i){alert("Exception: "+i.name+" Message: "+i.message)}},exports.SWFUpload=SWFUpload}),define("js/home/comment",["jquery"],function(e,t,n){var i,a=e("jquery"),o=a(".comment-table"),s=o.find(".remark-btn"),r=a("#comment-dialog-widget"),d=r.find(".dialog-titlebar"),l=r.find("textarea"),c=a(document).width(),u=a(document).height(),h=a(window).height(),p={canmove:!1,offset:{},maxtop:0,maxleft:0},f={};s.each(function(){var e=a(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(),a(this).data("code",n)}),s.click(function(){var e=a(document).scrollTop();i=a(this),l.val(""),r.removeClass("hide").css({top:e+(h-r.outerHeight())/2,left:(c-r.outerWidth())/2})}),d.bind("mousedown",function(e){a(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())}),a(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=a.trim(l.val());return""===t?void alert("请添加评论内容"):void(i.length&&(e=f[i.data().code],e.content=t,a.ajax({type:"POST",url:"/home/comment/saveComment",data:e}).then(function(e){var n=i.parent();200===e.code?(n.prev().text(t),n.html('<span class="remarked">已评论!</span>'),i.length=0,r.addClass("hide")):alert(e.message)})))}),r.on("click",".dialog-close-btn",function(){i.length=0,r.addClass("hide")})}),define("js/home/complaints",["jquery"],function(e,t,n){function i(){return m?!0:(m=!0,setTimeout(function(){m=!1},1e3),!1)}function a(e){var t=e.dom.siblings(".option-tip"),n=d.trim(e.dom.val()),i=n.length;return e.min&&i<e.min?(t.text(e.onmin),!1):e.max&&i>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,i){a(i)?t[n]=d.trim(i.dom.val()):e||(e=n,i.dom.focus())}),t.complaintsType=h.val(),e?!1:t}function s(){var e=o();!i()&&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;i()||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(){a(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 i(){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 a(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"),i()):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")),i()}),r.on("click",".del-btn",function(){confirm("您确定要删除这条短消息?")&&a("del",s(this).data())}),r.on("click",".del-choose-btn",function(){return c.length?void(confirm("确定要删除您选中的消息")&&a("del",{id:c.join(",")})):void alert("请选中您要删除的消息")}),r.on("click",".read-choose-btn",function(){s(this).hasClass("has-new")&&a("read",{id:c.join(",")})})}),define("js/home/message-content",["jquery"],function(e,t,n){var i=e("jquery"),a=i(".pick-coupon-btn"),o=!1;a.click(function(){var e=i(this).data();o||(o=!0,i.ajax({type:"GET",url:"/home/message/pickCoupon",data:e}).then(function(e){var t=e.message;200===e.code&&(t="领取成功",i(this).removeClass("pick-coupon-btn")),o=!1,alert(t)}))})}),define("js/home/edit",["jquery","handlebars","source-map"],function(e,t,n){function i(){var e=u("#nickname").val().length,t=u("#username").val().length,n=u('input[name="gender"]'),i=u("#year"),a=u("#month"),o=u("#day");return 0===e?(alert("请输入昵称"),!1):0===t?(alert("请输入用户名"),!1):e>=20?(alert("昵称最长为20个字符"),!1):n.is(":checked")?"0"===i.val()||"0"===a.val()||"0"===o.val()?(alert("请选择出生年月日"),!1):!0:(alert("请选择性别"),!1)}function a(){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 i='<li id="brand-'+t+'">'+n+'<a href="javascript:void(0);" class="btn-del"></a></li>',a=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):a?(alert("您已经选择了该品牌."),!1):(s.append(i),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 i=u("#year"),a=u("#month"),o=u("#day"),s=this;this.createDay(i.val(),a.val(),o.val()),i.on("change",function(){s.update()}),a.on("change",function(){s.update()})},update:function(){this.createDay(u("#year").val(),u("#month").val(),u("#day").val())},createDay:function(e,t,n){var i,a,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)),a=1;r>=a;a++)i="",parseInt(n)===a&&(i="selected"),o+='<option value="'+a+'" '+i+">"+a+"</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(){i()&&c("/home/user/edituserinfo/","base-info")}),u("#contact-info").on("click",function(){a()&&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 i(){var e=new Date;return o("#imgcode").attr("src","/passport/images?t="+e.getTime()),!1}var a,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?(a=new r(e.message),a.show(),i()):window.location.href="/home/gift?type=2"},"json"):!1}),o(document).on("click","#imgcode,.check-img",function(){i()}),o(function(){i(),p.bindGiftCardForm()})}),define("js/home/validate",["jquery","handlebars","source-map"],function(e,t,n){function i(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 a(e){return e.$checkInfo.html('<div class="form-success"> </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=a(e.opt):(e.txt=""!==e.txt&&null!==e.txt?e.txt:n.message,t=i(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?i(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)?i(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?i(h,"手机号不能为空!"):null!==l&&l?(v.extend(p,{url:"/home/account/checkmobile",data:{mobile:t},txt:"手机号已经存在!"}),o(p)):i(h,"手机号错误!")):"newPwd"===d?(l=b.pwdValidateRegx,l.test(t)?a(h):i(h,"建议6~20个数字+字母组合!")):"confirm_password"===d?v("#newPwd").val()!==t?i(h,"两次密码不一致!"):a(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)}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,i=v("#mobilevalue");if(i.length>0?(e=i.next(),t=i.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(i.length>0){if(null===n||!n)return e.html('<div class="form-error">手机号错误!</div>'),i.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="",i={};v(".email").length>0&&(n="email"),v(".mobile").length>0&&(n="mobile"),v(".userpwd").length>0&&(n="userpwd"),0===e?"1"===t?(i={url:"/home/account/verifypassword",
data:v("#pwdform").serialize(),hrefUrl:"/home/account/"+n+"?step=2"},p(i,"step1")):"2"===t?(i={url:"/home/account/sendemail",data:{checkType:n,email:v("#realAccount").val()},hrefUrl:"/home/account/sendemailsuccess?email="+v("#realAccount").val()+"&type=1&checkType="+n},p(i)):(i={url:"/home/account/checkmobilemsg",data:{mobile:v("#realAccount").val(),code:v("#inputcode").val()},hrefUrl:"/home/account/"+n+"?step=2"},p(i,"step1")):1===e&&("userpwd"===n?(i={url:"/home/account/modifypwd",data:v("#pwdform").serialize(),hrefUrl:"/home/account/userpwd?step=3&success=true"},p(i)):"email"===n?(i={url:"/home/account/modifyemail",data:{email:v("#email").val()},hrefUrl:"/home/account/sendemailsuccess?email="+v("#email").val()+"&type=2&checkType=email"},p(i)):(i={url:"/home/account/modifymobile",data:{mobile:v("#mobilevalue").val(),code:v("#inputcode").val()},hrefUrl:"/home/account/mobile?step=3&success=true"},p(i)))}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,i;for(n=t||0,i=this.length;i>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(),a=v("#newPwd").val(),o={dom:t,$checkInfo:t.next()};n.length>0&&a!==n&&i(o,"两次密码不一致!")})})}),define("js/home/address",["jquery","handlebars","source-map"],function(e,t,n){function i(e){var t=e.parents(".address-content"),n=t.attr("addressId");return n}function a(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,i="输入正确",a="form-info form-success",o=e.val;return"addressName"===e.inputName&&(t=/^[\u4e00-\u9fa5]{2,5}$/,e.len<1||e.len>12?(i="真实姓名在2到5个汉字之间,请确认",n=!1,a="form-info form-error"):t.test(e.val)===!1&&(i="真实姓名至少2个中文,最多5个中文",n=!1,a="form-info form-error")),"address"===e.inputName&&e.len<2&&(i="请填写详细地址",n=!1,a="form-info form-error"),"zipCode"===e.inputName&&(t=/^[0-9]{6}$/,0===e.len?(i="请输入收货人所在地邮编号",n=!1,a="form-info form-error"):t.test(e.val)===!1&&(i="你输入的邮编式不正确",n=!1,a="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?(i="你真的不想留联系电话了吗?",n=!0,a="form-info form-success"):t.test(e.val)===!1&&(i="你输入的联系电话格式不正确",n=!1,a="form-info form-error")),"mobile"===e.inputName&&(t=/^1[3|4|5|8|7][0-9]{9}$/,11!==e.len?(i="手机号码必须是11位的,请确认",n=!1,a="form-info form-error"):t.test(e.val)===!1&&(i="您输入的手机号格式不正确",n=!1,a="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||(i="你输入的邮件地址格式不正确",n=!1,a="form-info form-error")),e.$checkInfo.removeClass().addClass(a).html(i),n}function s(e,t){var n=e.val(),i=e.parent(),s={val:n,len:n.length,$domParent:e.parent(),$checkInfo:i.find("span"),inputName:e.attr("name")};return"focus"===t&&a(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)}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"),i=c(".address-list").find("li[addressId="+e+"]"),a=i.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>"),a.attr("class","btn-c2 default-btn"),t.html("<span>设为常用地址</span>"),i.addClass("preferred")):(l=new p("设置失败"),l.show())})}};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n,i;for(n=t||0,i=this.length;i>n;n++)if(this[n]===e)return n;return-1}),c(document).on("click",".set-default-btn",function(){var e=i(c(this));v.setDefaultAddr(e)}),f.on("click",function(){var e=i(c(this));v.delAddr(e)}),m.on("click",function(){var e=i(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 i=e("jquery"),a=e("handlebars"),o=i(".search-content"),s=i("#help-dialog-widget"),r=i("#help-dialog-bg"),d=i(document).width(),l=i(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=a.compile(c);o.on("click",".faqs",function(){var e=i(this).data(),t=i(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){function i(e,t,n,i){var a=1,o=1,s=0,r=!1;e.click(function(){r||("0px"===n.css("left")?s=0:(s+=o*i,r=!0),n.stop().animate({left:s},300,function(){r=!1}))}),t.click(function(){var e=n.parent().width()-n.width()+"px";r||(n.css("left")===e?n.css("left",e):(s+=-a*i,r=!0),n.stop().animate({left:s},300,function(){r=!1}))})}function a(){var e,t,n,i,a,r,l=!0;u.hasClass("receipt-type-selected")?(e="电子发票",a="2"):(e="纸质发票",a="1"),"单位"===f&&s(".input-line").each(function(){""===s(this).find("input").val()&&(s(this).find(".enpty-input").removeClass("hide"),l=!1)}),r=s("#input-mobile").val(),r===o?r=m:(n=/[0-9]{11}/,n.test(r)||(s(".invoice-phone .enpty-input").removeClass("hide"),0===r.length?s(".invoice-phone .enpty-input").html(" 请填写手机号码"):s(".invoice-phone .enpty-input").html(" 手机号码不正确"),l=!1)),l&&(s(".invoice-title .enpty-input").addClass("hide"),s(".invoice-phone .enpty-input").addClass("hide"),"单位"===f&&(f=s("#input-organization-name").val()),t=s('input[name="content"]:checked').val(),i=s('input[name="content"]:checked').data("receiptid"),s(".invoice-type").html(e),s(".invoice-partment").html(f),s(".invoice-kind").html(t),s(".invoice-upload-type").html(a),s(".invoice-upload-content").html(i),s(".invoice-upload-mobile").html(r),s(".invoice-upload-title").html(f),d.addClass("hide"),s(".invoice-content-outter").removeClass("hide"))}var o,s=e("jquery"),r=s(".invoice"),d=s(".receipt-info"),l=s(".receipt-info .save-receipt"),c=s(".receipt-info .cancel-receipt"),u=s(".receipt-type .e-receipt"),h=s(".receipt-type .paper-receipt"),p=e("js/order/address"),f="个人",m=s("#recordMobileNumb").val(),g=e("js/common/dialog"),v=function(e,t){var n=0,i=e.toString(),a=t.toString();try{n+=i.split(".")[1].length}catch(o){}try{n+=a.split(".")[1].length}catch(o){}return Number(i.replace(".",""))*Number(a.replace(".",""))/Math.pow(10,n)},y={Data:{product:0,activity:0,carriage:0,juan:0,yohocoin:0},UI:{e:{$pan:s(".pan"),$jc:s("#juancode"),$bp:s("#biprice"),$statistics:s("li",".play-total"),$tobi:s("p em",".play-bi-pan .play-pan"),$cancel:s(".cancel",".btn-group"),$total:s("em",".to-play"),$tbody:s("table tbody",".pay-wapper"),$orderSelectionSave:s(".address-list h2 span"),$addAddress:s(".add-address"),$addressManage:s(".address-manage"),$spanPayTypeLegend:s("span.pay-type-legend"),$supportType:s(".support-type"),$existAddressListWrap:s(".exist-address-list"),$existAddressList:s(".exist-address-list").find("li"),$existAddress:s(".exist-address-list").find('input[name="exist-address"]'),$payTimeModify:s(".pay-time-modify"),$switchPayModify:s(".switch-pay-modify"),$modityPayInfo:s(".modity-pay-info"),$payTotal:s(".play-total"),$toPay:s(".to-play em"),$redEnvelopes:s(".red-envelopes"),$useEnvelopes:s(".use-envelopes"),$hasEnvelopes:s(".has-envelopes span"),$useEnvelopesInput:s(".use-envelopes").find("input"),$expressFee:s(".express-fee")},init:function(){var e=this.e,t=y.Data,n=y.Common;e.$tbody.find("tr").each(function(i){var a=s(this).find("td"),o=e.$tbody.find("tr").length,r=parseFloat(a.eq(1).html())*parseInt(a.eq(3).html());a.eq(1).html("¥"+a.eq(1).html()),a.hasClass("xforone")?(a.eq(4).find("del").html("¥"+n.strFixed(r)),r=0):a.eq(4).html("¥"+n.strFixed(r)),t.product+=r,i?a.last().remove():a.last().attr("rowspan",o),i===o-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=s(this).parent("dl.pan");e.find("dd").is(":hidden")?(n.winShow(e),s(this).addClass("active")):(n.winHide(e),s(this).removeClass("active"))}),e.$orderSelectionSave.click(function(){var t=0,n=s(".exist-address-list li"),i=n.length,a=0;if(s(this).attr("expand")){for(t=0;i>t;t++)n.eq(t).hasClass("address_select")&&a++,n.eq(t).hasClass("address_select")||n.eq(t).addClass("hide");0===a&&(s('.exist-address-list li:not(".use-new-address")').removeClass("hide"),s(".use-new-address input").removeAttr("checked")),s(".address-list-inner li.address_select input").attr("checked","checked"),s(".address-list-inner li").removeClass("active"),s(".address-list-inner li.address_select").addClass("active"),s(this).removeAttr("expand").text("[修改]"),s(".save-btn").addClass("hide"),e.$existAddressListWrap.removeClass("address-expand"),e.$addressManage.addClass("hide")}else s(this).attr("expand","expand").text("[不保存并关闭]"),s(".exist-address-list li").removeClass("hide"),s(".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"),s(this).text("[不保存并关闭]")):(e.$payTimeModify.addClass("hide"),e.$modityPayInfo.removeClass("hide"),s(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(){s(this).toggleClass("active"),e.$supportType.toggleClass("hide")}),s(document).on("click",".exist-address-list li",function(){s(".exist-address-list li").removeClass("active"),s(this).addClass("active"),s(this).find("input").attr("checked","checked"),s(this).hasClass("use-new-address")&&(e.$addressManage.removeClass("hide"),s(".address-manage input").val(""),s(".save-btn").removeAttr("data-id"),p.newAddress(0,"000000"))})},render:function(e,t){var n,i,a,o=this.e,r=e.promotion_formula_list,d=e.package_list,l="",c="";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>:'),c=r[n].isExpress?"total-express-w":"",l+='<li class="'+c+'"><label>'+r[n].promotion+"</label><em>"+r[n].promotion_amount+"</em></li>";o.$payTotal.html(l),o.$toPay.html(e.last_order_amount.toFixed(2)),s("#biprice").val(v(100,e.use_yoho_coin)),0===~~e.use_yoho_coin?s(".errbitip").text(""):s(".errbitip").text("抵扣"+e.use_yoho_coin.toFixed(2)+"元"),a=o.$useEnvelopesInput.data("all")-e.use_red_envelopes,~~e.use_red_envelopes>0?(o.$useEnvelopes.find("span").html("-¥"+e.use_red_envelopes.toFixed(2)),o.$useEnvelopes.find("input").attr("data-use",e.use_red_envelopes)):(o.$useEnvelopes.find("span").html("-¥0.00"),o.$hasEnvelopes.html("¥"+(1*o.$useEnvelopesInput.attr("data-all")).toFixed(2)),o.$redEnvelopes.removeClass("active"),o.$useEnvelopesInput.prop("checked",!1)),o.$hasEnvelopes.html("¥"+a.toFixed(2)),d&&o.$expressFee.each(function(e,t){var n=d[e].shopping_orig_cost,i=d[e].shopping_cut_cost,a=d[e].shopping_cost,o=0===parseInt(n)?"运费:¥0.00元":"运费:¥"+a+"元(原价"+n+"元,优惠"+i+")元";s(t).text(o)})}},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=y.Data;return s.each(y.Data,function(t,n){e[t]=parseFloat(y.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:s("#juansubmit"),$juantip:s(".errtip",".play-juan-pan"),$biok:s("#bisubmit"),$carriageGroup:s('input[name="carriagegroup"]'),$selectExpress:s(".express-list input"),$bp:s("#biprice"),$errorTip:s(".errbitip"),$useEnvelopes:s(".use-envelopes"),$hasEnvelopes:s(".has-envelopes span"),$useEnvelopesInput:s(".use-envelopes").find("input"),$redEnvelopes:s(".red-envelopes"),$loading:s(".loading")},init:function(){function e(e){var t,n=s('.play-juan.is-select input[name="juangroup"]:checked'),i=s('.express-list input[name="carriagegroup"]:checked').val(),a=s("#biprice.is-select").val(),o=n.val(),r=s(".address-manage").attr("cart-type"),d=s(".use-envelopes input:checked").attr("data-use");o=o?o:n.closest("li").find("#juancode").val(),t={cartType:r,deliveryWay:i,couponCode:o,yohoCoin:a},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,a=this.e,o=y.UI,r=y.Common;a.$selectExpress.click(function(){var t=s(this).val();a.$loading.show(),e(function(e){e.deliveryWay=t,n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(o.render(e.data),"1"===t?s(".express-list.sf").addClass("hide"):"2"===t&&s(".express-list.sf").removeClass("hide")):new g.Alert(e.message).show()}},s.ajax(n)})}),a.$juanok.click(function(){var t=s(this).parents("dl.pan"),i="";s(".play-juan").addClass("is-select"),e(function(e){var d=e.couponCode;d?(a.$loading.show(),n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(i=s('.play-juan input[value="'+d+'"]').next().text(),o.render(e.data,i),r.winHide(t),a.$juantip.html("")):(a.$juantip.html(e.message),s(".play-juan").removeClass("is-select"))}},s.ajax(n)):(a.$juantip.html("请选择或填写一个优惠券"),s(".play-juan").removeClass("is-select"))})}),s(document).on("click",".juan-modify",function(){var e=s(".play-juan-pan");r.winShow(e)}),a.$biok.click(function(){var t,i=s(this).parents("dl.pan");s("#biprice").addClass("is-select"),e(function(e){e.couponCode&&(t=s('.play-juan input[value="'+e.couponCode+'"]').next().text()),/^\d+$/.test(e.yohoCoin+"")&&1*e.yohoCoin!==0?1*e.yohoCoin>1*s(".play-pan em").text()?(s(".errbitip").html("您的YOHO币不足"),s("#biprice").removeClass("is-select")):(a.$loading.show(),n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(o.render(e.data,t),r.winHide(i)):(s(".errbitip").html(e.message),s("#biprice").removeClass("is-select"))}},s.ajax(n)):(s(".errbitip").html("请输入一个正整数"),s("#biprice").removeClass("is-select"))})}),s(document).on("click",".bi-modify",function(){var e=s(".play-bi-pan");r.winShow(e)}),a.$bp.keyup(function(){var e=s(this).val();/^\d+$/.test(e+"")?1*e>1*s(this).data("bi")?a.$errorTip.html("您的YOHO币不足"):a.$errorTip.html("抵扣"+(e/100).toFixed(2)+"元"):a.$errorTip.html("请输入一个正整数")}),s(".cancel-bi").click(function(){var t,i=s(".play-bi-pan");s(".errbitip").html(""),s("#biprice").hasClass("is-select")?(a.$loading.show(),e(function(e){e.yohoCoin=0,e.couponCode&&(t=s('.play-juan input[value="'+e.couponCode+'"]').next().text()),n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(o.render(e.data,t),r.winHide(i),s("#biprice").val("0"),s("#biprice").removeClass("is-select"),s(".errbitip").html("")):s(".errbitip").html(e.message)}},s.ajax(n)})):(r.winHide(i),s("#biprice").val("0"))}),s(".cancel-code").click(function(){var t=s(".play-juan-pan");s(".play-juan").hasClass("is-select")?(a.$loading.show(),e(function(e){e.couponCode="",n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(o.render(e.data),r.winHide(t),s(".play-juan").removeClass("is-select"),s("#juancode").val("").siblings('input[name="juangroup"]').attr("checked","checked")):a.$juantip.html(e.message)}},s.ajax(n)})):r.winHide(t)}),i=a.$useEnvelopesInput.data("all")-a.$useEnvelopesInput.data("use"),a.$hasEnvelopes.text("¥"+i.toFixed(2)),a.$useEnvelopes.find("input").click(function(){var t,i=s(this);a.$loading.show(),i.attr("disabled","disabled"),e(function(e){i.attr("checked")?e.redEnvelopes=i.data("use"):e.redEnvelopes=0,t=s('.play-juan input[value="'+e.couponCode+'"]').next().text(),n={type:"POST",url:"/cart/index/orderCompute",data:e,success:function(e){a.$loading.hide(),200===e.code?(o.render(e.data,t),i.removeAttr("disabled"),i.attr("checked")?a.$redEnvelopes.addClass("active"):(a.$useEnvelopes.find("span").html("-¥0.00"),a.$hasEnvelopes.html("¥"+(1*i.attr("data-all")).toFixed(2)),a.$redEnvelopes.removeClass("active"))):new g.Alert(e.message).show()}},s.ajax(n)})}),t(s("#piaodesc"),30),t(s("#notedesc"),100)}}};y.Data.activity=0,y.Data.carriage=0,y.UI.init(),y.Bll.init(),p.getUserAddressList(),p.newAddress(0,"000000"),p.modifyAddress(),p.saveAddress(),s(".why").click(function(){return s("#differentBag").show(),!1}),s("#differentBag").click(function(){return!1}),s(document).click(function(){s("#differentBag").hide()}),s(".bag").find("ul").each(function(){var e=s(this).parent().parent().find(".pre"),t=s(this).parent().parent().find(".next"),n=s(this).find("li").eq(0).width(),a=s(this).find("li").size(),o=n*a;s(this).css("width",o),a>5?(e.show(),t.show(),i(e,t,s(this),n)):(e.hide(),t.hide())}),r.click(function(){m=s("#recordMobileNumb").val(),function(e){o=e.substr(0,3)+"****"+e.substr(7),s("#input-mobile").val(o)}(m),r.hasClass("active")&&(r.removeAttr("checked"),r.removeClass("active"),s(".section-play .invoice-content-outter").addClass("hide")),r.attr("checked")&&(r.addClass("active"),s(".invoice-content-outter").hasClass("hide")&&d.removeClass("hide"))}),l.click(function(){a()}),c.click(function(){d.addClass("hide"),s(".invoice-content-outter").hasClass("hide")&&(r.removeAttr("checked"),r.removeClass("active"))}),s(".revise").click(function(){d.removeClass("hide")}),u.click(function(){u.addClass("receipt-type-selected"),h.removeClass("receipt-type-selected"),s(".e-receipt-desc").removeClass("hide"),s(".invoice-phone").removeClass("hide")}),h.click(function(){h.addClass("receipt-type-selected"),u.removeClass("receipt-type-selected"),s(".e-receipt-desc").addClass("hide"),s(".invoice-phone").addClass("hide")}),s(".invoice-title").change(function(){var e=s('input[name="title"]:checked').val();"1"===e?(f="个人",s(".invoice-title").addClass("invoice-title-personal-hight"),s(".invoice-title .input-line").addClass("hide")):(f="单位",s(".invoice-title").removeClass("invoice-title-personal-hight"),s(".invoice-title .input-line").removeClass("hide"))}),s("#input-organization-name").bind("input propertychange",function(){s(this).val().length>=1&&s(".invoice-title .enpty-input").addClass("hide")}),s("#input-mobile").bind("input propertychange",function(){s(this).val().length>=1&&s(".invoice-phone .enpty-input").addClass("hide")})}),define("js/order/address",["jquery","handlebars","source-map"],function(e,t,n){function i(e,t,n){var i,a,o="",s="";for(i=0;i<t.length;i++)s="Y"===t[i].is_support_express?"*":"",o+=t[i].id===n?'<option selected value="'+t[i].id+'">'+s+t[i].caption+"</option>":'<option value="'+t[i].id+'">'+s+t[i].caption+"</option>";"province"===e.attr("name")?a='<option value="0">请选择省份</option>':"city"===e.attr("name")?a='<option value="0">请选择城市</option>':"county"===e.attr("name")&&(a='<option value="0">请选择区县</option>'),e.html(a+o)}function a(e,t){var n,a=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){i(n,e.data,a),"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,i=c(".play-juan ul"),a="";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++)a+='<li><input name="juangroup" type="radio" value="'+t[n].code+'" '+(t[n].valid?"":'disabled="disabled"')+"><label>"+t[n].desc+"</label></li>";i.prepend(c(a))}})}function l(e){return"N"!==e}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"),I=c(".loading"),E=c("#order-edit-main"),A=c(".invoice"),F=p.attr("cart-type");I.show(),t.getUserAddressList=function(){var e,t,n="",i="",a="",o="",s=0;c.ajax({type:"GET",url:"/cart/index/getAddress",dataType:"json"}).then(function(r){if(I.hide(),200===r.code){if(e=r.data.list,!e)return E.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?(i="checked",a="active address_select",s++,o="默认地址",c("#recordMobileNumb").val(e[t].completeMobile)):(i="",a="hide",o="设为默认地址"),n+='<li data-id="'+e[t].id+'" class="'+a+'" 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-completeMobile="'+e[t].completeMobile+'" 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" '+i+' /><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,i=/[0-9]{2}/gi,o=!!t&&t.match(i);a({id:n,type:"getProvince",selectId:o[0]},function(){var e=f.val();"0"!==e?a({id:e,type:"getCity",selectId:""+o[0]+o[1]},function(){var e=m.val();"0"!==e&&a({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>')):(a({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>'):a({id:e.val(),type:"getCounty"}))})},t.modifyAddress=function(){y.click(function(e){var n=c(e.target),i=n.closest("li").attr("data-id"),a=n.closest("li").find(".radio").attr("data-areaCode");n.hasClass("address-modify")?(p.removeClass("hide"),t.newAddress(0,a),s(n.closest("li").find(".radio")),c(".address-list-inner .save-btn").removeClass("hide"),k.attr("data-id",i),h=!0):n.hasClass("address-del")?(I.show(),c.ajax({type:"POST",url:"/cart/index/delAddress",data:{id:i}}).then(function(e){I.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")&&(I.show(),c.ajax({type:"post",url:"/cart/index/setDefaultAddress",data:{id:i}}).then(function(e){I.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,i,a=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(),I=x.val(),E=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:I,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}$/,N=/^[0-9]{6}$/,L=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,$=/^[0-9]{3,5}$/,z=/^[0-9]{5,10}$/;if(i=c('.exist-address-list li:not(".use-new-address")').find('input[name="address"]:checked').length>0,c(".add-address").attr("checked")||!i||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"),c("#recordMobileNumb").val(c(".exist-address-list li.active input").attr("data-completemobile")),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&&!L.test(q))return void new u.Alert("你输入的邮箱格式不正确").show();if(I&&!N.test(I))return void new u.Alert("你输入的邮编格式不正确").show();k.attr("data-id")&&(U.id=k.attr("data-id")),c("#recordMobileNumb").val(v),c.ajax({type:"post",url:"/cart/index/saveAddress",data:U}).then(function(i){var d;200===i.code?(d=i.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>"+E+" "+A+" "+F+" "+p+" "+e(I)+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>"+E+" "+A+" "+F+" "+p+" "+e(I)+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>',
a.attr("data-id")?(n=c('.exist-address-list li[data-id="'+a.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(i.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(a.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"),i=n.find('input[name="pay-type"]:checked').val(),a=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();I.show(),c.ajax({type:"POST",url:"/cart/index/orderCompute",dataType:"json",data:{cartType:F,paymentType:i}}).then(function(n){I.hide(),200===n.code?(t.find("li").eq(0).find("span").text(a),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='+i+"]").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,t,n,i,a=c(this),o=c('.exist-address-list input[name="address"]:checked').closest("li").attr("data-id"),s=c('.pay-time-modify input[name="pay-time-radio"]:checked').val(),r=c('.select-express input[name="carriagegroup"]:checked').val(),d=c('.pay-time-modify input[name="pay-type"]:checked').val(),h=c('.pay-time-modify input[name="pay-type"]:checked').data("pay"),p=c("#notedesc").val(),f=c("#biprice").val(),m=c('.pay-time-modify input[name="call-me"]:checked').val(),g=c('.play-pan input[name="isPP"]:checked').val(),v=c(".use-envelopes input:checked").attr("data-use"),y=c('.play-juan.is-select input[name="juangroup"]:checked'),b=y.val(),w=b?b:y.closest("li").find("#juancode").val();A.hasClass("active")&&(e=c(".invoice-upload-type").html(),t=c(".invoice-upload-content").html(),n=c(".invoice-upload-mobile").html(),i=c(".invoice-upload-title").html()),I.show(),a.attr("disabled")||(a.attr("disabled","disabled"),c.ajax({type:"POST",dataType:"json",url:"/cart/index/orderSub",data:{addressId:o,cartType:F,deliveryTimeId:s,deliveryWayId:r,invoiceType:e,invoiceContent:t,receiverMobile:n,invoiceTitle:i,paymentId:h,paymentType:d,remark:p,couponCode:w,yohoCoin:f,isPreContact:l(m),isPrintPrice:l(g),redEnvelopes:v}}).then(function(e){I.hide(),200===e.code?window.location.href=e.data.payUrl:new u.Alert(e.message).show()}).always(function(){a.removeAttr("disabled")}))})}),define("js/shopping/pay",["jquery"],function(e,t,n){function i(){v?u('.mode div[id="'+v+'"]').addClass("choosed-tag").parent().addClass("choose-type"):(p.eq(0).addClass("choose-type").show(),p.eq(0).find("div").addClass("choosed-tag")),m.attr("value","前往"+u("#"+y).attr("alt")),f.attr("src",u("#"+y).attr("src"))}function a(e,t){u.ajax({type:"get",url:"/common/addpaymentinterval",dataType:"json",data:{orderCode:t,payment:e}})}var o,s,r,d,l,c,u=e("jquery"),h=u(".mode div"),p=u(".mode"),f=u("#show-pay-img"),m=u("#btnby"),g=u(".light-box"),v=u("#choosePay").val(),y=u('.mode div[id="'+v+'"]').parent().data("value"),b=v?y:u(".mode").eq(0).data("value"),w=u("#payUrl").val();u.jqtab=function(e,t){u(e+" li").click(function(){return s=u(this).find("a").attr("tab"),u(e+" li").removeClass("thistab"),u(this).addClass("thistab"),u(t).hide(),u("#"+s).fadeIn(),!1})},u.jqtab("#tabs",".tab-con"),i(),p.click(function(){return o=u(this).data(),b=o.value,r=u("#"+b).attr("alt"),d=u("#"+b).attr("src"),p.removeClass("choose-type"),u(this).addClass("choose-type"),h.removeClass("choosed-tag"),u(this).find(".borer-tag").addClass("choosed-tag"),m.attr("value","前往"+r),f.attr("src",d),!1}),u(".close").click(function(){g.hide()}),u(".change").click(function(){g.hide()}),u("#btnby").click(function(){c=u(".choose-type").attr("data-id"),l=u(".order-num").text(),a(c,l),window.open(w+"?order_code="+l+"&payment_type="+b),g.show()}),u(".pay-over").unbind("click").bind("click",function(){var e=this;u.post("/shopping/pay/sendPay",{orderCode:l,paymentId:c},function(){window.location.href=u(e).data("url")})})}),define("js/pay/wechatqrcode",["jquery"],function(e,t,n){function i(){a.ajax({url:s,dataType:"jsonp",success:function(e){"success"===e.message&&(window.location.href=r)}})}var a=e("jquery"),o=a(".w-odetail"),s=a("#payHost").val(),r=a("#paySuccessUrl").val(),d=a(".w-p-erm");e("plugin/jquery.qrcode"),o.click(function(){a(".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(i,3e3)}),define("plugin/jquery.qrcode",["jquery"],function(e,t,n){var i=e("jquery");!function(e){e.fn.qrcode=function(t){function n(e){this.mode=d,this.data=e}function a(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 i=0;i<e.length-n;i++)this.num[i]=e[i+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)}},a.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,i=0,a=0;a<t.length;a++)i+=t[a].dataCount;for(a=0;a<this.dataList.length;a++)t=this.dataList[a],n.put(t.mode,4),n.put(t.getLength(),l.getLengthInBits(t.mode,e)),t.write(n);if(n.getLengthInBits()<=8*i)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 i=0;i<this.moduleCount;i++)this.modules[n][i]=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=a.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 i=-1;7>=i;i++)-1>=t+i||this.moduleCount<=t+i||(this.modules[e+n][t+i]=n>=0&&6>=n&&(0==i||6==i)||i>=0&&6>=i&&(0==n||6==n)||n>=2&&4>=n&&i>=2&&4>=i)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;8>n;n++){this.makeImpl(!0,n);var i=l.getLostPoint(this);(0==n||e>i)&&(e=i,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,i=0;i<this.modules[t].length;i++){var a=1*i;this.modules[t][i]&&(e.beginFill(0,100),e.moveTo(a,n),e.lineTo(a+1,n),e.lineTo(a+1,n+1),e.lineTo(a,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 i=e[t],a=e[n];if(null==this.modules[i][a])for(var o=-2;2>=o;o++)for(var s=-2;2>=s;s++)this.modules[i+o][a+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(e){for(var t=l.getBCHTypeNumber(this.typeNumber),n=0;18>n;n++){var i=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;18>n;n++)i=!e&&1==(t>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i},setupTypeInfo:function(e,t){for(var n=l.getBCHTypeInfo(this.errorCorrectLevel<<3|t),i=0;15>i;i++){var a=!e&&1==(n>>i&1);6>i?this.modules[i][8]=a:8>i?this.modules[i+1][8]=a:this.modules[this.moduleCount-15+i][8]=a}for(i=0;15>i;i++)a=!e&&1==(n>>i&1),8>i?this.modules[8][this.moduleCount-i-1]=a:9>i?this.modules[8][15-i-1+1]=a:this.modules[8][15-i-1]=a;this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,i=this.moduleCount-1,a=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[i][s-r]){var d=!1;o<e.length&&(d=1==(e[o]>>>a&1)),l.getMask(t,i,s-r)&&(d=!d),this.modules[i][s-r]=d,a--,-1==a&&(o++,a=7)}if(i+=n,0>i||this.moduleCount<=i){i-=n,n=-n;break}}}},a.PAD0=236,a.PAD1=17,a.createData=function(e,t,n){for(var t=s.getRSBlocks(e,t),i=new r,o=0;o<n.length;o++){var d=n[o];i.put(d.mode,4),i.put(d.getLength(),l.getLengthInBits(d.mode,e)),d.write(i)}for(o=e=0;o<t.length;o++)e+=t[o].dataCount;if(i.getLengthInBits()>8*e)throw Error("code length overflow. ("+i.getLengthInBits()+">"+8*e+")");for(i.getLengthInBits()+4<=8*e&&i.put(0,4);0!=i.getLengthInBits()%8;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*e)&&(i.put(a.PAD0,8),!(i.getLengthInBits()>=8*e));)i.put(a.PAD1,8);return a.createBytes(i,t)},a.createBytes=function(e,t){for(var n=0,i=0,a=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,i=Math.max(i,c),a=Math.max(a,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;i>h;h++)for(d=0;d<t.length;d++)h<s[d].length&&(n[c++]=s[d][h]);for(h=0;a>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,i=0;t>i;i++)for(var a=0;t>a;a++){for(var o=0,s=e.isDark(i,a),r=-1;1>=r;r++)if(!(0>i+r||i+r>=t))for(var d=-1;1>=d;d++)0>a+d||a+d>=t||0==r&&0==d||s==e.isDark(i+r,a+d)&&o++;o>5&&(n+=3+o-5)}for(i=0;t-1>i;i++)for(a=0;t-1>a;a++)o=0,e.isDark(i,a)&&o++,e.isDark(i+1,a)&&o++,e.isDark(i,a+1)&&o++,e.isDark(i+1,a+1)&&o++,(0==o||4==o)&&(n+=3);for(i=0;t>i;i++)for(a=0;t-6>a;a++)e.isDark(i,a)&&!e.isDark(i,a+1)&&e.isDark(i,a+2)&&e.isDark(i,a+3)&&e.isDark(i,a+4)&&!e.isDark(i,a+5)&&e.isDark(i,a+6)&&(n+=40);for(a=0;t>a;a++)for(i=0;t-6>i;i++)e.isDark(i,a)&&!e.isDark(i+1,a)&&e.isDark(i+2,a)&&e.isDark(i+3,a)&&e.isDark(i+4,a)&&!e.isDark(i+5,a)&&e.isDark(i+6,a)&&(n+=40);for(a=o=0;t>a;a++)for(i=0;t>i;i++)e.isDark(i,a)&&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 i=0;i<e.getLength();i++)t[n+i]^=c.gexp(c.glog(this.get(n))+c.glog(e.get(i)));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()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(i=0;i<e.getLength();i++)n[i]^=c.gexp(c.glog(e.get(i))+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 i=n.length/3,a=[],o=0;i>o;o++)for(var r=n[3*o+0],d=n[3*o+1],l=n[3*o+2],c=0;r>c;c++)a.push(new s(d,l));return a},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 a(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 a(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,i(n).appendTo(this)})}}(i)}),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 i=e("jquery"),a=e("js/passport/mail-phone-regx");e("jquery.placeholder"),e("plugin/jquery.qupload"),function(){function e(){var e=i(window).height();n.removeClass("hide"),a.css({"max-height":e-60}).removeClass("hide")}function t(){n.addClass("hide"),a.addClass("hide")}var n,a;0!==i(".settled-page").length&&(n=i("#mask"),a=i("#notice-container"),i("#fake-link").click(e),i("#fake-close").click(t),i("#mask").click(t))}(),function(){function t(e){i.each(e,function(e,t){i("#"+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=a.emailRegx,o=a.phoneRegx["+86"],s=/^(0|[1-9][0-9]*)$/;return i(".va, .category-item select, .for-other, .category-item").removeClass("error"),i(".va-null").each(function(){""===i(this).val()&&(i(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),i(".category-item").each(function(){0===i(this).get(0).selectedIndex&&(i(this).addClass("error"),e=!1)}),3===i('input[name="seller-role"]:checked').index()&&""===r.val()&&(e=!1,r.addClass("error")),5===i('input[name="new_cycle"]:checked').index()&&""===d.val()&&(e=!1,d.addClass("error")),5===i('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=i(this).val(),t=i(this).parent().find(".category-two"),n="<option>选择二级分类</option>";return""===e?void t.html(n):void i.ajax({url:"/shop/settled/getTwoCategory",type:"GET",data:{id:e}}).then(function(e){var i,a=[];if(200===e.code)for(a=e.data,i=0;i<a.length;i++)n+='<option value="'+a[i].id+'" >'+a[i].name+"</option>";t.html(n)})}var r,d,l,c,u,h,p,f,m,g,v,y,b,w,C=i("#category-tpl").html(),_=e("js/common/dialog").Dialog,x=window.SWFUpload;if(!(i(".settled-apply-page").length<0)){if(i("[placeholder]").placeholder(),r=i("#other-brand-relation"),d=i("#other-new-period"),l=i("#other-replenishment-period"),c=i("#category-list"),u=i("#shop-list"),h=i("#shops"),p=i("#mask, #submit-success"),f=i("#postcode"),m=i("#email"),g=i("#phone-number"),v=i("#upload-key"),y=i("#style-count"),w=v.val(),v.remove(),t([{dom:"upload-brand-material",type:"*.ppt;*.pdf;*.zip;*.rar",callback:function(e){i("#brand-material").val(e),i(".brand-tip").html("上传成功"),alert("上传成功!")}},{dom:"upload-goods-material",type:"*.xls;*.xlsx;*.zip;*.rar",callback:function(e){i("#goods-material").val(e),i(".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();i('input[name="seller_role"]').change(function(){3===i(this).index()?r.removeClass("hide"):r.addClass("hide")}),i('input[name="new-cycle"]').change(function(){5===i(this).index()?d.removeClass("hide"):d.addClass("hide")}),i('input[name="supply-cycle"]').change(function(){5===i(this).index()?l.removeClass("hide"):l.addClass("hide")}),i('input[name="have-store"]').change(function(){1===i(this).index()?u.addClass("hide"):u.removeClass("hide")}),i(".form-container").on("change",".category-one",s),i("#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>')}),i("#apply-post").click(function(){var e;n()?(p.removeClass("hide"),i("form").submit()):(i(".error").first().focus(),e=i(".error").first().offset().top,i(window).scrollTop(e-10))}),navigator.userAgent.indexOf("MSIE")>=0&&i("[placeholder]").focus(function(){var e=i(this);e.removeClass("placeholder")}).blur(function(){var e=i(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 i(e){var t=new l(e);t.show()}function a(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",refreshOnClose:!0,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(){i(o.success)},401:function(){i(o.alreadyGot)},315:function(){i(o.expired)},400:function(){i(o.failed)},403:function(){}},r(".enable .info").on("click",function(e){e.preventDefault(),a(r(this).closest("a").data("id")),c.gunangSrc=r(this).closest("a").get(0).href})});