Authored by 郝肖肖

套餐滑动到库存不足提示

... ... @@ -52,14 +52,17 @@
{{#and isAdvance preSellDate}}
<span class="presell">上市期:{{preSellDate}}</span>
{{/and}}
{{#if isSoldOut}}
<span>
<b>已售罄</b>
</span>
{{/if}}
{{#and inValid storageNum}}
<span class="mark-bg-white cursor-p" data-role="readd2cart2">重新加入购物车</span>
{{/and}}
{{#eq parent.poolType 3}}
{{#if isSoldOut}}
<span>
<b>已售罄</b>
</span>
{{/if}}
{{#and inValid storageNum}}
<span class="mark-bg-white cursor-p" data-role="readd2cart2">重新加入购物车</span>
{{/and}}
{{/eq}}
</p>
</div>
<div class="product-price td" style="width:148px;">¥{{productPrice}}
... ...
... ... @@ -179,29 +179,11 @@
<!-- -->
{{#soldOutPools}}
<div class="mt20">
<div class="promotion-pool mt20" data-role="promotion-pool">
{{#eq poolType 3}}
{{>mix/cart/cart-pool-title}}
{{else if promotionInfos}}
<div class="gift-sell mt20">
{{#promotionInfos}}
{{>mix/cart/cart-promotion-info}}
{{/promotionInfos}}
</div>
{{/eq}}
{{#if subs}}
<div class="cart-table">
{{#each subs}}
<ul class="table {{#isBrandGroup}}table-group{{/isBrandGroup}}">
{{#each goodsList}}
{{> mix/cart/cart-item parent=..}}
{{/each}}
</ul>
{{/each}}
</div>
{{/if}}
{{#if goodsList}}
<div class="cart-table">
<ul class="table {{#isBrandGroup}}table-group{{/isBrandGroup}}">
... ...
... ... @@ -95,7 +95,7 @@ function toggleAll(obj, roleType) {
if (selected === 'Y' && $noStores && $noStores.length > 0) { // 无库存提示
$('html,body').animate({scrollTop: $noStores.eq(0).offset().top - 50 + 'px'}, 500);
$('html,body').animate({scrollTop: $noStores.eq(0).closest('li').offset().top + 'px'}, 500);
$noStores.each(function() {
toastNoStore($(this).closest('li[data-role=pitem]'), '您全选的商品中存在库存不足商品,已帮您自动取消勾选');
... ... @@ -114,13 +114,12 @@ Cart = {
var $this = $(this);
var $pitem = $this.closest('li[data-role="pitem"]');
var item;
var item = [];
var poolId = $pitem.data('pool-id');
var isTipnostore = true;
// 套餐-单选
if (poolId && parseInt($pitem.data('pool-type'), 10) === 3) {
item = [];
$pitem.closest('.promotion-pool').find('li[data-pool-id="' + poolId + '"]').each(function() {
if (!$(this).data('id')) {
... ... @@ -151,15 +150,13 @@ Cart = {
return;
}
item = {
return capi.choiceOut({
product_sku: $pitem.data('id'),
selected: $this.hasClass('cart-item-checked') ? 'N' : 'Y', // 'Y' : 'N',
buy_number: $pitem.data('productnum'),
goods_type: $pitem.data('goodstype'),
promotion_id: $pitem.data('promotionid') ? $pitem.data('promotionid') : 0
};
return capi.choiceOut(item);
});
},
toggleSelectAll: function() { // 全部
... ... @@ -385,8 +382,6 @@ Cart = {
var $this = $(this);
var $item = $this.closest('li[data-role=pitem]');
var $btn = $item.find('.cart-item-check');
// var storagenum = $item.data('storagenum') ? $item.data('storagenum') * 1 : 0;
var countJSON = {};
var oprType = $this.hasClass('minus') ? 'decreaseNum' : 'increaseNum';
... ...