...
|
...
|
@@ -435,7 +435,6 @@ function bindGiftWinAction($el) { |
|
|
|
|
|
var $this = $(this);
|
|
|
var idx = $this.index();
|
|
|
console.log(idx);
|
|
|
var $detail = $this.closest('.detail-goods');
|
|
|
var $sizes = $detail.find('[data-role=sizes] .size-row');
|
|
|
var $detailBigpic = $detail.find('.detail-bigpic');
|
...
|
...
|
@@ -448,10 +447,9 @@ console.log(idx); |
|
|
$this.siblings('.color').find('p').removeClass('active');
|
|
|
$this.find('p').addClass('active');
|
|
|
|
|
|
$sizes.addClass('none').eq(idx).removeClass('none');
|
|
|
// console.log($sizes.addClass('none').eq(idx));
|
|
|
$sizes.addClass('none');
|
|
|
$curSize.removeClass('none');
|
|
|
|
|
|
return;
|
|
|
if ($curSize.find('span').length < 2) {
|
|
|
$curSize.find('span:first').addClass('active');
|
|
|
}
|
...
|
...
|
@@ -536,6 +534,7 @@ console.log(idx); |
|
|
var allNum = $curSize.data('num');
|
|
|
var sku = $curSize.data('sku');
|
|
|
var promotionId = $this.closest('.product-detail-info').data('promotionid') || 0;
|
|
|
var isSwap = $this.closest('.product-detail-info').data('swap');
|
|
|
|
|
|
if ($curSize.length <= 0) {
|
|
|
new Alert('请选择尺码').show();
|
...
|
...
|
@@ -551,11 +550,16 @@ console.log(idx); |
|
|
new Alert('该商品无法加入购物车').show();
|
|
|
}*/
|
|
|
|
|
|
addcart({
|
|
|
productSku: sku,
|
|
|
buyNumber: $num.val(),
|
|
|
promotionId: promotionId
|
|
|
});
|
|
|
// 替换促销商品
|
|
|
if(isSwap) {
|
|
|
updateCartGiftItem(promotionId, newSkn, sku);
|
|
|
} else {
|
|
|
addcart({
|
|
|
productSku: sku,
|
|
|
buyNumber: $num.val(),
|
|
|
promotionId: promotionId
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -848,7 +852,7 @@ var Cart = { |
|
|
|
|
|
// 加价购更换
|
|
|
if($item.data('isgift') || $item.data('ispricegift')) {
|
|
|
return updateCartGiftItem(promotionId, newSkn,newSku);
|
|
|
return updateCartGiftItem(promotionId, newSkn, newSku);
|
|
|
}
|
|
|
updateCartItem(newSku, oldSku);
|
|
|
},
|
...
|
...
|
@@ -893,10 +897,9 @@ var Cart = { |
|
|
var $wrap = $this.closest('[data-role="promotion-wrap"]');
|
|
|
var promotionid = $wrap.data('promotionid');
|
|
|
var promotionInfo = $wrap.data('_promotionInfo');
|
|
|
var role = $this.data('role');
|
|
|
var isSwap = role === 'pg-resel-btn' || role === 'gift-resel-btn';
|
|
|
|
|
|
console.log($this);
|
|
|
console.log($wrap);
|
|
|
console.log(promotionid);
|
|
|
if (!promotionInfo) {
|
|
|
getProductByPromotionId(promotionid).done(function(pinfo) {
|
|
|
|
...
|
...
|
@@ -906,6 +909,7 @@ var Cart = { |
|
|
}
|
|
|
|
|
|
promotionInfo = pinfo.data;
|
|
|
promotionInfo.isSwap = isSwap;
|
|
|
|
|
|
$wrap.data('_promotionInfo', promotionInfo);
|
|
|
renderAndShowGiftWin(promotionInfo);
|
...
|
...
|
|