Authored by 郭成尧

Merge branch 'release/5.3.1' into 'gray'

套餐埋点修改



See merge request !83
@@ -66,6 +66,7 @@ const newDetail = { @@ -66,6 +66,7 @@ const newDetail = {
66 let productId = req.query.productId; 66 let productId = req.query.productId;
67 let skn = req.query.skn; 67 let skn = req.query.skn;
68 let bundleType = req.query.bundleType; 68 let bundleType = req.query.bundleType;
  69 + let gid = req.query.gid;
69 70
70 if ([brandId, productId].some(val => !val)) { 71 if ([brandId, productId].some(val => !val)) {
71 return next(); 72 return next();
@@ -75,7 +76,8 @@ const newDetail = { @@ -75,7 +76,8 @@ const newDetail = {
75 skn, 76 skn,
76 brandId, 77 brandId,
77 productId, 78 productId,
78 - bundleType 79 + bundleType,
  80 + gid
79 }).then(result => { 81 }).then(result => {
80 if (_.isEmpty(result)) { 82 if (_.isEmpty(result)) {
81 return next(); 83 return next();
@@ -217,14 +217,14 @@ const tool = { @@ -217,14 +217,14 @@ const tool = {
217 * @param skn 217 * @param skn
218 * @returns {{}} 218 * @returns {{}}
219 */ 219 */
220 - processBundle(bundleData, skn) { 220 + processBundle(bundleData, skn, gid) {
221 // let discountPrice = (_.get(bundleData, 'bundleInfo.salesPrice', 0) - 221 // let discountPrice = (_.get(bundleData, 'bundleInfo.salesPrice', 0) -
222 // _.get(bundleData, 'bundleInfo.discountPrice', 0)); 222 // _.get(bundleData, 'bundleInfo.discountPrice', 0));
223 // let priceShow = _.split(discountPrice + '', '.')[0]; 223 // let priceShow = _.split(discountPrice + '', '.')[0];
224 224
225 return { 225 return {
226 title: '优惠套装', 226 title: '优惠套装',
227 - href: helpers.urlFormat('/product/bundle/detail', {skn: skn}), 227 + href: helpers.urlFormat('/product/bundle/detail', {skn: skn, gid: gid}),
228 description: '立省¥' + _.get(bundleData, 'bundleInfo.subPrice', 0), 228 description: '立省¥' + _.get(bundleData, 'bundleInfo.subPrice', 0),
229 productList: productProcess.processProductList(bundleData && bundleData.productList) 229 productList: productProcess.processProductList(bundleData && bundleData.productList)
230 }; 230 };
@@ -292,6 +292,7 @@ const newDetail = { @@ -292,6 +292,7 @@ const newDetail = {
292 let brandId = params.brandId; 292 let brandId = params.brandId;
293 let productId = params.productId; 293 let productId = params.productId;
294 let skn = params.skn; 294 let skn = params.skn;
  295 + let gid = params.gid;
295 296
296 let apiArray = [ 297 let apiArray = [
297 this.queryShopsByBrandId(brandId), // 0 品牌信息 298 this.queryShopsByBrandId(brandId), // 0 品牌信息
@@ -329,7 +330,7 @@ const newDetail = { @@ -329,7 +330,7 @@ const newDetail = {
329 330
330 /* 套装 */ 331 /* 套装 */
331 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 1) { 332 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 1) {
332 - finalResult.bundleData = tool.processBundle(bundleData, skn); 333 + finalResult.bundleData = tool.processBundle(bundleData, skn, gid);
333 } 334 }
334 335
335 /* 量贩 */ 336 /* 量贩 */
@@ -27,26 +27,31 @@ $(function() { @@ -27,26 +27,31 @@ $(function() {
27 $selectBtn.on('touchend', function() { 27 $selectBtn.on('touchend', function() {
28 var self = $(this); 28 var self = $(this);
29 29
  30 + $.post('/product/detail/info', {
  31 + id: self.data('id'),
  32 + productSkn: self.data('skn')
  33 + }, function(data) {
  34 + chosePanelRender(data);
  35 + chosePanel.init(self.data('skn'));
  36 + chosePanel.show();
  37 + });
  38 +});
  39 +
  40 +$('.goods-img').on('touchend', function() {
  41 + var packGood = $(this).parent().find('.select-btn');
  42 +
30 if (window._yas && window._yas.sendCustomInfo) { 43 if (window._yas && window._yas.sendCustomInfo) {
31 window._yas.sendCustomInfo({ 44 window._yas.sendCustomInfo({
32 op: 'YB_GDS_PACKAGE_GOODS_C', 45 op: 'YB_GDS_PACKAGE_GOODS_C',
33 param: JSON.stringify({ 46 param: JSON.stringify({
34 C_ID: window._ChannelVary[window.cookie('_Channel')], 47 C_ID: window._ChannelVary[window.cookie('_Channel')],
35 - PRD_ID: window.queryString.id,  
36 - PACKAGE_GOODS: self.data('id'),  
37 - PACKAGE_INDEX: self.data('index') 48 + PRD_ID: window.queryString.gid,
  49 + PACKAGE_GOODS: packGood.data('id'),
  50 + PACKAGE_INDEX: packGood.data('index') + 1
38 }) 51 })
39 }, true); 52 }, true);
40 } 53 }
41 54
42 - $.post('/product/detail/info', {  
43 - id: self.data('id'),  
44 - productSkn: self.data('skn')  
45 - }, function(data) {  
46 - chosePanelRender(data);  
47 - chosePanel.init(self.data('skn'));  
48 - chosePanel.show();  
49 - });  
50 }); 55 });
51 56
52 /** 57 /**
@@ -57,7 +62,7 @@ $buyNowBtn.on('click', function() { @@ -57,7 +62,7 @@ $buyNowBtn.on('click', function() {
57 bundleId = $('#activityId').val(), 62 bundleId = $('#activityId').val(),
58 gskn = $('span[id^="gskn"]'), 63 gskn = $('span[id^="gskn"]'),
59 gsknSelected = false, 64 gsknSelected = false,
60 - yasGid = ''; 65 + yasGid = [];
61 66
62 if (gskn.length < 1) { 67 if (gskn.length < 1) {
63 tip.show('非法请求!'); 68 tip.show('非法请求!');
@@ -79,7 +84,7 @@ $buyNowBtn.on('click', function() { @@ -79,7 +84,7 @@ $buyNowBtn.on('click', function() {
79 buy_number: 1 84 buy_number: 1
80 }); 85 });
81 86
82 - yasGid += $(this).data('id') + ','; 87 + yasGid.push($(this).data('id'));
83 }); 88 });
84 89
85 if (window._yas && window._yas.sendCustomInfo) { 90 if (window._yas && window._yas.sendCustomInfo) {
@@ -88,7 +93,7 @@ $buyNowBtn.on('click', function() { @@ -88,7 +93,7 @@ $buyNowBtn.on('click', function() {
88 param: JSON.stringify({ 93 param: JSON.stringify({
89 C_ID: window._ChannelVary[window.cookie('_Channel')], 94 C_ID: window._ChannelVary[window.cookie('_Channel')],
90 PRD_ID: window.queryString.id, 95 PRD_ID: window.queryString.id,
91 - PACKAGE_GOODS: yasGid 96 + PACKAGE_GOODS: yasGid.join(',')
92 }) 97 })
93 }, true); 98 }, true);
94 } 99 }
@@ -99,7 +104,6 @@ $buyNowBtn.on('click', function() { @@ -99,7 +104,6 @@ $buyNowBtn.on('click', function() {
99 activity_id: bundleId 104 activity_id: bundleId
100 }), actCkOpthn); 105 }), actCkOpthn);
101 106
102 - window.location.href =  
103 - '/cart/index/orderEnsure?cartType=bundle&activityType=bundle'; 107 + // window.location.href = '/cart/index/orderEnsure?cartType=bundle&activityType=bundle';
104 } 108 }
105 }); 109 });
@@ -295,7 +295,8 @@ setTimeout(() => { @@ -295,7 +295,8 @@ setTimeout(() => {
295 skn: skn, 295 skn: skn,
296 productId: productId, 296 productId: productId,
297 brandId: brandId, 297 brandId: brandId,
298 - bundleType: bundleType 298 + bundleType: bundleType,
  299 + gid: goodsId
299 }).done(function(info) { 300 }).done(function(info) {
300 // step1: render dom 301 // step1: render dom
301 renderFeedbackStore(info, $feedbackStore); 302 renderFeedbackStore(info, $feedbackStore);
@@ -433,7 +433,7 @@ function search(opt) { @@ -433,7 +433,7 @@ function search(opt) {
433 if (window._yas && window._yas.sendCustomInfo) { 433 if (window._yas && window._yas.sendCustomInfo) {
434 434
435 window._yas.sendCustomInfo({ 435 window._yas.sendCustomInfo({
436 - op: 'YB_BRAND_GOODS_LIST_C', 436 + op: 'YB_BRAND_GOODS_LIST_L',
437 param: JSON.stringify(yasparm) 437 param: JSON.stringify(yasparm)
438 }, true); 438 }, true);
439 } 439 }
@@ -463,7 +463,7 @@ function search(opt) { @@ -463,7 +463,7 @@ function search(opt) {
463 setTimeout(function() { 463 setTimeout(function() {
464 if (window._yas && window._yas.sendCustomInfo) { 464 if (window._yas && window._yas.sendCustomInfo) {
465 window._yas.sendCustomInfo({ 465 window._yas.sendCustomInfo({
466 - op: 'YB_BRAND_GOODS_LIST_C', 466 + op: 'YB_BRAND_GOODS_LIST_L',
467 param: JSON.stringify(yasparm) 467 param: JSON.stringify(yasparm)
468 }, true); 468 }, true);
469 } 469 }
@@ -503,7 +503,7 @@ function search(opt) { @@ -503,7 +503,7 @@ function search(opt) {
503 setTimeout(function() { 503 setTimeout(function() {
504 if (window._yas && window._yas.sendCustomInfo) { 504 if (window._yas && window._yas.sendCustomInfo) {
505 window._yas.sendCustomInfo({ 505 window._yas.sendCustomInfo({
506 - op: 'YB_BRAND_GOODS_LIST_C', 506 + op: 'YB_BRAND_GOODS_LIST_L',
507 param: JSON.stringify(yasparm) 507 param: JSON.stringify(yasparm)
508 }, true); 508 }, true);
509 } 509 }