Authored by 郭成尧

event-view-handle

... ... @@ -12,7 +12,7 @@
<p>店铺券、活动券、运费券可叠加使用;</p>
<p>跨店铺店铺券可以叠加使用,同一个店铺的店铺券不可叠加使用。</p>
</div>
<div class="close"><span class="iconfont">&#xe623;</span></div>
<div class="tip-close"><span class="iconfont">&#xe623;</span></div>
</div>
<div class="coupon-list">
<div class="coupon">
... ... @@ -31,5 +31,23 @@
<div class="check"><span class="iconfont checkbox icon-cb-radio"></span></div>
</div>
</div>
<div class="coupon">
<div class="coupon-left">
<p class="value">¥
<span>100</span>
</p>
<p class="threshold">满499可用</p>
</div>
<div class="coupon-right">
<div class="info">
<p class="title">
<span>[店铺券]</span>Adidas Origins店铺使用</p>
<p class="time">2018.1.12-2018.5.20</p>
</div>
<div class="check">
<span class="iconfont checkbox icon-radio"></span>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -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();
}
}
... ...