...
|
...
|
@@ -10,7 +10,8 @@ class SelectGiftCard extends Page { |
|
|
this.selector = {
|
|
|
rule: $('#rule'),
|
|
|
page: $('.select-giftcard-page'),
|
|
|
giftcard: $('.giftcard')
|
|
|
giftcard: $('.giftcard'),
|
|
|
useGiftCardBtn: $('#useGiftCardBtn')
|
|
|
};
|
|
|
this.init();
|
|
|
this.bindEvents();
|
...
|
...
|
@@ -24,6 +25,25 @@ class SelectGiftCard extends Page { |
|
|
|
|
|
bindEvents() {
|
|
|
this.selector.giftcard.on('click', '.checkbox', this.checkboxClickHandle.bind(this));
|
|
|
this.selector.useGiftCardBtn.on('click', this.useGiftCard.bind(this));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 使用礼品卡
|
|
|
*/
|
|
|
useGiftCard() {
|
|
|
console.log('ok');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 改变 使用 按钮状态
|
|
|
*/
|
|
|
changeUseBtnStatus() {
|
|
|
if (this.selector.giftcard.hasClass('checked')) {
|
|
|
this.selector.useGiftCardBtn.addClass('active');
|
|
|
} else {
|
|
|
this.selector.useGiftCardBtn.removeClass('active');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -37,6 +57,8 @@ class SelectGiftCard extends Page { |
|
|
} else {
|
|
|
theGiftCard.addClass('checked');
|
|
|
}
|
|
|
|
|
|
this.changeUseBtnStatus();
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|