Authored by biao

update to fix below issues: 1. request recommand for you only when there is no g…

…ood in cart. 2. the coupon img could be left up when input focused. code review by XWG.
... ... @@ -78,5 +78,9 @@ $('.chose').on('touchend', function() {
chosePanel.show();
});
if ($('.cart-zero').length > 0) {
require('../product/recommend-for-you');
}
//提前触发lazyload
$(window).scrollTop(1).scrollTop(0);
\ No newline at end of file
$(window).scrollTop(1).scrollTop(0);
... ...
... ... @@ -20,6 +20,21 @@ var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
// conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
function fixedLayOut() {
var $null = $('.null');
var winH = $(window).height(),
nullH = $null.height();
if ($null.length === 0) {
return false;
}
$null.css({
top: winH/2 - nullH/2
});
}
ellipsis.init();
$newCoupon.on('submit', function() {
... ... @@ -106,6 +121,7 @@ function getCouponHandle(coupons) {
// 第一页张数为 0 ,显示优惠券为空
if (!coupons.length && page === 2) {
$('.coupin-wrap').html($('#tmpl-no-coupon').html());
fixedLayOut();
return;
}
... ... @@ -127,7 +143,9 @@ function getCouponHandle(coupons) {
// $('#coupon-list-not').append(conponNotAvaliableTmpl({
// notAvailableCoupons: notAvailableCoupons
// }));
window.rePosFooter();
}
function getCouponDate() {
... ... @@ -159,6 +177,7 @@ function getCouponDate() {
});
}
getCouponDate();
$(window).scroll(function() {
... ...
... ... @@ -83,7 +83,7 @@
position: absolute;
left: 0;
top:50%;
@include transform(translateY(-50%));
//@include transform(translateY(-50%));
i{
width: 100%;
height: 120rem / $pxConvertRem;
... ...
... ... @@ -222,7 +222,6 @@
{{#if shoppingCartPage}}
<script>
seajs.use('js/cart/cart');
seajs.use('js/product/recommend-for-you');
</script>
{{/if}}
{{#if giftPage}}
... ...