Authored by 郝肖肖

Merge branch 'feature/giftCart' of git.yoho.cn:fe/yohobuy-node into feature/giftCart

... ... @@ -67,6 +67,12 @@ const getEasypayComputeAsync = (uid, cartType, paymentType, deliveryWay, other)
});
}
if (other.giftCard) {
Object.assign(param, {
gift_card_code: other.giftCard
});
}
if (other.promotionCode) {
Object.assign(param, {
promotion_code: other.promotionCode
... ...
... ... @@ -708,7 +708,9 @@ giftCard = {
url: '/cart/ensure/giftcards'
}).then(function(data) {
if (data.code === 200) {
$('.can-use-tip', that.$el).text('(' + data.data.usable_giftCards.length + '张可用)');
if (data.data && data.data.usable_giftCards && data.data.usable_giftCards.length) {
$('.can-use-tip', that.$el).text('(' + data.data.usable_giftCards.length + '张可用)');
}
if (data.data.usable_giftCards.length) {
$('tbody', that.$giftCardWrap).html(giftCardTpl(data.data));
... ... @@ -856,6 +858,7 @@ function submitOrder(reqData) {
sku: [],
py: []
};
var errAlert;
if (data.code === 200) {
rdata = data.data;
... ... @@ -933,7 +936,9 @@ function submitOrder(reqData) {
location.href = rdata.url;
}
} else if (data.message) {
new dialog.Alert(data.message).show();
errAlert = new dialog.Alert(data.message);
errAlert.$el.addClass('ensure-alert');
errAlert.show();
}
});
}
... ... @@ -1036,7 +1041,7 @@ $('#order-submit').click(function() {
if (that.seconds > 0) {
that.$sendBtn.text((that.seconds--) + 's').addClass('timer');
} else {
that.$sendBtn.text('获取验证码').removeClass('timer');
that.$sendBtn.text('重新获取').removeClass('timer');
clearInterval(that.timer);
}
}, 1000);
... ...
... ... @@ -1939,3 +1939,7 @@
}
}
}
.ensure-alert .content {
padding: 60px 0 0;
}
... ...