...
|
...
|
@@ -22,10 +22,16 @@ var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()), |
|
|
ellipsis.init();
|
|
|
|
|
|
$newCoupon.on('submit', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if (!$this.find('[name="couponCode"]').val()) {
|
|
|
tip.show('请输入优惠券码');
|
|
|
return false;
|
|
|
}
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/cart/index/couponSearch',
|
|
|
data: $(this).serialize()
|
|
|
data: $this.serialize()
|
|
|
}).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
tip.show('优惠券可用');
|
...
|
...
|
@@ -33,7 +39,7 @@ $newCoupon.on('submit', function() { |
|
|
orderInfo('couponValue', res.data.coupon_value);
|
|
|
window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code;
|
|
|
} else {
|
|
|
tip.show(res.message);
|
|
|
tip.show(res.message || '网络错误');
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络错误');
|
...
|
...
|
|