index.js
19.9 KB
define("index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,t){var n;e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),t.exports=n}),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 n=e("zepto"),s=n("#phone-num"),o=n("#country-select"),i=n("#area-code"),l=n("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,p=d.show;r.selectCssHack(n("#country-select")),r.bindClearEvt(),s.bind("input",function(){""===c(s.val())?l.addClass("disable"):l.removeClass("disable")}),o.change(function(){i.text(o.val())}),l.on("touchstart",function(){var e=c(s.val()),a=o.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?n.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 n(){var e,a=l(".has-eye");a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(e){var a=l(this),t=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?t.attr("type","password"):t.attr("type","text"),t.focus()})}function s(){var e,a=l(".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=l(this),a=e.siblings(".clear-input"),t=r(e.val());""===t?a.hide():a.show()})}function o(e){return e.length>=6&&e.length<=20?!0:!1}function i(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 l=e("zepto"),r=l.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:n,bindClearEvt:s,pwdValidate:o,selectCssHack:i}}),define("js/plugin/tip",["zepto"],function(e,a,t){function n(e,a){var t,n;"undefined"!=typeof e&&(t=e.toString(),n=a&&a>0?a:2e3,s.text(t).show(),o=setTimeout(function(){"block"===s.css("display")&&s.hide()},n))}var s,o,i=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';i(".yoho-page").append(e),s=i("#yoho-tip"),s.on("touchstart",function(){s.hide(),clearTimeout(o)})}(),a.show=n}),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 n=e("zepto");t.exports=function(a){function t(){var e,a=59;e=setInterval(function(){0===a?(i.text("重发验证码").removeClass("disable"),clearInterval(e)):i.text("重发验证码 ("+a--+"秒)")},1e3)}var s=n("#captcha"),o=n("#btn-next"),i=n("#captcha-tip"),l=n("#phone-num").val(),r=n("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=n.trim,u=c.show,f=a?"reg":"back";d.bindClearEvt(),s.bind("input",function(){""!==p(s.val())?o.removeClass("disable"):o.addClass("disable")}),i.on("touchstart",function(){i.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+f+"/sendcode",data:{phoneNum:l,areaCode:r},success:function(e){200===e.code?(i.text("重发验证码 (60秒)").addClass("disable"),t()):u(e.message)}})}),o.on("touchstart",function(){o.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+f+"/verifycode",data:{phoneNum:l,areaCode:r,code:p(s.val()),token:n("#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 n=e("zepto"),s=n("#pwd"),o=n("#btn-sure"),i=e("js/passport/api"),l=e("js/plugin/tip"),r=n.trim,d=l.show;i.bindEyesEvt(),s.bind("input",function(){""===r(s.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=r(s.val());o.hasClass("disable")||(i.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):n.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:n("#phone-num").val(),areaCode:n("#area-code").val(),token:n("#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 n(){u&&f?d.removeClass("disable"):d.addClass("disable")}function s(){c.show(),p.show()}function o(){c.hide(),p.hide()}var i=e("zepto"),l=i("#account"),r=i("#pwd"),d=i("#btn-login"),c=i("#retrive-pwd-mask"),p=i("#retrive-pwd-ways"),u=!1,f=!1,h=e("js/passport/api"),g=e("js/plugin/tip"),v=i.trim,m=g.show;h.bindEyesEvt(),h.bindClearEvt(),l.bind("input",function(){u=""!==v(l.val())?!0:!1,n()}),r.bind("input",function(){f=""===v(r.val())?!1:!0,n()}),d.on("touchstart",function(){var e=v(l.val()),a=v(r.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||h.emailRegx.test(e))&&h.pwdValidate(a)?i.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("账号或密码有错误,请重新输入"))}),i("#forget-pwd").on("touchstart",function(){s()}),c.on("touchstart",function(){o()}),i("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),o()}),l.trigger("input"),r.trigger("input")}),define("js/passport/login/interational",["zepto"],function(e,a,t){function n(){c&&p?d.removeClass("disable"):d.addClass("disable")}var s=e("zepto"),o=s("#phone-num"),i=s("#country-select"),l=s("#area-code"),r=s("#pwd"),d=s("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),f=e("js/plugin/tip"),h=s.trim,g=f.show;u.selectCssHack(i),u.bindEyesEvt(),u.bindClearEvt(),o.bind("input",function(){c=""===h(o.val())?!1:!0,n()}),r.bind("input",function(){var e=h(r.val());p=""===e?!1:!0,n()}),i.change(function(){l.text(i.val())}),d.on("touchstart",function(){var e=h(o.val()),a=i.val(),t=h(r.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(t)?s.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("账号或密码有错误,请重新输入"))}),o.trigger("input"),r.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,t){var n=e("zepto"),s=n("#phone-num"),o=n("#country-select"),i=n("#area-code"),l=n("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,p=d.show;r.selectCssHack(n("#country-select")),r.bindClearEvt(),s.bind("input",function(){""===c(s.val())?l.addClass("disable"):l.removeClass("disable")}),o.change(function(){i.text(o.val())}),l.on("touchstart",function(){var e=c(s.val()),a=o.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?n.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 n=e("zepto"),s=n("#email"),o=n("#btn-sure"),i=e("js/passport/api"),l=e("js/plugin/tip"),r=n.trim,d=l.show;i.bindClearEvt(),s.bind("input",function(){""===r(s.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=r(s.val());o.hasClass("disable")||(i.emailRegx.test(e)?n.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 n=e("zepto"),s=n("#resend"),o=e("js/plugin/tip"),i=o.show;s.on("touchstart",function(e){e.preventDefault(),n.ajax({url:s.data("url"),type:"GET",success:function(e){i(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,t){var n=e("zepto"),s=n("#pwd"),o=n("#btn-ok"),i=e("js/passport/api"),l=e("js/plugin/tip"),r=n.trim,d=l.show,c=n("#phone-num");i.bindEyesEvt(),s.bind("input",function(){""===r(s.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e,a,t=r(s.val()),l=!0;o.hasClass("disable")||(e={password:t},0===c.length&&(l=!1),l?(n.extend(e,{phoneNum:c.val(),areaCode:n("#areaCode").val(),token:n("#token").val()}),a="/passport/back/passwordByMobile"):(n.extend(e,{code:n("#email-code").val()}),a="/passport/back/passwordByEmail"),i.pwdValidate(t)?n.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 n,s=e("zepto"),o=e("lazyload"),i=e("swiper"),l=s("#nav-tab > li"),r=s("#ps-content > .content");o(s("img.lazy")),n=new i(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),s("#nav-tab").delegate("li","touchstart",function(){s(this).hasClass("focus")||(l.toggleClass("focus"),r.toggleClass("hide"),s(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,t){var n,s,o=e("zepto"),i=e("mlellipsis"),l=e("lazyload"),r=o("#intro"),d=o("#intro-more-txt"),c=o("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),f=o("#brand-info").data("id");i.init(),l(o("img.lazy")),r[0].mlellipsis(3),setTimeout(function(){n=r.text(),s=r.attr("title")}),p.initInfosEvt(c),o("#more-intro").bind("touchstart",function(){var e=o(this);e.toggleClass("spread"),e.hasClass("spread")?(r.text(s),d.text("收起")):(r.text(n),d.text("more"))}),o("#brand-like").bind("touchstart",function(e){var a="ok",t=o(this);e.preventDefault(),t.hasClass("like")&&(a="cancel"),o.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:f,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 n(e){r(e.find("img.lazy")),e.each(function(){var e=i(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 s(e){e.delegate(".like-btn","touchstart",function(e){var a=i(e.currentTarget),t=a.closest(".guang-info"),n="ok";a.hasClass("like")&&(n="cancel"),i.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:t.data("id"),opt:n},success:function(e){var t=e.code;200===t&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),n(e.find(".guang-info"))}function o(e,a){f||a.end||(f=!0,i.ajax({type:"GET",url:" /guang/list/page",data:a,success:function(t){return" "===t?(a.end=!0,f=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(t),n(e.find(".guang-info")),a.page++,void(f=!1))},error:function(){d.show("网络断开连接了~"),f=!1}}))}var i=e("zepto"),l=e("mlellipsis"),r=e("lazyload"),d=e("js/plugin/tip"),c=i("#load-more-info"),p=i(""),u=i(""),f=!1;l.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=s,a.setLazyLoadAndMellipsis=n,a.loadMore=o}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,t){var n,s=e("zepto"),o=e("swiper"),i=e("js/guang/info"),l=i.setLazyLoadAndMellipsis,r=i.loadMore,d=s("#load-more-info"),c=s(""),p=s(""),u=s(window).height(),f=d.height(),h=s("#info-list"),g=h.children(".info-list"),v=s("#guang-nav"),m=v.children(".focus"),w=m.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),n=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),i.initInfosEvt(h),function(){var e=s("#gender").val();v.children(".guang-nav-item").each(function(){var a=s(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),v.delegate(".guang-nav-item","touchstart",function(){var e,a,t=s(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"),l(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")))}),s(document).scroll(function(){s(window).scrollTop()+u>=s(document).height()-f&&r(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,t){var n=e("zepto"),s=e("js/guang/info"),o=s.loadMore,i=n(window).height(),l=n("#load-more").height(),r=n("#author-infos"),d=n("#tag"),c={page:1,end:!1},p=n("#info-list");s.initInfosEvt(p),r.length>0&&n.extend(c,{authorId:r.data("id")}),d.length>0&&n.extend(c,{tag:d.val()}),n(document).scroll(function(){n(window).scrollTop()+i>=n(document).height()-l&&o(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 n(){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(n,3e3):v%360===0?window.setTimeout(n,18e4):r(function(){n()})}var s,o,i,l,r,d,c,p,u,f=e("zepto"),h=e("swiper"),g=e("lazyload"),v=0,m=f(".home-header .logo"),w=!0;e("js/home/maybe-like"),g(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&&(s=new h(".banner-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new h(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),f(".trend-topic-swiper").find("li").size()>1&&(i=new h(".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){p="category-swiper"+e,f(this).addClass(p),f("."+p).find(".swiper-slide").size()>1&&(l=new h("."+p,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+p+" .pagination-inner"}))}),f(".header-download").on("click",".close-btn",function(){f(this).parent().remove()}),r=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)}}(),n()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,t){var n,s,o,i,l=e("zepto"),r=e("js/plugin/tip"),d=e("lazyload"),c=l(window).height(),p=l("#load-more").height(),u=l("#goods-list"),f=!1,h=0,g=l(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",v=l(".mobile-wrap").hasClass("kids-wrap")?!0:!1,m=l(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=l("#maybe-like-nav");s=v?"/product/recom/maylikekids":m?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,o=w.children(".focus"),l("#maybe-like-nav").delegate("li","touchstart",function(){var e,a=l(this),t=l(".goods-list");a.hasClass("focus")||(i=a.index(),a.addClass("focus"),o.removeClass("focus"),t.not(".hide").addClass("hide"),e=t.eq(i),e.removeClass("hide"),o=a,l(document).trigger("scroll"))}),l(window).scroll(function(){if(l(window).scrollTop()+c>=l(document).height()-p){if(f)return;f=!0,n=u.children(".good-info").length,l.ajax({type:"GET",url:s,data:{page:h+1},success:function(e){return" "===e?void(f=!0):(u.append(e),d(l(".good-info").find("img.lazy")),f=!1,void h++)},error:function(){r.show("网络断开连接了~"),f=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,t){e("js/product/newsale/newarrival"),e("js/product/newsale/discount")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,t){var n,s,o,i=e("zepto"),l=e("js/plugin/tip"),r=e("swiper"),d=e("lazyload"),c=i("#newarrival-nav"),p=i("#newarrival-goods-list"),u=p.children(".goods-list"),f=i(window).height(),h=i("#load-more").height(),g=i(".goods-list"),v=!1,m=0,w=0;o=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),d(i("img.lazy")),n=c.children(".focus"),i("#newarrival-nav").delegate("li","touchstart",function(){var e,a=i(this);a.hasClass("focus")||(w=a.index(),a.addClass("focus"),n.removeClass("focus"),u.not(".hide").addClass("hide"),e=u.eq(w),e.removeClass("hide"),n=a,i(document).trigger("scroll"))}),i(window).scroll(function(){if(i(window).scrollTop()+f>=i(document).height()-h){if(v)return;v=!0,s=g.children(".good-info").length,i.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(i(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){l.show("网络断开连接了~"),v=!1}})}})}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,t){function n(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 s,o,i=e("zepto"),l=e("swiper"),r=e("lazyload"),d=i("#discount-nav"),c=i("#discount-goods-list"),p=c.children(".goods-list"),u=i(".goods-list"),f=0,h=i(window).height(),g=i("#load-more").height(),v=!1,m=0,w="";o=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),r(i("img.lazy")),s=d.children(".focus"),i("#discount-nav").delegate("li","touchstart",function(){var e,a=i(this);a.hasClass("focus")||(f=a.index(),w=n(f),a.addClass("focus"),s.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(f),e.removeClass("hide"),s=a,i(document).trigger("scroll"))}),i(window).scroll(function(){if(i(window).scrollTop()+h>=i(document).height()-g){if(v)return;v=!0,num=u.children(".good-info").length,i.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),r(i(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){tip.show("网络断开连接了~"),v=!1}})}})});