...
|
...
|
@@ -6,20 +6,36 @@ class SelectCouponController extends Page { |
|
|
super();
|
|
|
|
|
|
this.view = {
|
|
|
filterBtn: $('.filter-btn'),
|
|
|
coupon: $('.coupon'),
|
|
|
checkbox: $('.checkbox'),
|
|
|
tipBox: $('.tip-box'),
|
|
|
tipClose: $('.tip-close'),
|
|
|
showFilterBtn: $('.show-filter-btn'),
|
|
|
filterItem: $('.filter-item'),
|
|
|
filterItem: $('.filter-item')
|
|
|
};
|
|
|
|
|
|
this.view.filterBtn.on('click', this.tapChange.bind(this));
|
|
|
this.view.coupon.on('click', '.checkbox', this.check.bind(this));
|
|
|
this.view.tipClose.on('click', this.closeTip.bind(this));
|
|
|
this.view.showFilterBtn.on('click', this.showFilter.bind(this));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* tab 切换
|
|
|
*/
|
|
|
tapChange(event) {
|
|
|
let itemClicked = $(event.currentTarget);
|
|
|
|
|
|
if (itemClicked.hasClass('active')) {
|
|
|
itemClicked.removeClass('active');
|
|
|
} else {
|
|
|
this.view.filterBtn.removeClass('active');
|
|
|
itemClicked.addClass('active');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券勾选处理
|
|
|
*/
|
|
|
check(e) {
|
...
|
...
|
|