...
|
...
|
@@ -18,7 +18,8 @@ class ConponController extends Page { |
|
|
couponSection: $('.coupon-section'),
|
|
|
noConponNow: $('.no-conpon-now'),
|
|
|
exchangeCouponBtn: $('#exchangeCouponBtn'),
|
|
|
couponCodeInput: $('input[name=couponCodeInput]')
|
|
|
couponCodeInput: $('input[name=couponCodeInput]'),
|
|
|
usedTip: $('.used-tip')
|
|
|
};
|
|
|
|
|
|
this.view.filterBtn.on('click', this.tabChange.bind(this));
|
...
|
...
|
@@ -78,15 +79,15 @@ class ConponController extends Page { |
|
|
data: {
|
|
|
couponCode: couponCode
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
}).then(res => {
|
|
|
if (res.message) {
|
|
|
tip.show(res.message);
|
|
|
}
|
|
|
if (res.code === 200) {
|
|
|
tip.show('优惠券可用');
|
|
|
setTimeout(function() {
|
|
|
setTimeout(() => {
|
|
|
location.reload();
|
|
|
}, 500);
|
|
|
}, 100);
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -180,10 +181,18 @@ class ConponController extends Page { |
|
|
// 筛选参数更改
|
|
|
if (itemClicked.hasClass('no-used')) {
|
|
|
this.couponType = 'notuse';
|
|
|
this.view.usedTip.addClass('hide');
|
|
|
this.view.usedTip.find('span').addClass('hide');
|
|
|
} else if (itemClicked.hasClass('used')) {
|
|
|
this.couponType = 'use';
|
|
|
this.view.usedTip.removeClass('hide');
|
|
|
this.view.usedTip.find('.used').removeClass('hide');
|
|
|
this.view.usedTip.find('.invalid').addClass('hide');
|
|
|
} else if (itemClicked.hasClass('invalid')) {
|
|
|
this.couponType = 'overtime';
|
|
|
this.view.usedTip.removeClass('hide');
|
|
|
this.view.usedTip.find('.invalid').removeClass('hide');
|
|
|
this.view.usedTip.find('.used').addClass('hide');
|
|
|
} else {
|
|
|
tip.show('未知券类型');
|
|
|
}
|
...
|
...
|
|