...
|
...
|
@@ -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() {
|
...
|
...
|
|