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