Authored by 陈峰

Merge branch 'hotfix/presale-cart-message' into 'release/6.8.6'

购物车编辑时增减数量不显示预购商品提示,单独更新某个商品数量返回时正确更改购物车中的数量



See merge request !1689
<div class="good-item{{#if lowStocks}} low-stocks{{/if}}{{#if isStudents}} is-students{{/if}}{{#if isVipPrice}} is-vip-price{{/if}}{{#ifand checked showCheckbox}} is-checked{{/ifand}}{{#if noEdit}} no-edit{{/if}}{{#if inValid}} in-valid{{/if}}{{#if inValidLow}} in-valid-low{{/if}}{{#ifor isGift isAdvanceBuy}} is-gift{{/ifor}}" data-promotion="{{promotion_id}}" data-id="{{id}}" data-skn="{{skn}}" data-mnum="{{minNumber}}" data-link="{{link}}" data-activityid="{{parent.poolId}}" data-poolbatchno="{{parent.poolBatchNo}}">
<div class="opt">
{{#if showCheckbox}}
<i class="iconfont chk select{{#if checked}} checked{{/if}}"></i>
<i class="iconfont {{#if sale_time_str}}presale{{/if}} chk select{{#if checked}} checked{{/if}}"></i>
{{/if}}
<i class="iconfont chk edit"></i>
{{#inValid}}
... ...
... ... @@ -200,6 +200,7 @@ let goodObj = {
self.handle.posting = true;
let skuData = self.getSelectGoodData(eles, selectAll);
loading.showLoading();
return $.ajax({
type: 'post',
... ... @@ -317,6 +318,7 @@ let goodObj = {
});
},
getSelectGoodData(eles, selectAll) {
return Array.from(eles.map((i, ele) => {
let $this = $(ele),
$good = $this.closest('.good-item'),
... ... @@ -324,7 +326,6 @@ let goodObj = {
promotion = $good.data('promotion'),
batch_no = $good.data('poolbatchno'),
activity_id = $good.data('activityid');
let goodInfo = {};
goodInfo.goods_type = $('#cartType').val();
... ... @@ -333,6 +334,9 @@ let goodObj = {
} else {
goodInfo.selected = $this.hasClass('checked') ? 'N' : 'Y';
}
if ($this.hasClass('presale')) {
goodInfo.selected = 'N';
}
goodInfo.product_sku = id;
goodInfo.promotion_id = promotion;
goodInfo.buy_number = $good.find('.good-num').val();
... ...
... ... @@ -111,7 +111,8 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid, inValidLow) => {
isVipPrice: goodData.sales_price !== goodData.last_vip_price && goodData.discount_tag === 'V',
isStudents: goodData.sales_price !== goodData.last_vip_price && goodData.discount_tag === 'S',
count: goodData.buy_number,
promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id
promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id,
sale_time_str: !!goodData.sale_time_str // 如果有sale_time_str字段有值。则为true
};
goodData.storage_number = _.parseInt(goodData.storage_number);
... ...