Merge branch 'feature/meal' into release/5.6
Showing
7 changed files
with
28 additions
and
11 deletions
@@ -296,11 +296,13 @@ const modifyProductNum = (req, res, next) => { | @@ -296,11 +296,13 @@ const modifyProductNum = (req, res, next) => { | ||
296 | let increaseNum = req.body.increaseNum || null; | 296 | let increaseNum = req.body.increaseNum || null; |
297 | let decreaseNum = req.body.decreaseNum || null; | 297 | let decreaseNum = req.body.decreaseNum || null; |
298 | let cartDelList = helper.getCartDelList(req, res); | 298 | let cartDelList = helper.getCartDelList(req, res); |
299 | + let batchNo = req.body.batch_no || null; | ||
299 | let activityId = req.body.activity_id || null; | 300 | let activityId = req.body.activity_id || null; |
300 | 301 | ||
301 | if (activityId) { | 302 | if (activityId) { |
302 | return service.bundleNumData({ | 303 | return service.bundleNumData({ |
303 | uid: uid, | 304 | uid: uid, |
305 | + batch_no: batchNo, | ||
304 | activity_id: activityId, | 306 | activity_id: activityId, |
305 | shopping_key: shoppingKey, | 307 | shopping_key: shoppingKey, |
306 | increaseNum: increaseNum, | 308 | increaseNum: increaseNum, |
@@ -38,6 +38,9 @@ const bundleNum = (params) => { | @@ -38,6 +38,9 @@ const bundleNum = (params) => { | ||
38 | params.decrease_number = parseInt(params.decreaseNum, 10); | 38 | params.decrease_number = parseInt(params.decreaseNum, 10); |
39 | } | 39 | } |
40 | 40 | ||
41 | + delete params.increaseNum; | ||
42 | + delete params.decreaseNum; | ||
43 | + | ||
41 | return api.get('', params, {code: 200}); | 44 | return api.get('', params, {code: 200}); |
42 | }; | 45 | }; |
43 | 46 |
@@ -507,8 +507,9 @@ const formatPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => | @@ -507,8 +507,9 @@ const formatPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => | ||
507 | poolId: p.pool_id, | 507 | poolId: p.pool_id, |
508 | poolTitle: p.pool_title, | 508 | poolTitle: p.pool_title, |
509 | isChecked: p.selected === 'Y', | 509 | isChecked: p.selected === 'Y', |
510 | - productNum: Number(p.pool_buy_number), | ||
511 | - storageNum: Number(p.pool_storage_number), | 510 | + batchNo: p.pool_batch_no, |
511 | + productNum: parseInt(p.pool_buy_number, 10), | ||
512 | + storageNum: parseInt(p.pool_storage_number, 10), | ||
512 | poolType: p.pool_type, | 513 | poolType: p.pool_type, |
513 | isBrandGroup: p.pool_type === 1, | 514 | isBrandGroup: p.pool_type === 1, |
514 | goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis), | 515 | goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis), |
@@ -542,18 +543,15 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => { | @@ -542,18 +543,15 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => { | ||
542 | poolId: p.pool_id, | 543 | poolId: p.pool_id, |
543 | poolTitle: p.pool_title, | 544 | poolTitle: p.pool_title, |
544 | isChecked: p.selected === 'Y', | 545 | isChecked: p.selected === 'Y', |
545 | - productNum: Number(p.pool_buy_number), | ||
546 | - storageNum: Number(p.pool_storage_number), | 546 | + batchNo: p.pool_batch_no, |
547 | + productNum: parseInt(p.pool_buy_number, 10), | ||
548 | + storageNum: parseInt(p.pool_storage_number, 10), | ||
547 | poolType: p.pool_type, | 549 | poolType: p.pool_type, |
548 | isBrandGroup: p.pool_type === 1, | 550 | isBrandGroup: p.pool_type === 1, |
549 | goodsList: formatCartGoods(p.goods_list, isAdvance, true, false, analysis), | 551 | goodsList: formatCartGoods(p.goods_list, isAdvance, true, false, analysis), |
550 | promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList) | 552 | promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList) |
551 | }; | 553 | }; |
552 | 554 | ||
553 | - if (p.sub_pool) { | ||
554 | - pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance, analysis); | ||
555 | - } | ||
556 | - | ||
557 | // 套餐不须要列表中有删除、收藏按钮 | 555 | // 套餐不须要列表中有删除、收藏按钮 |
558 | if (p.pool_type === 3) { | 556 | if (p.pool_type === 3) { |
559 | pool.goodsList = _disablePools(pool.goodsList, true, true); | 557 | pool.goodsList = _disablePools(pool.goodsList, true, true); |
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | data-pool-type="{{parent.poolType}}" | 18 | data-pool-type="{{parent.poolType}}" |
19 | {{#if isGift}} data-isgift="true"{{/if}} | 19 | {{#if isGift}} data-isgift="true"{{/if}} |
20 | {{#if isPriceGift}} data-ispricegift="true"{{/if}} | 20 | {{#if isPriceGift}} data-ispricegift="true"{{/if}} |
21 | + {{#if parent.batchNo}} data-batch-no="{{parent.batchNo}}"{{/if}} | ||
21 | {{#if parent.poolId}} data-pool-id="{{parent.poolId}}"{{/if}} > | 22 | {{#if parent.poolId}} data-pool-id="{{parent.poolId}}"{{/if}} > |
22 | <div class="pay-pro td {{#eq parent.poolType 3}} is-check{{/eq}}" style="width: 368px;"> | 23 | <div class="pay-pro td {{#eq parent.poolType 3}} is-check{{/eq}}" style="width: 368px;"> |
23 | {{#unless isGift}} | 24 | {{#unless isGift}} |
@@ -4,7 +4,8 @@ | @@ -4,7 +4,8 @@ | ||
4 | {{#inValid}} tr-disabled{{/inValid}} | 4 | {{#inValid}} tr-disabled{{/inValid}} |
5 | {{#isChecked}} active{{/isChecked}}" data-role="pitem" {{#if productNum}} data-productnum="{{productNum}}"{{/if}} | 5 | {{#isChecked}} active{{/isChecked}}" data-role="pitem" {{#if productNum}} data-productnum="{{productNum}}"{{/if}} |
6 | data-pool-type="{{poolType}}" | 6 | data-pool-type="{{poolType}}" |
7 | - data-pool-id="{{poolId}}"> | 7 | + data-pool-id="{{poolId}}" |
8 | + data-batch-no="{{batchNo}}"> | ||
8 | <div class="pay-pro td line-height" style="width: 516px;"> | 9 | <div class="pay-pro td line-height" style="width: 516px;"> |
9 | {{#if inValid}} | 10 | {{#if inValid}} |
10 | <i class="cart-item-disabled iconfont"></i> | 11 | <i class="cart-item-disabled iconfont"></i> |
@@ -67,6 +67,7 @@ function toggleAll(obj, roleType) { | @@ -67,6 +67,7 @@ function toggleAll(obj, roleType) { | ||
67 | $cartListWrap.find('[data-role=' + roleType + '] li[data-role=pitem]').each(function() { | 67 | $cartListWrap.find('[data-role=' + roleType + '] li[data-role=pitem]').each(function() { |
68 | var $t = $(this); | 68 | var $t = $(this); |
69 | var poolId = $t.data('pool-id'); | 69 | var poolId = $t.data('pool-id'); |
70 | + var batchNo = $t.data('batch-no'); | ||
70 | 71 | ||
71 | if ($t.find('.pay-pro').hasClass('is-check')) { | 72 | if ($t.find('.pay-pro').hasClass('is-check')) { |
72 | return true; | 73 | return true; |
@@ -81,6 +82,7 @@ function toggleAll(obj, roleType) { | @@ -81,6 +82,7 @@ function toggleAll(obj, roleType) { | ||
81 | selectArray.push({ | 82 | selectArray.push({ |
82 | selected: selected, | 83 | selected: selected, |
83 | activity_id: poolId, | 84 | activity_id: poolId, |
85 | + batch_no: batchNo, | ||
84 | product_sku: $(this).data('id'), | 86 | product_sku: $(this).data('id'), |
85 | buy_number: $(this).data('productnum'), | 87 | buy_number: $(this).data('productnum'), |
86 | promotion_id: $(this).data('promotionid') || 0 | 88 | promotion_id: $(this).data('promotionid') || 0 |
@@ -120,6 +122,7 @@ Cart = { | @@ -120,6 +122,7 @@ Cart = { | ||
120 | var $pitem = $this.closest('li[data-role="pitem"]'); | 122 | var $pitem = $this.closest('li[data-role="pitem"]'); |
121 | var item = []; | 123 | var item = []; |
122 | var poolId = $pitem.data('pool-id'); | 124 | var poolId = $pitem.data('pool-id'); |
125 | + var batchNo = $pitem.data('batch-no'); | ||
123 | var isTipnostore = true; | 126 | var isTipnostore = true; |
124 | 127 | ||
125 | // 套餐-单选 | 128 | // 套餐-单选 |
@@ -139,6 +142,7 @@ Cart = { | @@ -139,6 +142,7 @@ Cart = { | ||
139 | 142 | ||
140 | item.push({ | 143 | item.push({ |
141 | selected: $this.hasClass('cart-item-checked') ? 'N' : 'Y', // 'Y' : 'N', | 144 | selected: $this.hasClass('cart-item-checked') ? 'N' : 'Y', // 'Y' : 'N', |
145 | + batch_no: batchNo, | ||
142 | activity_id: poolId, | 146 | activity_id: poolId, |
143 | product_sku: $(this).data('id'), | 147 | product_sku: $(this).data('id'), |
144 | buy_number: $(this).data('productnum'), | 148 | buy_number: $(this).data('productnum'), |
@@ -180,6 +184,7 @@ Cart = { | @@ -180,6 +184,7 @@ Cart = { | ||
180 | var content = '<div><i class="iconfont"></i>删除商品</div><p>确定要从购物车中删除该商品?</p>'; | 184 | var content = '<div><i class="iconfont"></i>删除商品</div><p>确定要从购物车中删除该商品?</p>'; |
181 | var countJSON = []; | 185 | var countJSON = []; |
182 | var poolId = $item.data('pool-id'); | 186 | var poolId = $item.data('pool-id'); |
187 | + var batchNo = $item.data('batch-no'); | ||
183 | 188 | ||
184 | // 套餐删除 | 189 | // 套餐删除 |
185 | if (poolId && parseInt($item.data('pool-type'), 10) === 3) { | 190 | if (poolId && parseInt($item.data('pool-type'), 10) === 3) { |
@@ -189,6 +194,7 @@ Cart = { | @@ -189,6 +194,7 @@ Cart = { | ||
189 | } | 194 | } |
190 | 195 | ||
191 | selectArray.push({ | 196 | selectArray.push({ |
197 | + batch_no: batchNo, | ||
192 | activity_id: poolId, | 198 | activity_id: poolId, |
193 | product_sku: $(this).data('id'), | 199 | product_sku: $(this).data('id'), |
194 | buy_number: $(this).data('productnum'), | 200 | buy_number: $(this).data('productnum'), |
@@ -229,6 +235,7 @@ Cart = { | @@ -229,6 +235,7 @@ Cart = { | ||
229 | var $chk = $(this); | 235 | var $chk = $(this); |
230 | var $item = $chk.closest('[data-role=pitem]'); | 236 | var $item = $chk.closest('[data-role=pitem]'); |
231 | var poolId = $item.data('pool-id'); | 237 | var poolId = $item.data('pool-id'); |
238 | + var batchNo = $item.data('batch-no'); | ||
232 | 239 | ||
233 | if (!$chk.hasClass('cart-item-checked') || $chk.find('.pay-pro').hasClass('is-check')) { | 240 | if (!$chk.hasClass('cart-item-checked') || $chk.find('.pay-pro').hasClass('is-check')) { |
234 | return true; | 241 | return true; |
@@ -242,6 +249,7 @@ Cart = { | @@ -242,6 +249,7 @@ Cart = { | ||
242 | } | 249 | } |
243 | 250 | ||
244 | selectArray.push({ | 251 | selectArray.push({ |
252 | + batch_no: batchNo, | ||
245 | activity_id: poolId, | 253 | activity_id: poolId, |
246 | product_sku: $(this).data('id'), | 254 | product_sku: $(this).data('id'), |
247 | buy_number: $(this).data('productnum'), | 255 | buy_number: $(this).data('productnum'), |
@@ -285,7 +293,9 @@ Cart = { | @@ -285,7 +293,9 @@ Cart = { | ||
285 | 293 | ||
286 | var $item = $(this); | 294 | var $item = $(this); |
287 | var poolId = $item.data('pool-id'); | 295 | var poolId = $item.data('pool-id'); |
296 | + var batchNo = $item.data('batch-no'); | ||
288 | 297 | ||
298 | + // 过滤套餐商品列表数据 | ||
289 | if ($item.find('.pay-pro').hasClass('is-check')) { | 299 | if ($item.find('.pay-pro').hasClass('is-check')) { |
290 | return true; | 300 | return true; |
291 | } | 301 | } |
@@ -298,6 +308,7 @@ Cart = { | @@ -298,6 +308,7 @@ Cart = { | ||
298 | } | 308 | } |
299 | 309 | ||
300 | selectArray.push({ | 310 | selectArray.push({ |
311 | + batch_no: batchNo, | ||
301 | activity_id: poolId, | 312 | activity_id: poolId, |
302 | product_sku: $(this).data('id'), | 313 | product_sku: $(this).data('id'), |
303 | buy_number: $(this).data('productnum'), | 314 | buy_number: $(this).data('productnum'), |
@@ -405,7 +416,8 @@ Cart = { | @@ -405,7 +416,8 @@ Cart = { | ||
405 | 416 | ||
406 | capi.cartItemNumChg($.extend(countJSON, { | 417 | capi.cartItemNumChg($.extend(countJSON, { |
407 | sku: $item.data('id'), | 418 | sku: $item.data('id'), |
408 | - activity_id: $item.data('pool-id') | 419 | + batch_no: $item.data('batch-no'), |
420 | + activity_id: $item.data('pool-id'), | ||
409 | })); | 421 | })); |
410 | 422 | ||
411 | if (!$btn.hasClass('cart-item-checked')) { | 423 | if (!$btn.hasClass('cart-item-checked')) { |
-
Please register or login to post a comment