Authored by 梁志锋

merge feature wap323 review by zhaobiao

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
@@ -113,6 +113,10 @@ function showChooseGifDialog() { @@ -113,6 +113,10 @@ function showChooseGifDialog() {
113 }, function() { 113 }, function() {
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');
  117 + if (info) {
  118 + window.setCookie('order-info', '');
  119 + }
116 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; 120 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
117 }); 121 });
118 } 122 }
@@ -188,6 +192,7 @@ if ($('.freebie').length > 0) { @@ -188,6 +192,7 @@ if ($('.freebie').length > 0) {
188 192
189 $('.btn-balance').on('touchend', function() { 193 $('.btn-balance').on('touchend', function() {
190 lowStockCount = 0; 194 lowStockCount = 0;
  195 + var info = window.cookie('order-info');
191 if (shouldLowStocks()) { 196 if (shouldLowStocks()) {
192 tip.show('所选商品中有' + lowStockCount + '种库存不足的商品'); 197 tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
193 return false; 198 return false;
@@ -199,6 +204,9 @@ $('.btn-balance').on('touchend', function() { @@ -199,6 +204,9 @@ $('.btn-balance').on('touchend', function() {
199 } 204 }
200 205
201 if (hasChecked()) { 206 if (hasChecked()) {
  207 + if (info) {
  208 + window.setCookie('order-info', '');
  209 + }
202 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; 210 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
203 } else { 211 } else {
204 tip.show('请先勾选商品'); 212 tip.show('请先勾选商品');
@@ -105,7 +105,7 @@ $('.icon-del').on('touchstart', function(e) { @@ -105,7 +105,7 @@ $('.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', ''); 108 + //window.setCookie('order-info', '');
109 window.setCookie('_yoho-cart-refreshByDelete', true); 109 window.setCookie('_yoho-cart-refreshByDelete', true);
110 window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); 110 window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
111 } else { 111 } else {
@@ -11,7 +11,7 @@ require('../common'); @@ -11,7 +11,7 @@ require('../common');
11 function init() { 11 function init() {
12 info = { 12 info = {
13 uid: window.getUid(), 13 uid: window.getUid(),
14 - deliveryId: 1, 14 + deliveryId: $('.dispatch-mode .chosed').data('id') || 1,
15 deliveryTimeId: 1, 15 deliveryTimeId: 1,
16 paymentTypeId: 1, 16 paymentTypeId: 1,
17 yohoCoin: 0, 17 yohoCoin: 0,
@@ -32,7 +32,7 @@ try { @@ -32,7 +32,7 @@ try {
32 info = JSON.parse(info); 32 info = JSON.parse(info);
33 33
34 // 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下 34 // 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下
35 - // info.yohoCoin = $('.coin').data('yoho-coin') || 0; 35 + //info['yohoCoin'] = $('.coin').data('yoho-coin') || 0;
36 } catch (e) { 36 } catch (e) {
37 init(); 37 init();
38 } 38 }
@@ -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 }
@@ -9,11 +9,11 @@ var $ = require('jquery'), @@ -9,11 +9,11 @@ var $ = require('jquery'),
9 9
10 var commentsNum,consultsNum; 10 var commentsNum,consultsNum;
11 11
12 -var navtabEle = document.getElementById('nav-tab'),  
13 - navtabHammer = navtabEle && new Hammer(navtabEle), 12 +var consultFooterEle = $('.consult-content-footer')[0],
  13 + consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
14 14
15 - // consultFooterEle = $('.consult-content-footer')[0],  
16 - // consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), 15 + navtabEle = document.getElementById('nav-tab'),
  16 + navtabHammer = navtabEle && new Hammer(navtabEle),
17 17
18 gotoConsultEle = document.getElementById('goto-consult'), 18 gotoConsultEle = document.getElementById('goto-consult'),
19 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle), 19 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
@@ -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||[];