Authored by whb

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

5.23 KB | W: | H:

5.23 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

4.05 KB | W: | H:

4.05 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -114,6 +114,7 @@ function showChooseGifDialog() { @@ -114,6 +114,7 @@ function showChooseGifDialog() {
114 window.location.href = cartContentShow().find('.freebie > a').attr('href'); 114 window.location.href = cartContentShow().find('.freebie > a').attr('href');
115 }, function() { 115 }, function() {
116 var info = window.cookie('order-info'); 116 var info = window.cookie('order-info');
  117 +
117 if (info) { 118 if (info) {
118 window.setCookie('order-info', ''); 119 window.setCookie('order-info', '');
119 } 120 }
@@ -191,8 +192,10 @@ if ($('.freebie').length > 0) { @@ -191,8 +192,10 @@ if ($('.freebie').length > 0) {
191 } 192 }
192 193
193 $('.btn-balance').on('touchend', function() { 194 $('.btn-balance').on('touchend', function() {
194 - lowStockCount = 0;  
195 var info = window.cookie('order-info'); 195 var info = window.cookie('order-info');
  196 +
  197 + lowStockCount = 0;
  198 +
196 if (shouldLowStocks()) { 199 if (shouldLowStocks()) {
197 tip.show('所选商品中有' + lowStockCount + '种库存不足的商品'); 200 tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
198 return false; 201 return false;
@@ -105,7 +105,6 @@ $('.icon-del').on('touchstart', function(e) { @@ -105,7 +105,6 @@ $('.icon-del').on('touchstart', function(e) {
105 autoHide: true, 105 autoHide: true,
106 fast: true 106 fast: true
107 }); 107 });
108 - //window.setCookie('order-info', '');  
109 window.setCookie('_yoho-cart-refreshByDelete', true); 108 window.setCookie('_yoho-cart-refreshByDelete', true);
110 window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); 109 window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
111 } else { 110 } else {
@@ -91,6 +91,7 @@ $('.invoice').on('touchend', '.checkbox', function() { @@ -91,6 +91,7 @@ $('.invoice').on('touchend', '.checkbox', function() {
91 91
92 function orderCompute() { 92 function orderCompute() {
93 var yohoCoin = orderInfo('yohoCoin'); 93 var yohoCoin = orderInfo('yohoCoin');
  94 +
94 $.ajax({ 95 $.ajax({
95 method: 'POST', 96 method: 'POST',
96 url: '/cart/index/orderCompute', 97 url: '/cart/index/orderCompute',
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 Hammer = require('yoho.hammer'), 8 Hammer = require('yoho.hammer'),
9 Swiper = require('yoho.iswiper'), 9 Swiper = require('yoho.iswiper'),
  10 + loading = require('../plugin/loading'),
10 lazyLoad = require('yoho.lazyload'); 11 lazyLoad = require('yoho.lazyload');
11 12
12 var swiper, 13 var swiper,
@@ -26,6 +27,8 @@ var brandsData, @@ -26,6 +27,8 @@ var brandsData,
26 $keyword, 27 $keyword,
27 clearTextHammer; 28 clearTextHammer;
28 29
  30 +loading.showLoadingMask();
  31 +
29 //热门品牌滑动 32 //热门品牌滑动
30 hotBrandsSwiper = new Swiper('.brands-swiper', { 33 hotBrandsSwiper = new Swiper('.brands-swiper', {
31 grabCursor: true, 34 grabCursor: true,
@@ -48,9 +51,14 @@ $('.yoho-header').css({ @@ -48,9 +51,14 @@ $('.yoho-header').css({
48 top: 0 51 top: 0
49 }); 52 });
50 53
51 -if ($('.banner-top').length > 0) {  
52 - $('.hot-brands').css('padding-top', '0');  
53 -} 54 +(function() {
  55 + if ($('.banner-top').length > 0) {
  56 + $('.hot-brands').css('padding-top', '0');
  57 + }
  58 +
  59 + $('.hide-when-loading').show();
  60 + loading.hideLoadingMask();
  61 +})();
54 62
55 $fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>'); 63 $fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
56 $fixTitleBar.css({ 64 $fixTitleBar.css({
@@ -187,8 +195,15 @@ if ($('.brand-search-page').length) { @@ -187,8 +195,15 @@ if ($('.brand-search-page').length) {
187 195
188 if ($genderItem.length > 0) { 196 if ($genderItem.length > 0) {
189 $genderItem.on('touchstart', function() { 197 $genderItem.on('touchstart', function() {
  198 + var index = $(this).data('id') + 1;
  199 +
190 $('.genderNav ul .active').removeClass('active'); 200 $('.genderNav ul .active').removeClass('active');
191 $(this).addClass('active'); 201 $(this).addClass('active');
192 - window.location.search = 'channel=' + ($(this).data('id') + 1); 202 + $('.hide-when-loading').hide();
  203 + loading.showLoadingMask();
  204 + function reload() {
  205 + window.location.search = 'channel=' + index;
  206 + }
  207 + setTimeout(reload.bind(this), 100);
193 }); 208 });
194 } 209 }
@@ -12,9 +12,6 @@ var commentsNum,consultsNum; @@ -12,9 +12,6 @@ var commentsNum,consultsNum;
12 var navtabEle = document.getElementById('nav-tab'), 12 var navtabEle = document.getElementById('nav-tab'),
13 navtabHammer = navtabEle && new Hammer(navtabEle), 13 navtabHammer = navtabEle && new Hammer(navtabEle),
14 14
15 - // consultFooterEle = $('.consult-content-footer')[0],  
16 - // consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),  
17 -  
18 gotoConsultEle = document.getElementById('goto-consult'), 15 gotoConsultEle = document.getElementById('goto-consult'),
19 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle), 16 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
20 17
@@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
2 .re-pos-search { 2 .re-pos-search {
3 top: 170rem / $pxConvertRem !important; 3 top: 170rem / $pxConvertRem !important;
4 } 4 }
  5 + .hide-when-loading {
  6 + display: none;
  7 + }
5 .genderNav { 8 .genderNav {
6 display: block; 9 display: block;
7 width: 100%; 10 width: 100%;
@@ -21,38 +21,40 @@ @@ -21,38 +21,40 @@
21 </a> 21 </a>
22 </div> 22 </div>
23 </div> 23 </div>
  24 + <div class="hide-when-loading">
  25 + {{# topData}}
  26 + {{! 头部banner}}
  27 + {{# bannerTop}}
  28 + {{> home/banner_top}}
  29 + {{/ bannerTop}}
24 30
25 - {{# topData}}  
26 - {{! 头部banner}}  
27 - {{# bannerTop}}  
28 - {{> home/banner_top}}  
29 - {{/ bannerTop}} 31 + {{! 热门品牌可滑动}}
  32 + {{# hotBrandsScroll}}
  33 + {{> home/hot_brands_swipe}}
  34 + {{/ hotBrandsScroll}}
  35 + {{/ topData}}
30 36
31 - {{! 热门品牌可滑动}}  
32 - {{# hotBrandsScroll}}  
33 - {{> home/hot_brands_swipe}}  
34 - {{/ hotBrandsScroll}}  
35 - {{/ topData}}  
36 -  
37 - {{# brandList}}  
38 - <div class="brand-list bar-{{@index}}">  
39 - <div class="title-bar">  
40 - <h2 style="position: static;">{{title}}</h2> 37 + {{# brandList}}
  38 + <div class="brand-list bar-{{@index}}">
  39 + <div class="title-bar">
  40 + <h2 style="position: static;">{{title}}</h2>
  41 + </div>
  42 + {{# list}}
  43 + <p>
  44 + <a href="{{url}}">{{name}}
  45 + {{# isHot}}
  46 + <i class="icon-hot">HOT</i>
  47 + {{/ isHot}}
  48 + {{# isNew}}
  49 + <i class="icon-new">NEW</i>
  50 + {{/ isNew}}
  51 + </a>
  52 + </p>
  53 + {{/ list}}
41 </div> 54 </div>
42 - {{# list}}  
43 - <p>  
44 - <a href="{{url}}">{{name}}  
45 - {{# isHot}}  
46 - <i class="icon-hot">HOT</i>  
47 - {{/ isHot}}  
48 - {{# isNew}}  
49 - <i class="icon-new">NEW</i>  
50 - {{/ isNew}}  
51 - </a>  
52 - </p>  
53 - {{/ list}} 55 + {{/ brandList}}
54 </div> 56 </div>
55 - {{/ brandList}} 57 +
56 58
57 {{/channel}} 59 {{/channel}}
58 {{> layout/footer}} 60 {{> layout/footer}}
1 <!-- Google Tag Manager --> 1 <!-- Google Tag Manager -->
2 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 2 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
3 <script> 3 <script>
4 -var _hmt = _hmt || [];  
5 -(function() { 4 + var _hmt = _hmt || [];
6 function async_load(){ 5 function async_load(){
7 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 6 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
8 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 7 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@@ -32,7 +31,6 @@ var _hmt = _hmt || []; @@ -32,7 +31,6 @@ var _hmt = _hmt || [];
32 })(); 31 })();
33 } 32 }
34 window.addEventListener('load', async_load, false); 33 window.addEventListener('load', async_load, false);
35 -})();  
36 </script> 34 </script>
37 <script> 35 <script>
38 window._py = window._py||[]; 36 window._py = window._py||[];