Authored by zhangxiaoru

埋点修改

... ... @@ -66,6 +66,7 @@ const newDetail = {
let productId = req.query.productId;
let skn = req.query.skn;
let bundleType = req.query.bundleType;
let gid = req.query.gid;
if ([brandId, productId].some(val => !val)) {
return next();
... ... @@ -75,7 +76,8 @@ const newDetail = {
skn,
brandId,
productId,
bundleType
bundleType,
gid
}).then(result => {
if (_.isEmpty(result)) {
return next();
... ...
... ... @@ -217,14 +217,14 @@ const tool = {
* @param skn
* @returns {{}}
*/
processBundle(bundleData, skn) {
processBundle(bundleData, skn, gid) {
// let discountPrice = (_.get(bundleData, 'bundleInfo.salesPrice', 0) -
// _.get(bundleData, 'bundleInfo.discountPrice', 0));
// let priceShow = _.split(discountPrice + '', '.')[0];
return {
title: '优惠套装',
href: helpers.urlFormat('/product/bundle/detail', {skn: skn}),
href: helpers.urlFormat('/product/bundle/detail', {skn: skn, gid: gid}),
description: '立省¥' + _.get(bundleData, 'bundleInfo.subPrice', 0),
productList: productProcess.processProductList(bundleData && bundleData.productList)
};
... ... @@ -292,6 +292,7 @@ const newDetail = {
let brandId = params.brandId;
let productId = params.productId;
let skn = params.skn;
let gid = params.gid;
let apiArray = [
this.queryShopsByBrandId(brandId), // 0 品牌信息
... ... @@ -329,7 +330,7 @@ const newDetail = {
/* 套装 */
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 1) {
finalResult.bundleData = tool.processBundle(bundleData, skn);
finalResult.bundleData = tool.processBundle(bundleData, skn, gid);
}
/* 量贩 */
... ...
... ... @@ -27,26 +27,31 @@ $(function() {
$selectBtn.on('touchend', function() {
var self = $(this);
$.post('/product/detail/info', {
id: self.data('id'),
productSkn: self.data('skn')
}, function(data) {
chosePanelRender(data);
chosePanel.init(self.data('skn'));
chosePanel.show();
});
});
$('.goods-img').on('touchend', function() {
var packGood = $(this).parent().find('.select-btn');
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_GDS_PACKAGE_GOODS_C',
param: JSON.stringify({
C_ID: window._ChannelVary[window.cookie('_Channel')],
PRD_ID: window.queryString.id,
PACKAGE_GOODS: self.data('id'),
PACKAGE_INDEX: self.data('index')
PRD_ID: window.queryString.gid,
PACKAGE_GOODS: packGood.data('id'),
PACKAGE_INDEX: packGood.data('index') + 1
})
}, true);
}
$.post('/product/detail/info', {
id: self.data('id'),
productSkn: self.data('skn')
}, function(data) {
chosePanelRender(data);
chosePanel.init(self.data('skn'));
chosePanel.show();
});
});
/**
... ... @@ -57,7 +62,7 @@ $buyNowBtn.on('click', function() {
bundleId = $('#activityId').val(),
gskn = $('span[id^="gskn"]'),
gsknSelected = false,
yasGid = '';
yasGid = [];
if (gskn.length < 1) {
tip.show('非法请求!');
... ... @@ -79,7 +84,7 @@ $buyNowBtn.on('click', function() {
buy_number: 1
});
yasGid += $(this).data('id') + ',';
yasGid.push($(this).data('id'));
});
if (window._yas && window._yas.sendCustomInfo) {
... ... @@ -88,7 +93,7 @@ $buyNowBtn.on('click', function() {
param: JSON.stringify({
C_ID: window._ChannelVary[window.cookie('_Channel')],
PRD_ID: window.queryString.id,
PACKAGE_GOODS: yasGid
PACKAGE_GOODS: yasGid.join(',')
})
}, true);
}
... ... @@ -99,7 +104,6 @@ $buyNowBtn.on('click', function() {
activity_id: bundleId
}), actCkOpthn);
window.location.href =
'/cart/index/orderEnsure?cartType=bundle&activityType=bundle';
// window.location.href = '/cart/index/orderEnsure?cartType=bundle&activityType=bundle';
}
});
... ...
... ... @@ -295,7 +295,8 @@ setTimeout(() => {
skn: skn,
productId: productId,
brandId: brandId,
bundleType: bundleType
bundleType: bundleType,
gid: goodsId
}).done(function(info) {
// step1: render dom
renderFeedbackStore(info, $feedbackStore);
... ...
... ... @@ -433,7 +433,7 @@ function search(opt) {
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_BRAND_GOODS_LIST_C',
op: 'YB_BRAND_GOODS_LIST_L',
param: JSON.stringify(yasparm)
}, true);
}
... ... @@ -463,7 +463,7 @@ function search(opt) {
setTimeout(function() {
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_BRAND_GOODS_LIST_C',
op: 'YB_BRAND_GOODS_LIST_L',
param: JSON.stringify(yasparm)
}, true);
}
... ... @@ -503,7 +503,7 @@ function search(opt) {
setTimeout(function() {
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_BRAND_GOODS_LIST_C',
op: 'YB_BRAND_GOODS_LIST_L',
param: JSON.stringify(yasparm)
}, true);
}
... ...