select-coupon-modified
Showing
1 changed file
with
9 additions
and
8 deletions
@@ -83,9 +83,10 @@ $couponList.on('touchstart', '.employ-main', function() { | @@ -83,9 +83,10 @@ $couponList.on('touchstart', '.employ-main', function() { | ||
83 | $('body').on('touchend', '.not-use', function() { | 83 | $('body').on('touchend', '.not-use', function() { |
84 | orderInfo('couponCode', null); | 84 | orderInfo('couponCode', null); |
85 | orderInfo('couponName', null); | 85 | orderInfo('couponName', null); |
86 | - //实付金额发生变化,使用有货币为0 | 86 | + |
87 | + // 实付金额发生变化,使用有货币为0 | ||
87 | orderInfo('yohoCoin', 0); | 88 | orderInfo('yohoCoin', 0); |
88 | - location.href = '/cart/index/orderEnsure'; | 89 | + location.href = '/cart/index/new/orderEnsure'; |
89 | }); | 90 | }); |
90 | 91 | ||
91 | 92 | ||
@@ -127,9 +128,8 @@ function getCouponHandle(allCoupons) { | @@ -127,9 +128,8 @@ function getCouponHandle(allCoupons) { | ||
127 | })).find('.employ-main').each(function(i, elem) { | 128 | })).find('.employ-main').each(function(i, elem) { |
128 | var employHammer = new Hammer(elem); | 129 | var employHammer = new Hammer(elem); |
129 | 130 | ||
130 | - employHammer.on('tap', function(e) { | ||
131 | - var $this = $(e.srcEvent.currentTarget); | ||
132 | - var couponCode = $this.data('coupon-code'); | 131 | + employHammer.on('tap', function() { |
132 | + var couponCode = $(elem).data('coupon-code'); | ||
133 | 133 | ||
134 | $.ajax({ | 134 | $.ajax({ |
135 | method: 'POST', | 135 | method: 'POST', |
@@ -140,12 +140,13 @@ function getCouponHandle(allCoupons) { | @@ -140,12 +140,13 @@ function getCouponHandle(allCoupons) { | ||
140 | }).then(function(res) { | 140 | }).then(function(res) { |
141 | if (res.code === 200) { | 141 | if (res.code === 200) { |
142 | 142 | ||
143 | - //tip.show('优惠券可用'); | 143 | + // tip.show('优惠券可用'); |
144 | orderInfo('couponCode', res.data.coupon_code); | 144 | orderInfo('couponCode', res.data.coupon_code); |
145 | orderInfo('couponName', res.data.coupon_title); | 145 | orderInfo('couponName', res.data.coupon_title); |
146 | - //实付金额发生变化,使用有货币为0 | 146 | + |
147 | + // 实付金额发生变化,使用有货币为0 | ||
147 | orderInfo('yohoCoin', 0); | 148 | orderInfo('yohoCoin', 0); |
148 | - window.location.href = '/cart/index/orderEnsure'; | 149 | + window.location.href = '/cart/index/new/orderEnsure'; |
149 | } else if (res.message) { | 150 | } else if (res.message) { |
150 | tip.show(res.message); | 151 | tip.show(res.message); |
151 | } | 152 | } |
-
Please register or login to post a comment