Authored by 郭成尧

select-coupon-modified

... ... @@ -83,9 +83,10 @@ $couponList.on('touchstart', '.employ-main', function() {
$('body').on('touchend', '.not-use', function() {
orderInfo('couponCode', null);
orderInfo('couponName', null);
//实付金额发生变化,使用有货币为0
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
location.href = '/cart/index/orderEnsure';
location.href = '/cart/index/new/orderEnsure';
});
... ... @@ -127,9 +128,8 @@ function getCouponHandle(allCoupons) {
})).find('.employ-main').each(function(i, elem) {
var employHammer = new Hammer(elem);
employHammer.on('tap', function(e) {
var $this = $(e.srcEvent.currentTarget);
var couponCode = $this.data('coupon-code');
employHammer.on('tap', function() {
var couponCode = $(elem).data('coupon-code');
$.ajax({
method: 'POST',
... ... @@ -140,12 +140,13 @@ function getCouponHandle(allCoupons) {
}).then(function(res) {
if (res.code === 200) {
//tip.show('优惠券可用');
// tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponName', res.data.coupon_title);
//实付金额发生变化,使用有货币为0
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
window.location.href = '/cart/index/orderEnsure';
window.location.href = '/cart/index/new/orderEnsure';
} else if (res.message) {
tip.show(res.message);
}
... ...