Authored by Rock Zhang

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

@@ -78,5 +78,20 @@ $('.chose').on('touchend', function() { @@ -78,5 +78,20 @@ $('.chose').on('touchend', function() {
78 chosePanel.show(); 78 chosePanel.show();
79 }); 79 });
80 80
  81 +if ($('.cart-zero').length > 0) {
  82 + require('../product/recommend-for-you');
  83 +}
  84 +
  85 +function notAllowScroll() {
  86 + var docH = $(document).height(),
  87 + winH = $(window).height();
  88 +
  89 + if (docH - winH <= 10) {
  90 + $('body').css('overflow', 'hidden');
  91 + }
  92 +}
  93 +
  94 +notAllowScroll();
  95 +
81 //提前触发lazyload 96 //提前触发lazyload
82 -$(window).scrollTop(1).scrollTop(0);  
  97 +$(window).scrollTop(1).scrollTop(0);
@@ -16,10 +16,27 @@ var page = 1, @@ -16,10 +16,27 @@ var page = 1,
16 isGetData; 16 isGetData;
17 17
18 var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()), 18 var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
  19 + conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
19 $newCoupon = $('#new-coupon'); 20 $newCoupon = $('#new-coupon');
20 21
  22 +var winH = $(window).height();
  23 +
21 // conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()), 24 // conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
22 25
  26 +function fixedLayOut() {
  27 + var $null = $('.null'),
  28 + navH = $('.nav-title').height(),
  29 + nullH = $null.height();
  30 +
  31 + if ($null.length === 0) {
  32 + return false;
  33 + }
  34 +
  35 + $null.css({
  36 + top: winH / 2 - nullH / 2 + navH
  37 + });
  38 +}
  39 +
23 ellipsis.init(); 40 ellipsis.init();
24 41
25 $newCoupon.on('submit', function() { 42 $newCoupon.on('submit', function() {
@@ -106,6 +123,7 @@ function getCouponHandle(coupons) { @@ -106,6 +123,7 @@ function getCouponHandle(coupons) {
106 // 第一页张数为 0 ,显示优惠券为空 123 // 第一页张数为 0 ,显示优惠券为空
107 if (!coupons.length && page === 2) { 124 if (!coupons.length && page === 2) {
108 $('.coupin-wrap').html($('#tmpl-no-coupon').html()); 125 $('.coupin-wrap').html($('#tmpl-no-coupon').html());
  126 + fixedLayOut();
109 return; 127 return;
110 } 128 }
111 129
@@ -120,14 +138,15 @@ function getCouponHandle(coupons) { @@ -120,14 +138,15 @@ function getCouponHandle(coupons) {
120 coupons: coupons 138 coupons: coupons
121 })); 139 }));
122 140
123 - // 产品说,暂时不做不可使用的优惠券  
124 - // if (notAvailableCoupons.length) {  
125 - // $('.not-avaliable-coupon-line').show();  
126 - // }  
127 - // $('#coupon-list-not').append(conponNotAvaliableTmpl({  
128 - // notAvailableCoupons: notAvailableCoupons  
129 - // })); 141 +
  142 + if (notAvailableCoupons.length) {
  143 + $('.not-avaliable-coupon-line').show();
  144 + }
  145 + $('#coupon-list-not').append(conponNotAvaliableTmpl({
  146 + notAvailableCoupons: notAvailableCoupons
  147 + }));
130 window.rePosFooter(); 148 window.rePosFooter();
  149 +
131 } 150 }
132 151
133 function getCouponDate() { 152 function getCouponDate() {
@@ -159,6 +178,7 @@ function getCouponDate() { @@ -159,6 +178,7 @@ function getCouponDate() {
159 }); 178 });
160 } 179 }
161 180
  181 +
162 getCouponDate(); 182 getCouponDate();
163 183
164 $(window).scroll(function() { 184 $(window).scroll(function() {
@@ -222,7 +222,6 @@ @@ -222,7 +222,6 @@
222 {{#if shoppingCartPage}} 222 {{#if shoppingCartPage}}
223 <script> 223 <script>
224 seajs.use('js/cart/cart'); 224 seajs.use('js/cart/cart');
225 - seajs.use('js/product/recommend-for-you');  
226 </script> 225 </script>
227 {{/if}} 226 {{/if}}
228 {{#if giftPage}} 227 {{#if giftPage}}