Authored by yyq

mini bag 删除商品

... ... @@ -76,6 +76,39 @@ $('.yoho-group a').hover(function() {
$(this).text(data.en);
});
$bagGoodsList.on('click', '.del-good-btn', function() {
var $this = $(this),
data = $this.data();
var list = [];
if (!data) {
return;
}
list.push({
goods_type: data.type,
buy_number: data.num,
selected: 'Y',
product_sku: data.sku,
promotion_id: data.pid
});
$.ajax({
type: 'DELETE',
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(list)},
success: function(result) {
var num = parseInt($bagNum.text(), 10) || 0;
if (result.code === 200) {
num = num - data.num;
$bagNum.text(num);
$this.closest('.goods-item').remove();
}
}
});
});
$('.contain-third').on({
mouseenter: function() {
var $thirdWrapper = $(this).children('.third-nav-wrapper');
... ...
... ... @@ -11,7 +11,7 @@
</div>
<div class="price">
<p>¥{{round sales_price 2}} X{{buy_number}}</p>
<span class="del-good-btn">删除</span>
<span class="del-good-btn" data-type="{{goods_type}}" data-num="{{buy_number}}" data-num="{{buy_number}}" data-sku="{{product_sku}}" data-pid="{{promotion_id}}">删除</span>
</div>
</dd>
{{/ goods}}
\ No newline at end of file
... ...