...
|
...
|
@@ -18,11 +18,9 @@ class ConponController extends Page { |
|
|
couponList: $('#couponList')
|
|
|
};
|
|
|
|
|
|
this.view.filterBtn.on('click', this.tapChange.bind(this));
|
|
|
this.view.filterBtn.on('click', this.tabChange.bind(this));
|
|
|
this.view.showFilterBtn.on('click', this.showFilter.bind(this));
|
|
|
this.view.filterItem.on('click', 'button', this.filterCoupons.bind(this));
|
|
|
|
|
|
// this.renderCoupons();
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -78,25 +76,25 @@ class ConponController extends Page { |
|
|
/**
|
|
|
* tab 切换
|
|
|
*/
|
|
|
tapChange(event) {
|
|
|
tabChange(event) {
|
|
|
let itemClicked = $(event.currentTarget);
|
|
|
|
|
|
if (itemClicked.hasClass('no-used')) {
|
|
|
this.status = 0;
|
|
|
this.couponType = 'notuse';
|
|
|
} else if (itemClicked.hasClass('used')) {
|
|
|
this.status = 1;
|
|
|
this.couponType = 'use';
|
|
|
} else if (itemClicked.hasClass('invalid')) {
|
|
|
this.status = 2;
|
|
|
this.couponType = 'overtime';
|
|
|
}
|
|
|
|
|
|
this.renderCoupons();
|
|
|
|
|
|
if (itemClicked.hasClass('active')) {
|
|
|
itemClicked.removeClass('active');
|
|
|
} else {
|
|
|
this.view.filterBtn.removeClass('active');
|
|
|
itemClicked.addClass('active');
|
|
|
}
|
|
|
|
|
|
this.renderCoupons();
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|