Authored by 毕凯

Merge branch 'feature/cart' of http://git.dev.yoho.cn/web/yohobuy into feature/cart

... ... @@ -20,7 +20,8 @@ var $num,
$colorList = $('.color-list ul>li'),
$sizeList = $('.size-list ul>li'),
firstColorId = $colorList.eq(0).data('id'),
colorIndex;
colorIndex,
confirming;
//初始化购物车面板显示
$sizeList.each(function() {
... ... @@ -31,7 +32,7 @@ $sizeList.each(function() {
}
});
// confirm;
// var tpl;
... ... @@ -81,9 +82,12 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}).on('touchstart', '#chose-btn-sure', function() {
var productSku,
buyNumber = $('#good-num') - 0;
buyNumber = $('#good-num').val() - 0,
promotionId,
isEdit = 0,
numInCart = $('.num-tag').html() - 0;
// promotionId,
// goodsType,
// isEdit;
... ... @@ -91,31 +95,34 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
if (2 === $chosed.length && 0 === $chosed.closest('.zero-stock').length) {
productSku = $sizeList.closest('.chosed').data('skuid');
promotionId = $('[data-id="' + productSku + '"]').closest('.advance-block').data('promotion-id');
if (confirming) {
return false;
}
// if (confirm) {
// return false;
// }
// confirm = true;
confirming = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/cart/index/add',
data: {
productSku: productSku,
buyNumber: buyNumber
buyNumber: buyNumber,
promotionId: promotionId,
isEdit: isEdit
}
}).done(function(res) {
if (res.code === 200) {
loading.hideLoadingMask();
// confirm = false;
$('.num-tag').html(numInCart + buyNumber);
$('.num-tag').removeClass('hide');
confirming = false;
remove();
}
}).fail(function() {
tip.show('网络出了点问题~');
// confirm = false;
confirming = false;
});
}
... ...