Authored by 郝肖肖

Merge branch 'feature/meal' into release/5.6

... ... @@ -296,11 +296,13 @@ const modifyProductNum = (req, res, next) => {
let increaseNum = req.body.increaseNum || null;
let decreaseNum = req.body.decreaseNum || null;
let cartDelList = helper.getCartDelList(req, res);
let batchNo = req.body.batch_no || null;
let activityId = req.body.activity_id || null;
if (activityId) {
return service.bundleNumData({
uid: uid,
batch_no: batchNo,
activity_id: activityId,
shopping_key: shoppingKey,
increaseNum: increaseNum,
... ...
... ... @@ -38,6 +38,9 @@ const bundleNum = (params) => {
params.decrease_number = parseInt(params.decreaseNum, 10);
}
delete params.increaseNum;
delete params.decreaseNum;
return api.get('', params, {code: 200});
};
... ...
... ... @@ -507,8 +507,9 @@ const formatPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) =>
poolId: p.pool_id,
poolTitle: p.pool_title,
isChecked: p.selected === 'Y',
productNum: Number(p.pool_buy_number),
storageNum: Number(p.pool_storage_number),
batchNo: p.pool_batch_no,
productNum: parseInt(p.pool_buy_number, 10),
storageNum: parseInt(p.pool_storage_number, 10),
poolType: p.pool_type,
isBrandGroup: p.pool_type === 1,
goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis),
... ... @@ -542,18 +543,15 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => {
poolId: p.pool_id,
poolTitle: p.pool_title,
isChecked: p.selected === 'Y',
productNum: Number(p.pool_buy_number),
storageNum: Number(p.pool_storage_number),
batchNo: p.pool_batch_no,
productNum: parseInt(p.pool_buy_number, 10),
storageNum: parseInt(p.pool_storage_number, 10),
poolType: p.pool_type,
isBrandGroup: p.pool_type === 1,
goodsList: formatCartGoods(p.goods_list, isAdvance, true, false, analysis),
promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
};
if (p.sub_pool) {
pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance, analysis);
}
// 套餐不须要列表中有删除、收藏按钮
if (p.pool_type === 3) {
pool.goodsList = _disablePools(pool.goodsList, true, true);
... ...
... ... @@ -18,6 +18,7 @@
data-pool-type="{{parent.poolType}}"
{{#if isGift}} data-isgift="true"{{/if}}
{{#if isPriceGift}} data-ispricegift="true"{{/if}}
{{#if parent.batchNo}} data-batch-no="{{parent.batchNo}}"{{/if}}
{{#if parent.poolId}} data-pool-id="{{parent.poolId}}"{{/if}} >
<div class="pay-pro td {{#eq parent.poolType 3}} is-check{{/eq}}" style="width: 368px;">
{{#unless isGift}}
... ...
... ... @@ -4,7 +4,8 @@
{{#inValid}} tr-disabled{{/inValid}}
{{#isChecked}} active{{/isChecked}}" data-role="pitem" {{#if productNum}} data-productnum="{{productNum}}"{{/if}}
data-pool-type="{{poolType}}"
data-pool-id="{{poolId}}">
data-pool-id="{{poolId}}"
data-batch-no="{{batchNo}}">
<div class="pay-pro td line-height" style="width: 516px;">
{{#if inValid}}
<i class="cart-item-disabled iconfont"></i>
... ...
... ... @@ -67,6 +67,7 @@ function toggleAll(obj, roleType) {
$cartListWrap.find('[data-role=' + roleType + '] li[data-role=pitem]').each(function() {
var $t = $(this);
var poolId = $t.data('pool-id');
var batchNo = $t.data('batch-no');
if ($t.find('.pay-pro').hasClass('is-check')) {
return true;
... ... @@ -81,6 +82,7 @@ function toggleAll(obj, roleType) {
selectArray.push({
selected: selected,
activity_id: poolId,
batch_no: batchNo,
product_sku: $(this).data('id'),
buy_number: $(this).data('productnum'),
promotion_id: $(this).data('promotionid') || 0
... ... @@ -120,6 +122,7 @@ Cart = {
var $pitem = $this.closest('li[data-role="pitem"]');
var item = [];
var poolId = $pitem.data('pool-id');
var batchNo = $pitem.data('batch-no');
var isTipnostore = true;
// 套餐-单选
... ... @@ -139,6 +142,7 @@ Cart = {
item.push({
selected: $this.hasClass('cart-item-checked') ? 'N' : 'Y', // 'Y' : 'N',
batch_no: batchNo,
activity_id: poolId,
product_sku: $(this).data('id'),
buy_number: $(this).data('productnum'),
... ... @@ -180,6 +184,7 @@ Cart = {
var content = '<div><i class="iconfont">&#xe684;</i>删除商品</div><p>确定要从购物车中删除该商品?</p>';
var countJSON = [];
var poolId = $item.data('pool-id');
var batchNo = $item.data('batch-no');
// 套餐删除
if (poolId && parseInt($item.data('pool-type'), 10) === 3) {
... ... @@ -189,6 +194,7 @@ Cart = {
}
selectArray.push({
batch_no: batchNo,
activity_id: poolId,
product_sku: $(this).data('id'),
buy_number: $(this).data('productnum'),
... ... @@ -229,6 +235,7 @@ Cart = {
var $chk = $(this);
var $item = $chk.closest('[data-role=pitem]');
var poolId = $item.data('pool-id');
var batchNo = $item.data('batch-no');
if (!$chk.hasClass('cart-item-checked') || $chk.find('.pay-pro').hasClass('is-check')) {
return true;
... ... @@ -242,6 +249,7 @@ Cart = {
}
selectArray.push({
batch_no: batchNo,
activity_id: poolId,
product_sku: $(this).data('id'),
buy_number: $(this).data('productnum'),
... ... @@ -285,7 +293,9 @@ Cart = {
var $item = $(this);
var poolId = $item.data('pool-id');
var batchNo = $item.data('batch-no');
// 过滤套餐商品列表数据
if ($item.find('.pay-pro').hasClass('is-check')) {
return true;
}
... ... @@ -298,6 +308,7 @@ Cart = {
}
selectArray.push({
batch_no: batchNo,
activity_id: poolId,
product_sku: $(this).data('id'),
buy_number: $(this).data('productnum'),
... ... @@ -405,7 +416,8 @@ Cart = {
capi.cartItemNumChg($.extend(countJSON, {
sku: $item.data('id'),
activity_id: $item.data('pool-id')
batch_no: $item.data('batch-no'),
activity_id: $item.data('pool-id'),
}));
if (!$btn.hasClass('cart-item-checked')) {
... ...
... ... @@ -302,7 +302,7 @@
}
}
.is-check i {
.is-check i.cart-item-check {
visibility: hidden !important;
}
... ...