|
@@ -16,11 +16,12 @@ var page = 1, |
|
@@ -16,11 +16,12 @@ var page = 1, |
16
|
isGetData;
|
16
|
isGetData;
|
17
|
|
17
|
|
18
|
var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
|
18
|
var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
|
19
|
- conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html());
|
19
|
+ conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
|
|
|
20
|
+ $newCoupon = $('#new-coupon');
|
20
|
|
21
|
|
21
|
ellipsis.init();
|
22
|
ellipsis.init();
|
22
|
|
23
|
|
23
|
-$('#search-coupon').on('submit', function() {
|
24
|
+$newCoupon.on('submit', function() {
|
24
|
$.ajax({
|
25
|
$.ajax({
|
25
|
method: 'POST',
|
26
|
method: 'POST',
|
26
|
url: '/shoppingCart/coupon',
|
27
|
url: '/shoppingCart/coupon',
|
|
@@ -43,6 +44,14 @@ $('#coupon-list').on('touchend', 'employ-main', function() { |
|
@@ -43,6 +44,14 @@ $('#coupon-list').on('touchend', 'employ-main', function() { |
43
|
orderInfo('couponCode', $(this).data('coupon-code'));
|
44
|
orderInfo('couponCode', $(this).data('coupon-code'));
|
44
|
});
|
45
|
});
|
45
|
|
46
|
|
|
|
47
|
+$newCoupon.find('input').on('input', function() {
|
|
|
48
|
+ if ($(this).val() !== '') {
|
|
|
49
|
+ $newCoupon.find('.submit').css('background', '#444');
|
|
|
50
|
+ } else {
|
|
|
51
|
+ $newCoupon.find('.submit').css('background', '#b0b0b0');
|
|
|
52
|
+ }
|
|
|
53
|
+});
|
|
|
54
|
+
|
46
|
function getCouponHandle(coupons) {
|
55
|
function getCouponHandle(coupons) {
|
47
|
var notAvailableCoupons = [];
|
56
|
var notAvailableCoupons = [];
|
48
|
|
57
|
|