Authored by 郭成尧

pool-barch-no

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-04-06 16:51:52 3 * @Date: 2017-04-06 16:51:52
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-04-12 11:24:53 5 + * @Last Modified time: 2017-04-12 14:01:07
6 */ 6 */
7 7
8 const $ = require('yoho-jquery'); 8 const $ = require('yoho-jquery');
@@ -16,6 +16,7 @@ let bundle = { @@ -16,6 +16,7 @@ let bundle = {
16 16
17 let $bundle = $('.bundle'); // 限定作用域 17 let $bundle = $('.bundle'); // 限定作用域
18 let activityId = $bundle.data('activityid'); 18 let activityId = $bundle.data('activityid');
  19 + let batchNo = $bundle.data('poolbatchno');
19 20
20 self.handle = handle; 21 self.handle = handle;
21 22
@@ -23,8 +24,16 @@ let bundle = { @@ -23,8 +24,16 @@ let bundle = {
23 * 减少套餐数量 24 * 减少套餐数量
24 */ 25 */
25 $bundle.on('click', '.bundle-nums .num-opt .btn-opt-minus', function(e) { 26 $bundle.on('click', '.bundle-nums .num-opt .btn-opt-minus', function(e) {
  27 + let skuIdsArray = [];
  28 +
  29 + $(e.delegateTarget).find('.good-item').each(function() {
  30 + skuIdsArray.push($(this).data('id'));
  31 + });
  32 +
26 self.decrBundle({ 33 self.decrBundle({
27 - activity_id: activityId 34 + activity_id: activityId,
  35 + batch_no: batchNo,
  36 + sku_ids: skuIdsArray.join(',')
28 }, e); 37 }, e);
29 }); 38 });
30 39
@@ -32,8 +41,16 @@ let bundle = { @@ -32,8 +41,16 @@ let bundle = {
32 * 增加套餐数量 41 * 增加套餐数量
33 */ 42 */
34 $bundle.on('click', '.bundle-nums .num-opt .btn-opt-plus', function(e) { 43 $bundle.on('click', '.bundle-nums .num-opt .btn-opt-plus', function(e) {
  44 + let skuIdsArray = [];
  45 +
  46 + $(e.delegateTarget).find('.good-item').each(function() {
  47 + skuIdsArray.push($(this).data('id'));
  48 + });
  49 +
35 self.incrBundle({ 50 self.incrBundle({
36 - activity_id: activityId 51 + activity_id: activityId,
  52 + batch_no: batchNo,
  53 + sku_ids: skuIdsArray.join(',')
37 }, e); 54 }, e);
38 }); 55 });
39 56
@@ -111,6 +128,7 @@ let bundle = { @@ -111,6 +128,7 @@ let bundle = {
111 product_sku: $(element).data('id'), 128 product_sku: $(element).data('id'),
112 buy_number: $(e.delegateTarget).data('buynum'), 129 buy_number: $(e.delegateTarget).data('buynum'),
113 activity_id: $(e.delegateTarget).data('activityid'), 130 activity_id: $(e.delegateTarget).data('activityid'),
  131 + batch_no: $(e.delegateTarget).data('poolbatchno'),
114 selected: selected 132 selected: selected
115 }); 133 });
116 }); 134 });