Authored by Rock Zhang

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

... ... @@ -78,5 +78,20 @@ $('.chose').on('touchend', function() {
chosePanel.show();
});
if ($('.cart-zero').length > 0) {
require('../product/recommend-for-you');
}
function notAllowScroll() {
var docH = $(document).height(),
winH = $(window).height();
if (docH - winH <= 10) {
$('body').css('overflow', 'hidden');
}
}
notAllowScroll();
//提前触发lazyload
$(window).scrollTop(1).scrollTop(0);
\ No newline at end of file
$(window).scrollTop(1).scrollTop(0);
... ...
... ... @@ -16,10 +16,27 @@ var page = 1,
isGetData;
var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
$newCoupon = $('#new-coupon');
var winH = $(window).height();
// conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
function fixedLayOut() {
var $null = $('.null'),
navH = $('.nav-title').height(),
nullH = $null.height();
if ($null.length === 0) {
return false;
}
$null.css({
top: winH / 2 - nullH / 2 + navH
});
}
ellipsis.init();
$newCoupon.on('submit', function() {
... ... @@ -106,6 +123,7 @@ function getCouponHandle(coupons) {
// 第一页张数为 0 ,显示优惠券为空
if (!coupons.length && page === 2) {
$('.coupin-wrap').html($('#tmpl-no-coupon').html());
fixedLayOut();
return;
}
... ... @@ -120,14 +138,15 @@ function getCouponHandle(coupons) {
coupons: coupons
}));
// 产品说,暂时不做不可使用的优惠券
// if (notAvailableCoupons.length) {
// $('.not-avaliable-coupon-line').show();
// }
// $('#coupon-list-not').append(conponNotAvaliableTmpl({
// notAvailableCoupons: notAvailableCoupons
// }));
if (notAvailableCoupons.length) {
$('.not-avaliable-coupon-line').show();
}
$('#coupon-list-not').append(conponNotAvaliableTmpl({
notAvailableCoupons: notAvailableCoupons
}));
window.rePosFooter();
}
function getCouponDate() {
... ... @@ -159,6 +178,7 @@ function getCouponDate() {
});
}
getCouponDate();
$(window).scroll(function() {
... ...
... ... @@ -222,7 +222,6 @@
{{#if shoppingCartPage}}
<script>
seajs.use('js/cart/cart');
seajs.use('js/product/recommend-for-you');
</script>
{{/if}}
{{#if giftPage}}
... ...