...
|
...
|
@@ -31,28 +31,7 @@ $('#search-coupon').on('submit', function() { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
function getCouponDate() {
|
|
|
if (!canGetCoupon) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (isGetData) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
loading.showLoadingMask();
|
|
|
page += 1;
|
|
|
isGetData = true;
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/home/couponData',
|
|
|
dataType: 'html',
|
|
|
data: {
|
|
|
statuss: status,
|
|
|
page: page
|
|
|
}
|
|
|
}).then(function(coupons) {
|
|
|
function getCouponHandle(coupons) {
|
|
|
var notAvailableCoupons = [];
|
|
|
|
|
|
// 后端需要返回一个 coupons 列表,如下
|
...
|
...
|
@@ -109,7 +88,30 @@ function getCouponDate() { |
|
|
notAvailableCoupons: notAvailableCoupons
|
|
|
}));
|
|
|
window.rePosFooter();
|
|
|
}).fail(function() {
|
|
|
}
|
|
|
|
|
|
function getCouponDate() {
|
|
|
if (!canGetCoupon) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (isGetData) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
loading.showLoadingMask();
|
|
|
page += 1;
|
|
|
isGetData = true;
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/home/couponData',
|
|
|
dataType: 'html',
|
|
|
data: {
|
|
|
statuss: status,
|
|
|
page: page
|
|
|
}
|
|
|
}).then(getCouponHandle).fail(function() {
|
|
|
page -= 1;
|
|
|
tip.show('加载优惠券失败');
|
|
|
}).always(function() {
|
...
|
...
|
|