...
|
...
|
@@ -4,6 +4,36 @@ import Page from 'yoho-page'; |
|
|
class SelectCouponController extends Page {
|
|
|
constructor() {
|
|
|
super();
|
|
|
|
|
|
this.view = {
|
|
|
coupon: $('.coupon'),
|
|
|
checkbox: $('.checkbox'),
|
|
|
tipBox: $('.tip-box'),
|
|
|
tipClose: $('.tip-close')
|
|
|
};
|
|
|
|
|
|
this.view.coupon.on('click', '.checkbox', this.check.bind(this));
|
|
|
this.view.tipClose.on('click', this.closeTip.bind(this));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券勾选处理
|
|
|
*/
|
|
|
check(e) {
|
|
|
let theCoupon = $(e.currentTarget);
|
|
|
|
|
|
if (theCoupon.hasClass('icon-cb-radio')) {
|
|
|
theCoupon.removeClass('icon-cb-radio').addClass('icon-radio');
|
|
|
} else {
|
|
|
theCoupon.removeClass('icon-radio').addClass('icon-cb-radio');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 关闭提示框
|
|
|
*/
|
|
|
closeTip() {
|
|
|
this.view.tipBox.hide();
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|