Authored by hf

modify fixes bug to first iteration

@@ -129,7 +129,7 @@ require("js/passport/register/password"); @@ -129,7 +129,7 @@ require("js/passport/register/password");
129 129
130 //登录 130 //登录
131 require("js/passport/login/login"); 131 require("js/passport/login/login");
132 -require("js/passport/login/interational"); 132 +require("js/passport/login/international");
133 133
134 //密码找回 134 //密码找回
135 require("js/passport/back/mobile"); 135 require("js/passport/back/mobile");
@@ -691,7 +691,7 @@ $('#cancel-retrive').on('touchstart', function(e) { @@ -691,7 +691,7 @@ $('#cancel-retrive').on('touchstart', function(e) {
691 $account.trigger('input'); 691 $account.trigger('input');
692 $pwd.trigger('input'); 692 $pwd.trigger('input');
693 }); 693 });
694 -define("js/passport/login/interational", ["zepto"], function(require, exports, module){ 694 +define("js/passport/login/international", ["zepto"], function(require, exports, module){
695 /** 695 /**
696 * 国际账号登录 696 * 国际账号登录
697 * @author: xuqi<qi.xu@yoho.cn> 697 * @author: xuqi<qi.xu@yoho.cn>
@@ -1219,10 +1219,6 @@ function setLazyLoadAndMellipsis($infos) { @@ -1219,10 +1219,6 @@ function setLazyLoadAndMellipsis($infos) {
1219 $title = $this.find('.info-title'), 1219 $title = $this.find('.info-title'),
1220 $text = $this.find('.info-text'); 1220 $text = $this.find('.info-text');
1221 1221
1222 - //减少重复调用  
1223 - if ($title.attr('title') && $text.attr('title')) {  
1224 - return;  
1225 - }  
1226 $title[0].mlellipsis(2); 1222 $title[0].mlellipsis(2);
1227 $text[0].mlellipsis(2); 1223 $text[0].mlellipsis(2);
1228 }); 1224 });
@@ -1481,6 +1477,7 @@ var $ = require("zepto"), @@ -1481,6 +1477,7 @@ var $ = require("zepto"),
1481 lazyLoad = require("lazyload"), 1477 lazyLoad = require("lazyload"),
1482 bannerSwiper, 1478 bannerSwiper,
1483 recommendSwiper, 1479 recommendSwiper,
  1480 + hotBrandsSwiper,
1484 trendTopicSwiper, 1481 trendTopicSwiper,
1485 goodsSwiper; 1482 goodsSwiper;
1486 1483
@@ -1566,12 +1563,12 @@ if ($('.banner-swiper').find('li').size() > 1) { @@ -1566,12 +1563,12 @@ if ($('.banner-swiper').find('li').size() > 1) {
1566 } 1563 }
1567 1564
1568 //热门品牌滑动 1565 //热门品牌滑动
1569 -// hotBrandsSwiper = new Swiper('.brands-swiper', {  
1570 -// grabCursor: true,  
1571 -// slidesPerView: 'auto',  
1572 -// wrapperClass: 'brands-list',  
1573 -// slideElement: 'li'  
1574 -// }); 1566 +hotBrandsSwiper = new Swiper('.brands-swiper', {
  1567 + grabCursor: true,
  1568 + slidesPerView: 'auto',
  1569 + wrapperClass: 'brands-list',
  1570 + slideElement: 'li'
  1571 +});
1575 1572
1576 //推荐搭配滑动 1573 //推荐搭配滑动
1577 recommendSwiper = new Swiper('.recommend-swiper', { 1574 recommendSwiper = new Swiper('.recommend-swiper', {
@@ -1804,9 +1801,7 @@ var winH = $(window).height(), @@ -1804,9 +1801,7 @@ var winH = $(window).height(),
1804 $goodList = $('.goods-list'), 1801 $goodList = $('.goods-list'),
1805 loading = false, 1802 loading = false,
1806 page = 0, 1803 page = 0,
1807 - index = 0,  
1808 - num;  
1809 - 1804 + index = 0;
1810 1805
1811 var swiper; 1806 var swiper;
1812 1807
@@ -1822,7 +1817,6 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() { @@ -1822,7 +1817,6 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() {
1822 var $this = $(this), 1817 var $this = $(this),
1823 $content; 1818 $content;
1824 1819
1825 -  
1826 if ($this.hasClass('focus')) { 1820 if ($this.hasClass('focus')) {
1827 return; 1821 return;
1828 } 1822 }
@@ -1848,7 +1842,8 @@ $(window).scroll(function () { @@ -1848,7 +1842,8 @@ $(window).scroll(function () {
1848 return; 1842 return;
1849 } 1843 }
1850 loading = true; 1844 loading = true;
1851 - num = $goodList.children('.good-info').length; 1845 +
  1846 + //num = $goodList.children('.good-info').length;
1852 $.ajax({ 1847 $.ajax({
1853 type: 'GET', 1848 type: 'GET',
1854 url: '/product/newsale/selectNewSale', 1849 url: '/product/newsale/selectNewSale',
@@ -1858,9 +1853,7 @@ $(window).scroll(function () { @@ -1858,9 +1853,7 @@ $(window).scroll(function () {
1858 }, 1853 },
1859 success: function(data) { 1854 success: function(data) {
1860 if (data === ' ') { 1855 if (data === ' ') {
1861 -  
1862 - //opt.end = true;  
1863 - loading = false; 1856 + loading = true;
1864 return; 1857 return;
1865 } 1858 }
1866 1859
@@ -1939,7 +1932,8 @@ $(window).scroll(function () { @@ -1939,7 +1932,8 @@ $(window).scroll(function () {
1939 return; 1932 return;
1940 } 1933 }
1941 loading = true; 1934 loading = true;
1942 - num = $goodList.children('.good-info').length; 1935 +
  1936 + // num = $goodList.children('.good-info').length;
1943 $.ajax({ 1937 $.ajax({
1944 type: 'GET', 1938 type: 'GET',
1945 url: '/product/newsale/selectNewSale', 1939 url: '/product/newsale/selectNewSale',
@@ -2172,7 +2166,7 @@ function search(opt) { @@ -2172,7 +2166,7 @@ function search(opt) {
2172 break; 2166 break;
2173 } 2167 }
2174 2168
2175 - if (data.data === ' ') { 2169 + if (data === ' ') {
2176 nav.end = true; 2170 nav.end = true;
2177 2171
2178 if (nav.reload) { 2172 if (nav.reload) {
@@ -2180,9 +2174,9 @@ function search(opt) { @@ -2180,9 +2174,9 @@ function search(opt) {
2180 } 2174 }
2181 } else { 2175 } else {
2182 if (nav.reload) { 2176 if (nav.reload) {
2183 - $container.html(data.data); 2177 + $container.html(data);
2184 } else { 2178 } else {
2185 - $container.append(data.data); 2179 + $container.append(data);
2186 } 2180 }
2187 2181
2188 lazyLoad($container.find('.lazy')); 2182 lazyLoad($container.find('.lazy'));
@@ -2209,6 +2203,7 @@ filter.registerCbFn(search); @@ -2209,6 +2203,7 @@ filter.registerCbFn(search);
2209 //5.当前active为筛选并且点击其他项时,隐藏筛选面板 2203 //5.当前active为筛选并且点击其他项时,隐藏筛选面板
2210 $listNav.delegate('li', 'touchstart', function() { 2204 $listNav.delegate('li', 'touchstart', function() {
2211 var $this = $(this), 2205 var $this = $(this),
  2206 + nav,
2212 navType, 2207 navType,
2213 $active; 2208 $active;
2214 2209
@@ -2230,6 +2225,17 @@ $listNav.delegate('li', 'touchstart', function() { @@ -2230,6 +2225,17 @@ $listNav.delegate('li', 'touchstart', function() {
2230 filter.showFilter(); 2225 filter.showFilter();
2231 } 2226 }
2232 } else { 2227 } else {
  2228 +
  2229 + if ($this.hasClass('new')) {
  2230 + navType = 'newest';
  2231 + } else if ($this.hasClass('price')) {
  2232 + navType = 'price';
  2233 + } else if ($this.hasClass('discount')) {
  2234 + navType = 'discount';
  2235 + }
  2236 +
  2237 + nav = navInfo[navType];
  2238 +
2233 if ($this.hasClass('active')) { 2239 if ($this.hasClass('active')) {
2234 2240
2235 //最新无排序切换 2241 //最新无排序切换
@@ -2241,34 +2247,44 @@ $listNav.delegate('li', 'touchstart', function() { @@ -2241,34 +2247,44 @@ $listNav.delegate('li', 'touchstart', function() {
2241 2247
2242 // 价格/折扣切换排序状态 2248 // 价格/折扣切换排序状态
2243 $this.find('.icon > .iconfont').toggleClass('cur'); 2249 $this.find('.icon > .iconfont').toggleClass('cur');
  2250 + $pre = $this; //更新pre为当前项
  2251 + nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
  2252 + nav.order = nav.order === 0 ? 1 : 0; //切换排序
2244 } 2253 }
2245 } else { 2254 } else {
2246 -  
2247 $active = $this.siblings('.active'); 2255 $active = $this.siblings('.active');
2248 - if ($active.hasClass('filter')) { 2256 +
2249 $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项 2257 $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
2250 2258
  2259 + if ($active.hasClass('filter')) {
  2260 +
2251 //若之前active项为筛选,则隐藏筛选面板 2261 //若之前active项为筛选,则隐藏筛选面板
2252 filter.hideFilter(); 2262 filter.hideFilter();
2253 } else { 2263 } else {
2254 - $pre = $active;  
2255 - }  
2256 2264
2257 - $active.removeClass('active');  
2258 - $this.addClass('active'); 2265 + //切换container显示
  2266 + $goodsContainer.children('.container:not(.hide)').addClass('hide');
2259 2267
2260 - $pre = $active; 2268 + switch (navType) {
  2269 + case 'newest':
  2270 + $ngc.removeClass('hide');
  2271 + break;
  2272 +
  2273 + case 'price':
  2274 + $pgc.removeClass('hide');
  2275 + break;
  2276 +
  2277 + case 'discount':
  2278 + $dgc.removeClass('hide');
  2279 + break;
  2280 + }
2261 } 2281 }
2262 2282
2263 - if ($this.hasClass('new')) {  
2264 - navType = 'newest';  
2265 - } else if ($this.hasClass('price')) {  
2266 - navType = 'price';  
2267 - } else if ($this.hasClass('discount')) {  
2268 - navType = 'discount'; 2283 + $active.removeClass('active');
  2284 + $this.addClass('active');
2269 } 2285 }
2270 2286
2271 - if (navInfo[navType].reload) { 2287 + if (nav.reload) {
2272 search(); 2288 search();
2273 } 2289 }
2274 } 2290 }
@@ -2421,7 +2437,7 @@ lazyLoad($('img.lazy')); @@ -2421,7 +2437,7 @@ lazyLoad($('img.lazy'));
2421 goodsSwiper = new Swiper('.banner-swiper', { 2437 goodsSwiper = new Swiper('.banner-swiper', {
2422 loop: true, 2438 loop: true,
2423 pagination: '.banner-top .pagination-inner', 2439 pagination: '.banner-top .pagination-inner',
2424 - slideElement: 'li', 2440 + slideElement: 'div',
2425 nextButton: '.swiper-button-next', 2441 nextButton: '.swiper-button-next',
2426 prevButton: '.swiper-button-prev' 2442 prevButton: '.swiper-button-prev'
2427 }); 2443 });
1 -define("index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,t){var s;e("js/common"),e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),e("js/index/index"),t.exports=s}),define("js/common",["zepto"],function(e,a,t){function s(e){var a,t,s=document.cookie;return document.cookie&&""!==document.cookie&&(t=s.indexOf(e+"="),t>-1&&(t+=e.length+1,a=decodeURIComponent(r.trim(s.substring(t,s.indexOf(";",t)))))),a}function n(){var e,a=s("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function i(){var e=n();return 0===e?0:e[1]}function o(){var e=s("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var r=e("zepto");!function(){var e=r("#yoho-footer"),a=e.children(".op-row"),t=n();r("body").height()<r(window).height()&&e.addClass("bottom"),0===t?a.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):a.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+t[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+t[3]+'">退出</a>'),e.removeClass("hide")}(),window.cookie=s,window.getUser=n,window.getUid=i,window.getShoppingKey=o}),define("js/passport/index",["zepto"],function(e,a,t){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/interational"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#phone-num"),i=s("#country-select"),o=s("#area-code"),r=s("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=s.trim,p=d.show;l.selectCssHack(s("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?s.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["zepto"],function(e,a,t){function s(){var e,a=r(".has-eye");a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(e){var a=r(this),t=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?t.attr("type","password"):t.attr("type","text"),t.focus()})}function n(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var t=e.siblings(".input");t.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),t=l(e.val());""===t?a.hide():a.show()})}function i(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var t=navigator.userAgent;t.match(/uc/i)&&t.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("zepto"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+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][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};t.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:s,bindClearEvt:n,pwdValidate:i,selectCssHack:o}}),define("js/plugin/tip",["zepto"],function(e,a,t){function s(e,a){var t,s;"undefined"!=typeof e&&(t=e.toString(),s=a&&a>0?a:2e3,n.text(t).show(),i=setTimeout(function(){"block"===n.css("display")&&n.hide()},s))}var n,i,o=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),n=o("#yoho-tip"),n.on("touchstart",function(){n.hide(),clearTimeout(i)})}(),a.show=s}),define("js/passport/register/code",["zepto"],function(e,a,t){e("js/passport/code")(!0)}),define("js/passport/code",["zepto"],function(e,a,t){var s=e("zepto");t.exports=function(a){function t(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var n=s("#captcha"),i=s("#btn-next"),o=s("#captcha-tip"),r=s("#phone-num").val(),l=s("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=s.trim,u=c.show,h=a?"reg":"back";d.bindClearEvt(),n.bind("input",function(){""!==p(n.val())?i.removeClass("disable"):i.addClass("disable")}),o.on("touchstart",function(){o.hasClass("disable")||s.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),t()):u(e.message)}})}),i.on("touchstart",function(){i.hasClass("disable")||s.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:p(n.val()),token:s("#token").val()},success:function(e){200===e.code?location.href=e.data:u(e.message)}})}),t()}}),define("js/passport/register/password",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#pwd"),i=s("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show;o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):s.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:s("#phone-num").val(),areaCode:s("#area-code").val(),token:s("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["zepto"],function(e,a,t){function s(){u&&h?d.removeClass("disable"):d.addClass("disable")}function n(){c.show(),p.show()}function i(){c.hide(),p.hide()}var o=e("zepto"),r=o("#account"),l=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),p=o("#retrive-pwd-ways"),u=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),v=o.trim,m=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){u=""!==v(r.val())?!0:!1,s()}),l.bind("input",function(){h=""===v(l.val())?!1:!0,s()}),d.on("touchstart",function(){var e=v(r.val()),a=v(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(m("登录成功"),setTimeout(function(){location.href=e.data},1e3)):m(e.message)},error:function(){m("网络断开连接啦~")}}):m("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("touchstart",function(){n()}),c.on("touchstart",function(){i()}),o("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),i()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/interational",["zepto"],function(e,a,t){function s(){c&&p?d.removeClass("disable"):d.addClass("disable")}var n=e("zepto"),i=n("#phone-num"),o=n("#country-select"),r=n("#area-code"),l=n("#pwd"),d=n("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),h=e("js/plugin/tip"),f=n.trim,g=h.show;u.selectCssHack(o),u.bindEyesEvt(),u.bindClearEvt(),i.bind("input",function(){c=""===f(i.val())?!1:!0,s()}),l.bind("input",function(){var e=f(l.val());p=""===e?!1:!0,s()}),o.change(function(){r.text(o.val())}),d.on("touchstart",function(){var e=f(i.val()),a=o.val(),t=f(l.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(t)?n.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:t},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),i.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#phone-num"),i=s("#country-select"),o=s("#area-code"),r=s("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=s.trim,p=d.show;l.selectCssHack(s("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?s.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["zepto"],function(e,a,t){e("js/passport/code")(!1)}),define("js/passport/back/email",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#email"),i=s("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show;o.bindClearEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.emailRegx.test(e)?s.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#resend"),i=e("js/plugin/tip"),o=i.show;n.on("touchstart",function(e){e.preventDefault(),s.ajax({url:n.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#pwd"),i=s("#btn-ok"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show,c=s("#phone-num");o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e,a,t=l(n.val()),r=!0;i.hasClass("disable")||(e={password:t},0===c.length&&(r=!1),r?(s.extend(e,{phoneNum:c.val(),areaCode:s("#areaCode").val(),token:s("#token").val()}),a="/passport/back/passwordByMobile"):(s.extend(e,{code:s("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(t)?s.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/guang/index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,t){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list")}),define("js/guang/plus-star/list",["zepto","lazyload","swiper","index"],function(e,a,t){var s,n=e("zepto"),i=e("lazyload"),o=e("swiper"),r=n("#nav-tab > li"),l=n("#ps-content > .content");i(n("img.lazy")),s=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),n("#nav-tab").delegate("li","touchstart",function(){n(this).hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),n(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,t){var s,n,i=e("zepto"),o=e("mlellipsis"),r=e("lazyload"),l=i("#intro"),d=i("#intro-more-txt"),c=i("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),h=i("#brand-info").data("id");o.init(),r(i("img.lazy")),l[0].mlellipsis(3),setTimeout(function(){s=l.text(),n=l.attr("title")}),p.initInfosEvt(c),i("#more-intro").bind("touchstart",function(){var e=i(this);e.toggleClass("spread"),e.hasClass("spread")?(l.text(n),d.text("收起")):(l.text(s),d.text("more"))}),i("#brand-like").bind("touchstart",function(e){var a="ok",t=i(this);e.preventDefault(),t.hasClass("like")&&(a="cancel"),i.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:h,opt:a},success:function(e){200===e.code?t.toggleClass("like"):400===e.code&&u.show("未登录")},error:function(){u.show("网络断开连接了~")}})})}),define("js/guang/info",["zepto","mlellipsis","lazyload"],function(e,a,t){function s(e){l(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),t=e.find(".info-text");a.attr("title")&&t.attr("title")||(a[0].mlellipsis(2),t[0].mlellipsis(2))})}function n(e){e.delegate(".like-btn","touchstart",function(e){var a=o(e.currentTarget),t=a.closest(".guang-info"),s="ok";a.hasClass("like")&&(s="cancel"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:t.data("id"),opt:s},success:function(e){var t=e.code;200===t&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),s(e.find(".guang-info"))}function i(e,a){h||a.end||(h=!0,o.ajax({type:"GET",url:" /guang/list/page",data:a,success:function(t){return" "===t?(a.end=!0,h=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(t),s(e.find(".guang-info")),a.page++,void(h=!1))},error:function(){d.show("网络断开连接了~"),h=!1}}))}var o=e("zepto"),r=e("mlellipsis"),l=e("lazyload"),d=e("js/plugin/tip"),c=o("#load-more-info"),p=o(""),u=o(""),h=!1;r.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=n,a.setLazyLoadAndMellipsis=s,a.loadMore=i}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,t){var s,n=e("zepto"),i=e("swiper"),o=e("js/guang/info"),r=o.setLazyLoadAndMellipsis,l=o.loadMore,d=n("#load-more-info"),c=n(""),p=n(""),u=n(window).height(),h=d.height(),f=n("#info-list"),g=f.children(".info-list"),v=n("#guang-nav"),m=v.children(".focus"),w=m.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),s=new i(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),o.initInfosEvt(f),function(){var e=n("#gender").val();v.children(".guang-nav-item").each(function(){var a=n(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),v.delegate(".guang-nav-item","touchstart",function(){var e,a,t=n(this);t.hasClass("focus")||(a=t.index(),t.addClass("focus"),m.removeClass("focus"),g.not(".hide").addClass("hide"),e=g.eq(a),e.removeClass("hide"),r(e.children(".guang-info")),m=t,w=t.data("type"),b[w].end?(c.addClass("hide"),p.removeClass("hide")):(c.removeClass("hide"),p.addClass("hide")))}),n(document).scroll(function(){n(window).scrollTop()+u>=n(document).height()-h&&l(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,t){var s=e("zepto"),n=e("js/guang/info"),i=n.loadMore,o=s(window).height(),r=s("#load-more").height(),l=s("#author-infos"),d=s("#tag"),c={page:1,end:!1},p=s("#info-list");n.initInfosEvt(p),l.length>0&&s.extend(c,{authorId:l.data("id")}),d.length>0&&s.extend(c,{tag:d.val()}),s(document).scroll(function(){s(window).scrollTop()+o>=s(document).height()-r&&i(p,c)})}),define("js/home/index",["zepto","swiper","lazyload","index"],function(e,a,t){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["zepto","swiper","lazyload","index"],function(e,a,t){function s(){v+=10,m.css({transform:"rotateX("+v+"deg)","-webkit-transform":"rotateX("+v+"deg)","-moz-transform":"rotateX("+v+"deg)"}),v/90%2===1&&(w?(m.addClass("animate"),w=!1):(m.removeClass("animate"),w=!0)),v/90%2===0&&v%360!==0?window.setTimeout(s,3e3):v%360===0?window.setTimeout(s,18e4):l(function(){s()})}var n,i,o,r,l,d,c,p,u,h=e("zepto"),f=e("swiper"),g=e("lazyload"),v=0,m=h(".home-header .logo"),w=!0;e("js/home/maybe-like"),g(h("img.lazy")),h(".nav-btn").on("click",function(e){h(this).hasClass("menu-open")||(h(".mobile-wrap").addClass("menu-open"),h(".overlay").addClass("show"),h(".side-nav").addClass("on"),h("body").css({height:h(window).height(),width:"100%",overflow:"hidden"})),e.stopPropagation()}),h(".mobile-wrap").on("click",function(){h(this).hasClass("menu-open")&&(h(".mobile-wrap").removeClass("menu-open"),h(".overlay").removeClass("show"),h(".sub-nav").removeClass("show"),h(".side-nav").removeClass("on"),h("body").css({height:"auto",overflow:"auto"}))}),h(".side-nav").on("click","li",function(){h(this).find(".sub-nav").size()>0&&(h(".sub-nav").removeClass("show"),h(this).find(".sub-nav").addClass("show"))}),h(".sub-nav").each(function(){h(this).find("li").eq(0).on("click",function(e){h(".sub-nav").removeClass("show"),e.stopPropagation()})}),h(".sub-nav").on("mouseenter","li",function(){0!==h(this).index()&&h(this).addClass("current").siblings().removeClass("current")}),h(".banner-swiper").find("li").size()>1&&(n=new f(".banner-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),i=new f(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),h(".trend-topic-swiper").find("li").size()>1&&(o=new f(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),h(".category-swiper").each(function(e,a){p="category-swiper"+e,h(this).addClass(p),h("."+p).find(".swiper-slide").size()>1&&(r=new f("."+p,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+p+" .pagination-inner"}))}),h(".header-download").on("click",".close-btn",function(){h(this).parent().remove()}),l=function(){var e=null,a=["webkit","moz","ms"];for(c=0;c<a.length;c++)d=a[c]+"RequestAnimationFrame",window[d]&&(u=!0,e=d);return u?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),s()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,t){var s,n,i,o,r=e("zepto"),l=e("js/plugin/tip"),d=e("lazyload"),c=r(window).height(),p=r("#load-more").height(),u=r("#goods-list"),h=!1,f=0,g=r(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",v=r(".mobile-wrap").hasClass("kids-wrap")?!0:!1,m=r(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=r("#maybe-like-nav");n=v?"/product/recom/maylikekids":m?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,i=w.children(".focus"),r("#maybe-like-nav").delegate("li","touchstart",function(){var e,a=r(this),t=r(".goods-list");a.hasClass("focus")||(o=a.index(),a.addClass("focus"),i.removeClass("focus"),t.not(".hide").addClass("hide"),e=t.eq(o),e.removeClass("hide"),i=a,r(document).trigger("scroll"))}),r(window).scroll(function(){if(r(window).scrollTop()+c>=r(document).height()-p){if(h)return;h=!0,s=u.children(".good-info").length,r.ajax({type:"GET",url:n,data:{page:f+1},success:function(e){return" "===e?void(h=!0):(u.append(e),d(r(".good-info").find("img.lazy")),h=!1,void f++)},error:function(){l.show("网络断开连接了~"),h=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,t){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,t){var s,n,i,o=e("zepto"),r=e("js/plugin/tip"),l=e("swiper"),d=e("lazyload"),c=o("#newarrival-nav"),p=o("#newarrival-goods-list"),u=p.children(".goods-list"),h=o(window).height(),f=o("#load-more").height(),g=o(".goods-list"),v=!1,m=0,w=0;i=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),d(o("img.lazy")),s=c.children(".focus"),o("#newarrival-nav").delegate("li","touchstart",function(){var e,a=o(this);a.hasClass("focus")||(w=a.index(),a.addClass("focus"),s.removeClass("focus"),u.not(".hide").addClass("hide"),e=u.eq(w),e.removeClass("hide"),s=a,o(document).trigger("scroll"))}),o(window).scroll(function(){if(o(window).scrollTop()+h>=o(document).height()-f){if(v)return;v=!0,n=g.children(".good-info").length,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{dayLimit:w+1,page:m+1},success:function(e){return" "===e?void(v=!1):(g.append(e),d(o(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){r.show("网络断开连接了~"),v=!1}})}})}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,t){function s(e){var a="0.1,0.3";switch(e){case 0:a="0.1,0.3";break;case 1:a="0.4,0.6";break;case 2:a="0.7,0.9";break;case 3:a="0.1,0.9"}return a}var n,i,o=e("zepto"),r=e("swiper"),l=e("lazyload"),d=o("#discount-nav"),c=o("#discount-goods-list"),p=c.children(".goods-list"),u=o(".goods-list"),h=0,f=o(window).height(),g=o("#load-more").height(),v=!1,m=0,w="";i=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l(o("img.lazy")),n=d.children(".focus"),o("#discount-nav").delegate("li","touchstart",function(){var e,a=o(this);a.hasClass("focus")||(h=a.index(),w=s(h),a.addClass("focus"),n.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(h),e.removeClass("hide"),n=a,o(document).trigger("scroll"))}),o(window).scroll(function(){if(o(window).scrollTop()+f>=o(document).height()-g){if(v)return;v=!0,num=u.children(".good-info").length,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{p_d:w,page:m+1},success:function(e){return" "===e?void(v=!1):(u.append(e),l(o(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){tip.show("网络断开连接了~"),v=!1}})}})}),define("js/product/list",["zepto","lazyload"],function(e,a,t){function s(e){var a,t,s,l,d,c={};if(e){for(t in w)w.hasOwnProperty(t)&&(w[t].reload=!0);switch(e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}o.extend(v,a)}if(!i){if(n.hasClass("new")?l="newest":n.hasClass("price")?l="price":n.hasClass("discount")&&(l="discount"),s=w[l],d=s.page+1,s.reload)d=1;else if(s.end)return;o.extend(c,v,{type:l,order:s.order,page:d}),i=!0,o.ajax({type:"GET",url:"/product/list/search",data:c,success:function(e){var a,t='<p class="no-result">未找到相关搜索结果</p>';switch(l){case"newest":a=u;break;case"price":a=h;break;case"discount":a=f}" "===e.data?(s.end=!0,s.reload&&a.html(t)):(s.reload?a.html(e.data):a.append(e.data),r(a.find(".lazy"))),s.reload=!0,s.page=d,i=!1}})}}var n,i,o=e("zepto"),r=e("lazyload"),l=o("#brand-header"),d=o("#intro-box"),c=e("js/plugin/filter"),p=o("#goods-container"),u=p.children(".new-goods"),h=p.children(".price-goods"),f=p.children(".discount-goods"),g=o(window).height(),v={gender:o("#gender").val(),brand:o("#brand").val(),msort:o("#msort").val(),color:o("#color").val(),size:o("#size").val(),price:o("#price").val(),discount:o("#discount").val()},m=o("#list-nav"),w={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}};r(o(".lazy")),c.registerCbFn(s),m.delegate("li","touchstart",function(){var e,a,t=o(this);if(t.hasClass("filter"))t.hasClass("active")?(c.hideFilter(),n.addClass("active"),t.removeClass("active")):(n=t.siblings(".active"),n.removeClass("active"),t.addClass("active"),c.showFilter());else{if(t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&t.find(".icon > .iconfont").toggleClass("cur")}else a=t.siblings(".active"),a.hasClass("filter")?(n=t,c.hideFilter()):n=a,a.removeClass("active"),t.addClass("active"),n=a;t.hasClass("new")?e="newest":t.hasClass("price")?e="price":t.hasClass("discount")&&(e="discount"),w[e].reload&&s()}}),o(window).scroll(function(){o(window).scrollTop()+g>o(document).height()-.25*p.height()&&s()}),l.children(".btn-intro").bind("touchstart",function(){d.removeClass("hide")}),o(".close-intro, .brand-intro-box").click(function(){d.addClass("hide")}),o("#brand-intro").click(function(e){e.stopPropagation()}),l.children(".btn-col").bind("touchstart",function(){o(this).toggleClass("coled")})}),define("js/plugin/filter",["zepto"],function(e,a,t){function s(){l.addClass("hide")}function n(){l.removeClass("hide")}function i(e){o=e}var o,r=e("zepto"),l=r(".filter-mask, .filter-body"),d=l.find(".classify"),c=l.find(".sub-classify");d.children(":first-child").addClass("active"),d.delegate(".classify-item","touchstart",function(){var e=r(this);e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}),l.filter(".filter-mask").click(function(){s()}),c.delegate("li","click",function(e){var a,t,n=r(this),i=n.data("id"),l=n.closest(".sub-classify"),d=l.siblings(".shower");e.stopPropagation(),n.hasClass("chosed")||(l.children(".chosed").removeClass("chosed"),n.addClass("chosed"),a=r.trim(n.html()),t=r.trim(d.html()),d.html(t.substring(0,t.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===n.index()?d.addClass("default"):d.removeClass("default"),o&&o({type:l.data("type"),id:i}),s())}),a.showFilter=n,a.hideFilter=s,a.registerCbFn=i}),define("js/product/detail/detail",["zepto","swiper","lazyload","index"],function(e,a,t){var s,n=e("zepto"),i=e("swiper"),o=e("lazyload");o(n("img.lazy")),s=new i(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"li",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}),define("js/index/index",["zepto"],function(e,a,t){e("js/index/search"),e("js/index/channel")}),define("js/index/search",["zepto"],function(e,a,t){var s=e("zepto"),n=s("#search-input > input"),i=s("#search-input > .clear-input"),o=s(".history");s("#clear-history").bind("touchstart",function(){s.ajax({type:"POST",url:"/search/clearHistory",success:function(e){200===e.code&&o.html("")}})}),s("#search").bind("touchstart",function(){var e=n.val();s.ajax({type:"POST",url:"/search",data:{val:e},success:function(e){200===e.code&&(location.href=e.data)}})}),n.bind("input",function(){""===n.val()?i.addClass("hide"):i.removeClass("hide")}),i.bind("touchstart",function(){n.val("").trigger("input")})}),define("js/index/channel",[],function(e,a,t){});  
  1 +define("index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,s){var t;e("js/common"),e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),e("js/index/index"),s.exports=t}),define("js/common",["zepto"],function(e,a,s){function t(e){var a,s,t=document.cookie;return document.cookie&&""!==document.cookie&&(s=t.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(r.trim(t.substring(s,t.indexOf(";",s)))))),a}function n(){var e,a=t("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function i(){var e=n();return 0===e?0:e[1]}function o(){var e=t("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var r=e("zepto");!function(){var e=r("#yoho-footer"),a=e.children(".op-row"),s=n();r("body").height()<r(window).height()&&e.addClass("bottom"),0===s?a.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):a.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+s[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+s[3]+'">退出</a>'),e.removeClass("hide")}(),window.cookie=t,window.getUser=n,window.getUid=i,window.getShoppingKey=o}),define("js/passport/index",["zepto"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#phone-num"),i=t("#country-select"),o=t("#area-code"),r=t("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;l.selectCssHack(t("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?t.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["zepto"],function(e,a,s){function t(){var e,a=r(".has-eye");a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(e){var a=r(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function n(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),s=l(e.val());""===s?a.hide():a.show()})}function i(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("zepto"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+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][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:t,bindClearEvt:n,pwdValidate:i,selectCssHack:o}}),define("js/plugin/tip",["zepto"],function(e,a,s){function t(e,a){var s,t;"undefined"!=typeof e&&(s=e.toString(),t=a&&a>0?a:2e3,n.text(s).show(),i=setTimeout(function(){"block"===n.css("display")&&n.hide()},t))}var n,i,o=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),n=o("#yoho-tip"),n.on("touchstart",function(){n.hide(),clearTimeout(i)})}(),a.show=t}),define("js/passport/register/code",["zepto"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["zepto"],function(e,a,s){var t=e("zepto");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var n=t("#captcha"),i=t("#btn-next"),o=t("#captcha-tip"),r=t("#phone-num").val(),l=t("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=t.trim,u=c.show,h=a?"reg":"back";d.bindClearEvt(),n.bind("input",function(){""!==p(n.val())?i.removeClass("disable"):i.addClass("disable")}),o.on("touchstart",function(){o.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),s()):u(e.message)}})}),i.on("touchstart",function(){i.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:p(n.val()),token:t("#token").val()},success:function(e){200===e.code?location.href=e.data:u(e.message)}})}),s()}}),define("js/passport/register/password",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#pwd"),i=t("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show;o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):t.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:t("#phone-num").val(),areaCode:t("#area-code").val(),token:t("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["zepto"],function(e,a,s){function t(){u&&h?d.removeClass("disable"):d.addClass("disable")}function n(){c.show(),p.show()}function i(){c.hide(),p.hide()}var o=e("zepto"),r=o("#account"),l=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),p=o("#retrive-pwd-ways"),u=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),v=o.trim,m=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){u=""!==v(r.val())?!0:!1,t()}),l.bind("input",function(){h=""===v(l.val())?!1:!0,t()}),d.on("touchstart",function(){var e=v(r.val()),a=v(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(m("登录成功"),setTimeout(function(){location.href=e.data},1e3)):m(e.message)},error:function(){m("网络断开连接啦~")}}):m("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("touchstart",function(){n()}),c.on("touchstart",function(){i()}),o("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),i()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["zepto"],function(e,a,s){function t(){c&&p?d.removeClass("disable"):d.addClass("disable")}var n=e("zepto"),i=n("#phone-num"),o=n("#country-select"),r=n("#area-code"),l=n("#pwd"),d=n("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),h=e("js/plugin/tip"),f=n.trim,g=h.show;u.selectCssHack(o),u.bindEyesEvt(),u.bindClearEvt(),i.bind("input",function(){c=""===f(i.val())?!1:!0,t()}),l.bind("input",function(){var e=f(l.val());p=""===e?!1:!0,t()}),o.change(function(){r.text(o.val())}),d.on("touchstart",function(){var e=f(i.val()),a=o.val(),s=f(l.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(s)?n.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),i.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#phone-num"),i=t("#country-select"),o=t("#area-code"),r=t("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;l.selectCssHack(t("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?t.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["zepto"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#email"),i=t("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show;o.bindClearEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.emailRegx.test(e)?t.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#resend"),i=e("js/plugin/tip"),o=i.show;n.on("touchstart",function(e){e.preventDefault(),t.ajax({url:n.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#pwd"),i=t("#btn-ok"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show,c=t("#phone-num");o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e,a,s=l(n.val()),r=!0;i.hasClass("disable")||(e={password:s},0===c.length&&(r=!1),r?(t.extend(e,{phoneNum:c.val(),areaCode:t("#areaCode").val(),token:t("#token").val()}),a="/passport/back/passwordByMobile"):(t.extend(e,{code:t("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(s)?t.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/guang/index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list")}),define("js/guang/plus-star/list",["zepto","lazyload","swiper","index"],function(e,a,s){var t,n=e("zepto"),i=e("lazyload"),o=e("swiper"),r=n("#nav-tab > li"),l=n("#ps-content > .content");i(n("img.lazy")),t=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),n("#nav-tab").delegate("li","touchstart",function(){n(this).hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),n(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,s){var t,n,i=e("zepto"),o=e("mlellipsis"),r=e("lazyload"),l=i("#intro"),d=i("#intro-more-txt"),c=i("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),h=i("#brand-info").data("id");o.init(),r(i("img.lazy")),l[0].mlellipsis(3),setTimeout(function(){t=l.text(),n=l.attr("title")}),p.initInfosEvt(c),i("#more-intro").bind("touchstart",function(){var e=i(this);e.toggleClass("spread"),e.hasClass("spread")?(l.text(n),d.text("收起")):(l.text(t),d.text("more"))}),i("#brand-like").bind("touchstart",function(e){var a="ok",s=i(this);e.preventDefault(),s.hasClass("like")&&(a="cancel"),i.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:h,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code&&u.show("未登录")},error:function(){u.show("网络断开连接了~")}})})}),define("js/guang/info",["zepto","mlellipsis","lazyload"],function(e,a,s){function t(e){l(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function n(e){e.delegate(".like-btn","touchstart",function(e){var a=o(e.currentTarget),s=a.closest(".guang-info"),t="ok";a.hasClass("like")&&(t="cancel"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:s.data("id"),opt:t},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),t(e.find(".guang-info"))}function i(e,a){h||a.end||(h=!0,o.ajax({type:"GET",url:" /guang/list/page",data:a,success:function(s){return" "===s?(a.end=!0,h=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(s),t(e.find(".guang-info")),a.page++,void(h=!1))},error:function(){d.show("网络断开连接了~"),h=!1}}))}var o=e("zepto"),r=e("mlellipsis"),l=e("lazyload"),d=e("js/plugin/tip"),c=o("#load-more-info"),p=o(""),u=o(""),h=!1;r.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=n,a.setLazyLoadAndMellipsis=t,a.loadMore=i}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,s){var t,n=e("zepto"),i=e("swiper"),o=e("js/guang/info"),r=o.setLazyLoadAndMellipsis,l=o.loadMore,d=n("#load-more-info"),c=n(""),p=n(""),u=n(window).height(),h=d.height(),f=n("#info-list"),g=f.children(".info-list"),v=n("#guang-nav"),m=v.children(".focus"),w=m.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),t=new i(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),o.initInfosEvt(f),function(){var e=n("#gender").val();v.children(".guang-nav-item").each(function(){var a=n(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),v.delegate(".guang-nav-item","touchstart",function(){var e,a,s=n(this);s.hasClass("focus")||(a=s.index(),s.addClass("focus"),m.removeClass("focus"),g.not(".hide").addClass("hide"),e=g.eq(a),e.removeClass("hide"),r(e.children(".guang-info")),m=s,w=s.data("type"),b[w].end?(c.addClass("hide"),p.removeClass("hide")):(c.removeClass("hide"),p.addClass("hide")))}),n(document).scroll(function(){n(window).scrollTop()+u>=n(document).height()-h&&l(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,s){var t=e("zepto"),n=e("js/guang/info"),i=n.loadMore,o=t(window).height(),r=t("#load-more").height(),l=t("#author-infos"),d=t("#tag"),c={page:1,end:!1},p=t("#info-list");n.initInfosEvt(p),l.length>0&&t.extend(c,{authorId:l.data("id")}),d.length>0&&t.extend(c,{tag:d.val()}),t(document).scroll(function(){t(window).scrollTop()+o>=t(document).height()-r&&i(p,c)})}),define("js/home/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["zepto","swiper","lazyload","index"],function(e,a,s){function t(){m+=10,w.css({transform:"rotateX("+m+"deg)","-webkit-transform":"rotateX("+m+"deg)","-moz-transform":"rotateX("+m+"deg)"}),m/90%2===1&&(b?(w.addClass("animate"),b=!1):(w.removeClass("animate"),b=!0)),m/90%2===0&&m%360!==0?window.setTimeout(t,3e3):m%360===0?window.setTimeout(t,18e4):d(function(){t()})}var n,i,o,r,l,d,c,p,u,h,f=e("zepto"),g=e("swiper"),v=e("lazyload"),m=0,w=f(".home-header .logo"),b=!0;e("js/home/maybe-like"),v(f("img.lazy")),f(".nav-btn").on("click",function(e){f(this).hasClass("menu-open")||(f(".mobile-wrap").addClass("menu-open"),f(".overlay").addClass("show"),f(".side-nav").addClass("on"),f("body").css({height:f(window).height(),width:"100%",overflow:"hidden"})),e.stopPropagation()}),f(".mobile-wrap").on("click",function(){f(this).hasClass("menu-open")&&(f(".mobile-wrap").removeClass("menu-open"),f(".overlay").removeClass("show"),f(".sub-nav").removeClass("show"),f(".side-nav").removeClass("on"),f("body").css({height:"auto",overflow:"auto"}))}),f(".side-nav").on("click","li",function(){f(this).find(".sub-nav").size()>0&&(f(".sub-nav").removeClass("show"),f(this).find(".sub-nav").addClass("show"))}),f(".sub-nav").each(function(){f(this).find("li").eq(0).on("click",function(e){f(".sub-nav").removeClass("show"),e.stopPropagation()})}),f(".sub-nav").on("mouseenter","li",function(){0!==f(this).index()&&f(this).addClass("current").siblings().removeClass("current")}),f(".banner-swiper").find("li").size()>1&&(n=new g(".banner-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new g(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),i=new g(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),f(".trend-topic-swiper").find("li").size()>1&&(r=new g(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),f(".category-swiper").each(function(e,a){u="category-swiper"+e,f(this).addClass(u),f("."+u).find(".swiper-slide").size()>1&&(l=new g("."+u,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+u+" .pagination-inner"}))}),f(".header-download").on("click",".close-btn",function(){f(this).parent().remove()}),d=function(){var e=null,a=["webkit","moz","ms"];for(p=0;p<a.length;p++)c=a[p]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),t()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,s){var t,n,i,o,r=e("zepto"),l=e("js/plugin/tip"),d=e("lazyload"),c=r(window).height(),p=r("#load-more").height(),u=r("#goods-list"),h=!1,f=0,g=r(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",v=r(".mobile-wrap").hasClass("kids-wrap")?!0:!1,m=r(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=r("#maybe-like-nav");n=v?"/product/recom/maylikekids":m?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,i=w.children(".focus"),r("#maybe-like-nav").delegate("li","touchstart",function(){var e,a=r(this),s=r(".goods-list");a.hasClass("focus")||(o=a.index(),a.addClass("focus"),i.removeClass("focus"),s.not(".hide").addClass("hide"),e=s.eq(o),e.removeClass("hide"),i=a,r(document).trigger("scroll"))}),r(window).scroll(function(){if(r(window).scrollTop()+c>=r(document).height()-p){if(h)return;h=!0,t=u.children(".good-info").length,r.ajax({type:"GET",url:n,data:{page:f+1},success:function(e){return" "===e?void(h=!0):(u.append(e),d(r(".good-info").find("img.lazy")),h=!1,void f++)},error:function(){l.show("网络断开连接了~"),h=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,s){var t,n,i=e("zepto"),o=e("js/plugin/tip"),r=e("swiper"),l=e("lazyload"),d=i("#newarrival-nav"),c=i("#newarrival-goods-list"),p=c.children(".goods-list"),u=i(window).height(),h=i("#load-more").height(),f=i(".goods-list"),g=!1,v=0,m=0;n=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l(i("img.lazy")),t=d.children(".focus"),i("#newarrival-nav").delegate("li","touchstart",function(){var e,a=i(this);a.hasClass("focus")||(m=a.index(),a.addClass("focus"),t.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(m),e.removeClass("hide"),t=a,i(document).trigger("scroll"))}),i(window).scroll(function(){if(i(window).scrollTop()+u>=i(document).height()-h){if(g)return;g=!0,i.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{dayLimit:m+1,page:v+1},success:function(e){return" "===e?void(g=!0):(f.append(e),l(i(".good-info").find("img.lazy")),g=!1,void v++)},error:function(){o.show("网络断开连接了~"),g=!1}})}})}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,s){function t(e){var a="0.1,0.3";switch(e){case 0:a="0.1,0.3";break;case 1:a="0.4,0.6";break;case 2:a="0.7,0.9";break;case 3:a="0.1,0.9"}return a}var n,i,o=e("zepto"),r=e("swiper"),l=e("lazyload"),d=o("#discount-nav"),c=o("#discount-goods-list"),p=c.children(".goods-list"),u=o(".goods-list"),h=0,f=o(window).height(),g=o("#load-more").height(),v=!1,m=0,w="";i=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l(o("img.lazy")),n=d.children(".focus"),o("#discount-nav").delegate("li","touchstart",function(){var e,a=o(this);a.hasClass("focus")||(h=a.index(),w=t(h),a.addClass("focus"),n.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(h),e.removeClass("hide"),n=a,o(document).trigger("scroll"))}),o(window).scroll(function(){if(o(window).scrollTop()+f>=o(document).height()-g){if(v)return;v=!0,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{p_d:w,page:m+1},success:function(e){return" "===e?void(v=!1):(u.append(e),l(o(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){tip.show("网络断开连接了~"),v=!1}})}})}),define("js/product/list",["zepto","lazyload"],function(e,a,s){function t(e){var a,s,t,l,d,c={};if(e){for(s in w)w.hasOwnProperty(s)&&(w[s].reload=!0);switch(e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}o.extend(v,a)}if(!i){if(n.hasClass("new")?l="newest":n.hasClass("price")?l="price":n.hasClass("discount")&&(l="discount"),t=w[l],d=t.page+1,t.reload)d=1;else if(t.end)return;o.extend(c,v,{type:l,order:t.order,page:d}),i=!0,o.ajax({type:"GET",url:"/product/list/search",data:c,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(l){case"newest":a=u;break;case"price":a=h;break;case"discount":a=f}" "===e?(t.end=!0,t.reload&&a.html(s)):(t.reload?a.html(e):a.append(e),r(a.find(".lazy"))),t.reload=!0,t.page=d,i=!1}})}}var n,i,o=e("zepto"),r=e("lazyload"),l=o("#brand-header"),d=o("#intro-box"),c=e("js/plugin/filter"),p=o("#goods-container"),u=p.children(".new-goods"),h=p.children(".price-goods"),f=p.children(".discount-goods"),g=o(window).height(),v={gender:o("#gender").val(),brand:o("#brand").val(),msort:o("#msort").val(),color:o("#color").val(),size:o("#size").val(),price:o("#price").val(),discount:o("#discount").val()},m=o("#list-nav"),w={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}};r(o(".lazy")),c.registerCbFn(t),m.delegate("li","touchstart",function(){var e,a,s,i=o(this);if(i.hasClass("filter"))i.hasClass("active")?(c.hideFilter(),n.addClass("active"),i.removeClass("active")):(n=i.siblings(".active"),n.removeClass("active"),i.addClass("active"),c.showFilter());else{if(i.hasClass("new")?a="newest":i.hasClass("price")?a="price":i.hasClass("discount")&&(a="discount"),e=w[a],i.hasClass("active")){if(i.hasClass("new"))return;(i.hasClass("price")||i.hasClass("discount"))&&(i.find(".icon > .iconfont").toggleClass("cur"),n=i,e.reload=!0,e.order=0===e.order?1:0)}else{if(s=i.siblings(".active"),n=i,s.hasClass("filter"))c.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),a){case"newest":u.removeClass("hide");break;case"price":h.removeClass("hide");break;case"discount":f.removeClass("hide")}s.removeClass("active"),i.addClass("active")}e.reload&&t()}}),o(window).scroll(function(){o(window).scrollTop()+g>o(document).height()-.25*p.height()&&t()}),l.children(".btn-intro").bind("touchstart",function(){d.removeClass("hide")}),o(".close-intro, .brand-intro-box").click(function(){d.addClass("hide")}),o("#brand-intro").click(function(e){e.stopPropagation()}),l.children(".btn-col").bind("touchstart",function(){o(this).toggleClass("coled")})}),define("js/plugin/filter",["zepto"],function(e,a,s){function t(){l.addClass("hide")}function n(){l.removeClass("hide")}function i(e){o=e}var o,r=e("zepto"),l=r(".filter-mask, .filter-body"),d=l.find(".classify"),c=l.find(".sub-classify");d.children(":first-child").addClass("active"),d.delegate(".classify-item","touchstart",function(){var e=r(this);e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}),l.filter(".filter-mask").click(function(){t()}),c.delegate("li","click",function(e){var a,s,n=r(this),i=n.data("id"),l=n.closest(".sub-classify"),d=l.siblings(".shower");e.stopPropagation(),n.hasClass("chosed")||(l.children(".chosed").removeClass("chosed"),n.addClass("chosed"),a=r.trim(n.html()),s=r.trim(d.html()),d.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===n.index()?d.addClass("default"):d.removeClass("default"),o&&o({type:l.data("type"),id:i}),t())}),a.showFilter=n,a.hideFilter=t,a.registerCbFn=i}),define("js/product/detail/detail",["zepto","swiper","lazyload","index"],function(e,a,s){var t,n=e("zepto"),i=e("swiper"),o=e("lazyload");o(n("img.lazy")),t=new i(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}),define("js/index/index",["zepto"],function(e,a,s){e("js/index/search"),e("js/index/channel")}),define("js/index/search",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#search-input > input"),i=t("#search-input > .clear-input"),o=t(".history");t("#clear-history").bind("touchstart",function(){t.ajax({type:"POST",url:"/search/clearHistory",success:function(e){200===e.code&&o.html("")}})}),t("#search").bind("touchstart",function(){var e=n.val();t.ajax({type:"POST",url:"/search",data:{val:e},success:function(e){200===e.code&&(location.href=e.data)}})}),n.bind("input",function(){""===n.val()?i.addClass("hide"):i.removeClass("hide")}),i.bind("touchstart",function(){n.val("").trigger("input")})}),define("js/index/channel",[],function(e,a,s){});