...
|
...
|
@@ -13,6 +13,7 @@ class SelectCouponController extends Page { |
|
|
this.useCouponCodeUrl = params.useCouponCodeUrl;
|
|
|
this.selectCouponCodes = [];
|
|
|
this.isBuyNowPage = params.isBuyNowPage || false;
|
|
|
this.closeTipbyUser = false;
|
|
|
|
|
|
if (this.orderInfo('coupon_code')) {
|
|
|
this.selectCouponCodes = this.orderInfo('coupon_code').split(',');
|
...
|
...
|
@@ -65,7 +66,9 @@ class SelectCouponController extends Page { |
|
|
unusableCouponList: resultHtml.find('.unusable'),
|
|
|
useNowBtn: resultHtml.find('#useNowBtn'),
|
|
|
exchangeCouponBtn: resultHtml.find('#exchangeCouponBtn'),
|
|
|
couponCodeInput: resultHtml.find('input[name=couponCodeInput]')
|
|
|
couponCodeInput: resultHtml.find('input[name=couponCodeInput]'),
|
|
|
exchangeBox: resultHtml.find('.exchange-box'),
|
|
|
useNowBox: resultHtml.find('#useNowBox')
|
|
|
};
|
|
|
|
|
|
this.view.filterBtn.on('click', this.tabChange.bind(this));
|
...
|
...
|
@@ -135,6 +138,8 @@ class SelectCouponController extends Page { |
|
|
tabChange(event) {
|
|
|
let itemClicked = $(event.currentTarget);
|
|
|
|
|
|
console.log(this.view.useNowBox);
|
|
|
|
|
|
if (itemClicked.hasClass('active')) {
|
|
|
itemClicked.removeClass('active');
|
|
|
} else {
|
...
|
...
|
@@ -145,9 +150,19 @@ class SelectCouponController extends Page { |
|
|
if (itemClicked.hasClass('valid')) {
|
|
|
this.view.unusableCouponList.addClass('hide');
|
|
|
this.view.usableCouponList.removeClass('hide');
|
|
|
this.view.exchangeBox.removeClass('hide');
|
|
|
this.view.useNowBox.removeClass('hide');
|
|
|
} else {
|
|
|
this.view.usableCouponList.addClass('hide');
|
|
|
this.view.unusableCouponList.removeClass('hide');
|
|
|
this.view.exchangeBox.addClass('hide');
|
|
|
this.view.useNowBox.addClass('hide');
|
|
|
}
|
|
|
|
|
|
if (itemClicked.data('num') === 0) {
|
|
|
this.view.tipBox.addClass('hide');
|
|
|
} else if (!this.closeTipbyUser) {
|
|
|
this.view.tipBox.removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -176,6 +191,7 @@ class SelectCouponController extends Page { |
|
|
* 关闭提示框
|
|
|
*/
|
|
|
closeTip() {
|
|
|
this.closeTipbyUser = true;
|
|
|
this.view.tipBox.hide();
|
|
|
}
|
|
|
}
|
...
|
...
|
|