Showing
5 changed files
with
26 additions
and
11 deletions
@@ -4689,7 +4689,8 @@ $listNav.on('touchstart', 'li', function() { | @@ -4689,7 +4689,8 @@ $listNav.on('touchstart', 'li', function() { | ||
4689 | 4689 | ||
4690 | // 用于统计点击了商品列表的第几个商品,序号从1开始计算。 | 4690 | // 用于统计点击了商品列表的第几个商品,序号从1开始计算。 |
4691 | if (window._yas) { | 4691 | if (window._yas) { |
4692 | - window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img'); | 4692 | + window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, |
4693 | + '', '#goods-container >div >div .good-thumb >img'); | ||
4693 | } | 4694 | } |
4694 | }); | 4695 | }); |
4695 | define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ | 4696 | define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ |
@@ -4708,7 +4709,8 @@ var goodsSwiper, | @@ -4708,7 +4709,8 @@ var goodsSwiper, | ||
4708 | $discountArrow = $('.goodsDiscount .first-item span'); | 4709 | $discountArrow = $('.goodsDiscount .first-item span'); |
4709 | 4710 | ||
4710 | var goodsDiscountEl = document.getElementById('goodsDiscount'), | 4711 | var goodsDiscountEl = document.getElementById('goodsDiscount'), |
4711 | - goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); | 4712 | + goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl), |
4713 | + $discountFirstItem = $(goodsDiscountEl).find('.first-item'); | ||
4712 | 4714 | ||
4713 | var $cart = $('.cart-bar'); | 4715 | var $cart = $('.cart-bar'); |
4714 | 4716 | ||
@@ -4757,9 +4759,11 @@ if (0 === $discountFolder.children().length) { | @@ -4757,9 +4759,11 @@ if (0 === $discountFolder.children().length) { | ||
4757 | if (goodsDiscountHammer && $discountFolder.children().length > 0) { | 4759 | if (goodsDiscountHammer && $discountFolder.children().length > 0) { |
4758 | goodsDiscountHammer.on('tap', function(e) { | 4760 | goodsDiscountHammer.on('tap', function(e) { |
4759 | if ($discountFolder.is(':hidden')) { | 4761 | if ($discountFolder.is(':hidden')) { |
4762 | + $discountFirstItem.removeClass('short-text'); | ||
4760 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 4763 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); |
4761 | $discountFolder.slideDown(); | 4764 | $discountFolder.slideDown(); |
4762 | } else { | 4765 | } else { |
4766 | + $discountFirstItem.addClass('short-text'); | ||
4763 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); | 4767 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); |
4764 | $discountFolder.slideUp(); | 4768 | $discountFolder.slideUp(); |
4765 | } | 4769 | } |
@@ -4805,7 +4809,6 @@ var introUrl = $('#introUrl').val(), | @@ -4805,7 +4809,6 @@ var introUrl = $('#introUrl').val(), | ||
4805 | var sizeSwiper, | 4809 | var sizeSwiper, |
4806 | refSwiper; | 4810 | refSwiper; |
4807 | 4811 | ||
4808 | -var UA = navigator.userAgent.toLowerCase().toString(); | ||
4809 | 4812 | ||
4810 | //判断是否要显示向左滑动提示 | 4813 | //判断是否要显示向左滑动提示 |
4811 | function hiddenTips($ele) { | 4814 | function hiddenTips($ele) { |
@@ -4825,6 +4828,19 @@ function hiddenTips($ele) { | @@ -4825,6 +4828,19 @@ function hiddenTips($ele) { | ||
4825 | } | 4828 | } |
4826 | } | 4829 | } |
4827 | 4830 | ||
4831 | +function isFlexSupport() { | ||
4832 | + var flex = document.createElement('p').style.flex, | ||
4833 | + webkitFlex = document.createElement('p').style.webkitFlex, | ||
4834 | + flexWrap = document.createElement('p').style.flexWrap; | ||
4835 | + | ||
4836 | + if ((flex === '' || webkitFlex === '') && flexWrap === '') { | ||
4837 | + return true; | ||
4838 | + } else { | ||
4839 | + return false; | ||
4840 | + } | ||
4841 | +} | ||
4842 | + | ||
4843 | + | ||
4828 | function search() { | 4844 | function search() { |
4829 | if (searching || end) { | 4845 | if (searching || end) { |
4830 | return; | 4846 | return; |
@@ -4858,8 +4874,9 @@ function search() { | @@ -4858,8 +4874,9 @@ function search() { | ||
4858 | 4874 | ||
4859 | hiddenTips($('#size-swiper-container')); | 4875 | hiddenTips($('#size-swiper-container')); |
4860 | hiddenTips($('#reference-swiper-container')); | 4876 | hiddenTips($('#reference-swiper-container')); |
4861 | - if (UA.indexOf('mqqbrowser') > 0) { | ||
4862 | - $('.detail > div').removeClass('column').addClass('oldbox'); | 4877 | + |
4878 | + if (!isFlexSupport()) { | ||
4879 | + $('.detail .column').removeClass('column').addClass('oldbox'); | ||
4863 | } | 4880 | } |
4864 | searching = false; | 4881 | searching = false; |
4865 | end = true; | 4882 | end = true; |
@@ -5696,10 +5713,10 @@ var $navLi = $('#fav-tab > li'), | @@ -5696,10 +5713,10 @@ var $navLi = $('#fav-tab > li'), | ||
5696 | swiperObj = {}, | 5713 | swiperObj = {}, |
5697 | favTabHammer, | 5714 | favTabHammer, |
5698 | favContentHammer, | 5715 | favContentHammer, |
5699 | - footerH = $('#yoho-footer').height(), | ||
5700 | $loadMore = $('.fav-load-more'), | 5716 | $loadMore = $('.fav-load-more'), |
5701 | $brandLoadMore = $('.fav-brand-load-more'), | 5717 | $brandLoadMore = $('.fav-brand-load-more'), |
5702 | winH = $(window).height(), | 5718 | winH = $(window).height(), |
5719 | + footerH = $('#yoho-footer').height(), | ||
5703 | $favProductList = $('.fav-product-list'), | 5720 | $favProductList = $('.fav-product-list'), |
5704 | $favBrandList = $('.fav-brand-swiper-wrapper'), | 5721 | $favBrandList = $('.fav-brand-swiper-wrapper'), |
5705 | pageId = 1, | 5722 | pageId = 1, |
@@ -5901,8 +5918,8 @@ favContentHammer.on('tap', function(e) { | @@ -5901,8 +5918,8 @@ favContentHammer.on('tap', function(e) { | ||
5901 | 5918 | ||
5902 | function scrollHandler() { | 5919 | function scrollHandler() { |
5903 | 5920 | ||
5904 | - if ($(window).scrollTop() + winH >= $(document).height() - footerH) { | ||
5905 | - | 5921 | + //距离底部未1/4列表高度+底部高度的时候加载更多 |
5922 | + if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) { | ||
5906 | if (brandTab) { | 5923 | if (brandTab) { |
5907 | $brandLoadMore.filter('.hide').removeClass('hide'); | 5924 | $brandLoadMore.filter('.hide').removeClass('hide'); |
5908 | 5925 | ||
@@ -5924,9 +5941,7 @@ function scrollHandler() { | @@ -5924,9 +5941,7 @@ function scrollHandler() { | ||
5924 | } | 5941 | } |
5925 | 5942 | ||
5926 | //srcoll to load more | 5943 | //srcoll to load more |
5927 | -$(window).scroll(function() { | ||
5928 | - window.requestAnimationFrame(scrollHandler); | ||
5929 | -}); | 5944 | +$(window).scroll(scrollHandler); |
5930 | }); | 5945 | }); |
5931 | define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){ | 5946 | define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){ |
5932 | /** | 5947 | /** |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
-
Please register or login to post a comment