do fixes bug to home order bugs
Showing
4 changed files
with
58 additions
and
11 deletions
@@ -157,7 +157,7 @@ function reMarginFooter(fixedElement) { | @@ -157,7 +157,7 @@ function reMarginFooter(fixedElement) { | ||
157 | 157 | ||
158 | //已登录 | 158 | //已登录 |
159 | $op.prepend( | 159 | $op.prepend( |
160 | - 'Hi,' + | 160 | + '<span>Hi,</span>' + |
161 | '<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' + | 161 | '<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' + |
162 | '<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>' | 162 | '<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>' |
163 | ); | 163 | ); |
@@ -370,8 +370,9 @@ var $ = require("jquery"), | @@ -370,8 +370,9 @@ var $ = require("jquery"), | ||
370 | 370 | ||
371 | var swiper, | 371 | var swiper, |
372 | $fixTitleBar, | 372 | $fixTitleBar, |
373 | - $brandList = $('.brand-list'); | ||
374 | -var $icon = $('.search-icon'); | 373 | + $brandList = $('.brand-list'), |
374 | + $icon = $('.search-icon'), | ||
375 | + hotBrandsSwiper; | ||
375 | 376 | ||
376 | var searchH = $('.newbrand-search').outerHeight(), | 377 | var searchH = $('.newbrand-search').outerHeight(), |
377 | headerH = $('.yoho-header').outerHeight(), | 378 | headerH = $('.yoho-header').outerHeight(), |
@@ -382,6 +383,14 @@ var brandsData, | @@ -382,6 +383,14 @@ var brandsData, | ||
382 | $keyword, | 383 | $keyword, |
383 | clearTextHammer; | 384 | clearTextHammer; |
384 | 385 | ||
386 | +//热门品牌滑动 | ||
387 | +hotBrandsSwiper = new Swiper('.brands-swiper', { | ||
388 | + grabCursor: true, | ||
389 | + slidesPerView: 'auto', | ||
390 | + wrapperClass: 'brands-list', | ||
391 | + slideElement: 'li' | ||
392 | +}); | ||
393 | + | ||
385 | swiper = new Swiper('.swiper-container', { | 394 | swiper = new Swiper('.swiper-container', { |
386 | lazyLoading: true, | 395 | lazyLoading: true, |
387 | loop: true, | 396 | loop: true, |
@@ -396,12 +405,16 @@ $('.yoho-header').css({ | @@ -396,12 +405,16 @@ $('.yoho-header').css({ | ||
396 | top: 0 | 405 | top: 0 |
397 | }); | 406 | }); |
398 | 407 | ||
408 | +if ($('.banner-top').length > 0) { | ||
409 | + $('.hot-brands').css('padding-top', '0'); | ||
410 | +} | ||
411 | + | ||
399 | $fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>'); | 412 | $fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>'); |
400 | $fixTitleBar.css({ | 413 | $fixTitleBar.css({ |
401 | position: 'fixed', | 414 | position: 'fixed', |
402 | top: brandSwipe | 415 | top: brandSwipe |
403 | }).hide(); | 416 | }).hide(); |
404 | -minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight(); | 417 | +minBrandListTop = brandSwipe + $('.hot-brands').outerHeight() + $('.banner-top').outerHeight(); |
405 | $brandList.last().append($fixTitleBar); | 418 | $brandList.last().append($fixTitleBar); |
406 | 419 | ||
407 | function scrollHandler() { | 420 | function scrollHandler() { |
@@ -1912,7 +1925,7 @@ $('.maybe-like p').on('touchstart', function(e) { | @@ -1912,7 +1925,7 @@ $('.maybe-like p').on('touchstart', function(e) { | ||
1912 | }); | 1925 | }); |
1913 | 1926 | ||
1914 | function scrollHandler() { | 1927 | function scrollHandler() { |
1915 | - if ($(window).scrollTop() + winH >= $(document).height() - 50) { | 1928 | + if ($(window).scrollTop() + winH >= $(document).height() - 200) { |
1916 | search(); | 1929 | search(); |
1917 | } | 1930 | } |
1918 | } | 1931 | } |
@@ -2679,12 +2692,20 @@ $btnSure.on('touchstart', function() { | @@ -2679,12 +2692,20 @@ $btnSure.on('touchstart', function() { | ||
2679 | token: $('#token').val() | 2692 | token: $('#token').val() |
2680 | }, | 2693 | }, |
2681 | success: function(data) { | 2694 | success: function(data) { |
2695 | + var res; | ||
2696 | + | ||
2682 | if (data.code === 200) { | 2697 | if (data.code === 200) { |
2698 | + res = data.data; | ||
2683 | showErrTip('注册成功'); | 2699 | showErrTip('注册成功'); |
2684 | 2700 | ||
2701 | + $.ajax({ | ||
2702 | + url: res.session, | ||
2703 | + dataType: 'jsonp' | ||
2704 | + }); | ||
2705 | + | ||
2685 | //1000ms后跳转页面 | 2706 | //1000ms后跳转页面 |
2686 | setTimeout(function() { | 2707 | setTimeout(function() { |
2687 | - location.href = data.data; | 2708 | + location.href = res.href; |
2688 | }, 1000); | 2709 | }, 1000); |
2689 | } else { | 2710 | } else { |
2690 | showErrTip(data.message); | 2711 | showErrTip(data.message); |
@@ -2783,12 +2804,21 @@ $loginBtn.on('touchstart', function() { | @@ -2783,12 +2804,21 @@ $loginBtn.on('touchstart', function() { | ||
2783 | password: pwd | 2804 | password: pwd |
2784 | }, | 2805 | }, |
2785 | success: function(data) { | 2806 | success: function(data) { |
2807 | + var res; | ||
2808 | + | ||
2786 | if (data.code === 200) { | 2809 | if (data.code === 200) { |
2810 | + res = data.data; | ||
2811 | + | ||
2787 | showErrTip('登录成功'); | 2812 | showErrTip('登录成功'); |
2788 | 2813 | ||
2814 | + $.ajax({ | ||
2815 | + url: res.session, | ||
2816 | + dataType: 'jsonp' | ||
2817 | + }); | ||
2818 | + | ||
2789 | //1s后跳转页面 | 2819 | //1s后跳转页面 |
2790 | setTimeout(function() { | 2820 | setTimeout(function() { |
2791 | - location.href = data.data; | 2821 | + location.href = res.href; |
2792 | }, 1000); | 2822 | }, 1000); |
2793 | } else { | 2823 | } else { |
2794 | showErrTip(data.message); | 2824 | showErrTip(data.message); |
@@ -2907,12 +2937,20 @@ $loginBtn.on('touchstart', function() { | @@ -2907,12 +2937,20 @@ $loginBtn.on('touchstart', function() { | ||
2907 | password: pwd | 2937 | password: pwd |
2908 | }, | 2938 | }, |
2909 | success: function(data) { | 2939 | success: function(data) { |
2940 | + var res; | ||
2941 | + | ||
2910 | if (data.code === 200) { | 2942 | if (data.code === 200) { |
2943 | + res = data.data; | ||
2911 | showErrTip('登录成功'); | 2944 | showErrTip('登录成功'); |
2912 | 2945 | ||
2946 | + $.ajax({ | ||
2947 | + url: res.session, | ||
2948 | + dataType: 'jsonp' | ||
2949 | + }); | ||
2950 | + | ||
2913 | //1000ms后跳转页面 | 2951 | //1000ms后跳转页面 |
2914 | setTimeout(function() { | 2952 | setTimeout(function() { |
2915 | - location.href = data.data; | 2953 | + location.href = res.href; |
2916 | }, 1000); | 2954 | }, 1000); |
2917 | } else { | 2955 | } else { |
2918 | showErrTip(data.message); | 2956 | showErrTip(data.message); |
@@ -4640,6 +4678,13 @@ if ($brandHeader.length > 0) { | @@ -4640,6 +4678,13 @@ if ($brandHeader.length > 0) { | ||
4640 | success: function(data) { | 4678 | success: function(data) { |
4641 | if (data.code === 200) { | 4679 | if (data.code === 200) { |
4642 | $this.toggleClass('coled'); | 4680 | $this.toggleClass('coled'); |
4681 | + | ||
4682 | + //提示 | ||
4683 | + if (opt === 'ok') { | ||
4684 | + tip.show('添加收藏成功'); | ||
4685 | + } else { | ||
4686 | + tip.show('取消收藏成功'); | ||
4687 | + } | ||
4643 | } else if (data.code === 400) { | 4688 | } else if (data.code === 400) { |
4644 | location.href = data.data;//未登录跳转登录页 | 4689 | location.href = data.data;//未登录跳转登录页 |
4645 | } else { | 4690 | } else { |
@@ -4668,7 +4713,7 @@ if (window._yas) { | @@ -4668,7 +4713,7 @@ if (window._yas) { | ||
4668 | window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img'); | 4713 | window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img'); |
4669 | } | 4714 | } |
4670 | }); | 4715 | }); |
4671 | -define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ | 4716 | +define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ |
4672 | /** | 4717 | /** |
4673 | * 商品详情 | 4718 | * 商品详情 |
4674 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> | 4719 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> |
@@ -4676,12 +4721,14 @@ define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index | @@ -4676,12 +4721,14 @@ define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index | ||
4676 | */ | 4721 | */ |
4677 | var $ = require("jquery"), | 4722 | var $ = require("jquery"), |
4678 | Swiper = require("swiper"), | 4723 | Swiper = require("swiper"), |
4724 | + Hammer = require("hammer"), | ||
4679 | lazyLoad = require("lazyload"); | 4725 | lazyLoad = require("lazyload"); |
4680 | 4726 | ||
4681 | var goodsSwiper, | 4727 | var goodsSwiper, |
4682 | $discountFolder = $('.goodsDiscount .discount-folder'), | 4728 | $discountFolder = $('.goodsDiscount .discount-folder'), |
4683 | $discountArrow = $('.goodsDiscount .first-item span'); | 4729 | $discountArrow = $('.goodsDiscount .first-item span'); |
4684 | 4730 | ||
4731 | +var goodsDiscountHammer = new Hammer(document.getElementById('goodsDiscount')); | ||
4685 | 4732 | ||
4686 | require("js/product/detail/desc"); | 4733 | require("js/product/detail/desc"); |
4687 | require("js/product/detail/comments-consults"); | 4734 | require("js/product/detail/comments-consults"); |
@@ -4709,7 +4756,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | @@ -4709,7 +4756,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | ||
4709 | } | 4756 | } |
4710 | 4757 | ||
4711 | //goods-discount下拉按钮点击事件 | 4758 | //goods-discount下拉按钮点击事件 |
4712 | -$('.goodsDiscount .dropdown').on('touchend', function(e) { | 4759 | +goodsDiscountHammer.on('tap', function(e) { |
4713 | if ($discountFolder.is(':hidden')) { | 4760 | if ($discountFolder.is(':hidden')) { |
4714 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 4761 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); |
4715 | $discountFolder.slideDown(); | 4762 | $discountFolder.slideDown(); |
@@ -4717,9 +4764,9 @@ $('.goodsDiscount .dropdown').on('touchend', function(e) { | @@ -4717,9 +4764,9 @@ $('.goodsDiscount .dropdown').on('touchend', function(e) { | ||
4717 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); | 4764 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); |
4718 | $discountFolder.slideUp(); | 4765 | $discountFolder.slideUp(); |
4719 | } | 4766 | } |
4720 | - | ||
4721 | return false; | 4767 | return false; |
4722 | }); | 4768 | }); |
4769 | + | ||
4723 | require("js/product/detail/like"); | 4770 | require("js/product/detail/like"); |
4724 | 4771 | ||
4725 | }); | 4772 | }); |
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