index.js
1.98 KB
define("index",["jquery","swiper","index"],function(e,i,n){var d;e("js/product/entry"),n.exports=d}),define("js/product/entry",["jquery","swiper","index"],function(e,i,n){e("js/product/detail/detail-app")}),define("js/product/detail/detail-app",["jquery","swiper","index"],function(e,i,n){function d(e){var i,n;e.length>0&&(i=e[0].getBoundingClientRect().right,n=e.find(".swiper-slide:last-child")[0].getBoundingClientRect().right,0>n-i?e.next(".tips").css("display","none"):e.next(".tips").css("display","block"))}function r(e,i){var n=null;c(e).each(function(d,r){n=c(e).slice(d,d+i),n.length===i&&d%i===0&&c(n).wrapAll(c('<div class="js-wraper"></div>'))})}function o(){c("#yoho-header").hide(),c("#yoho-footer").hide()}function s(){var e=c("#app-detail");e.removeClass("hide"),l.hideLoadingMask(),o(),t=new u("#size-swiper-container",{slidesPerView:"auto"}),a=new u("#reference-swiper-container",{slidesPerView:"auto"}),d(c("#size-swiper-container")),d(c("#reference-swiper-container")),r(".detail .column",2)}var t,a,c=e("jquery"),l=e("js/plugin/loading"),u=e("swiper");l.showLoadingMask(),e("js/product/recommend-for-you-product-desc"),c(document).ready(s)}),define("js/plugin/loading",["jquery"],function(e,i,n){function d(e){var i='<div class="loading-mask hide"><div class="loading"><div></div><div></div><div></div></div></div>';c=!0,void 0===e&&(e=a),e.append(i),s=e.children(".loading-mask")}function r(){c||(d(),c=!0),s.removeClass("hide")}function o(){s.addClass("hide")}var s,t=e("jquery"),a=t(".yoho-page"),c=!1;i.init=d,i.showLoadingMask=r,i.hideLoadingMask=o}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,i,n){var d,r=e("swiper"),o=e("jquery"),s=o(".recommend-for-you"),t=o("#preferenceUrl").val();t&&o.get(t).then(function(e){e.length<5?s.css("display","none"):(s.html(e).show(),o("#swiper-recommend").length&&(d=new r("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0})))}).fail(function(){s.hide()})});