Authored by 周少峰

Merge branch 'feature/help' of git.yoho.cn:fe/yohobuy-node into feature/help

... ... @@ -52,13 +52,13 @@ exports.escapeType = (value) => {
};
exports.escapeLength = (value) => {
let strs = value.split('');
let strs = value.split('');
if (strs.length === 2) {
strs[2] = strs[1];
strs[1] = ' ';
return strs.join('');
}
if (strs.length === 2) {
strs[2] = strs[1];
strs[1] = ' ';
return strs.join('');
}
return strs.join('');
}
return strs.join('');
};
... ...
... ... @@ -22,4 +22,4 @@ const getPackage = (data) => {
module.exports = {
}
};
... ...
... ... @@ -21,7 +21,7 @@ module.exports = {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
//singleApi: 'http://single.gray.yohops.com/',
// singleApi: 'http://single.gray.yohops.com/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
... ... @@ -34,7 +34,7 @@ module.exports = {
imSocket: 'wss://imsocket.yohobuy.com:443',
imCs: 'https://imhttp.yohobuy.com/api',
imServer: 'https://imhttp.yohobuy.com/server',
imServer: 'https://imhttp.yohobuy.com/server'
},
subDomains: {
host: '.yohobuy.com',
... ...
... ... @@ -1599,41 +1599,41 @@ $('.package-box').on('click', '#buy-detail', function() {
var pkgDialog = new Dialog(opt); // eslint-disable-line
pkgDialog.show();
pkgDialog.$el.on('click', '#pay-pkg', function(){
pkgDialog.$el.on('click', '#pay-pkg', function() {
var product = pkgDialog.$el.find('.pkgDg-prodetal .pkg-product');
var idArr = [];
product.each(function(){
product.each(function() {
var $this = $(this);
var id = $this.find('.pkg-proImg').attr('href').split('_')[1];
idArr.push(id);
});
var option = {
PRD_ID : +$('.main').data('id'),
PACKAGE_GOODS : idArr.join(',')
};
var option = {
PRD_ID: +$('.main').data('id'),
PACKAGE_GOODS: idArr.join(',')
};
yas.givePoint('YB_GDS_NUMBER_C', option);
yas.givePoint('YB_GDS_NUMBER_C', option);
});
pkgDialog.$el.on('click', '.pkg-product .pkg-proImg', function(){
pkgDialog.$el.on('click', '.pkg-product .pkg-proImg', function() {
var $this = $(this);
var $index = $this.parent('.pkg-product').index() + 1;
var product = pkgDialog.$el.find('.pkgDg-prodetal .pkg-product');
var idArr = [];
product.each(function(){
product.each(function() {
var $this = $(this);
var id = $this.find('.pkg-proImg').attr('href').split('_')[1];
idArr.push(id);
});
var option = {
PRD_ID : +$('.main').data('id'),
PACKAGE_INDEX : $index,
PACKAGE_GOODS : idArr.join(',')
PRD_ID: +$('.main').data('id'),
PACKAGE_INDEX: $index,
PACKAGE_GOODS: idArr.join(',')
};
yas.givePoint('YB_GDS_PACKAGE_DT_GOODS_C', option);
... ...
... ... @@ -89,7 +89,7 @@ exports.yasBottom = function() {
yas.givePoint('YB_GDS_PACKAGE_GOODS_C', option);
});
$('.pkgDg-prodetal .pkg-product .type-chose .chose-color').click(function(){
$('.pkgDg-prodetal .pkg-product .type-chose .chose-color').click(function() {
alert('s');
});
... ... @@ -109,5 +109,5 @@ exports.yasBottom = function() {
PACKAGE_GOODS: arr.join(';')
});
});
};
};
... ...
var $ = require('yoho-jquery');
var yas = require('../common/data-yas');
exports.yasHead = function(){
/* 获取商品编码*/
function getPrdId() {
return +$('.main').data('id');
}
/* 点击商品详情页【立即购买】按钮时埋点*/
$('#buy-now').click(function() {
var num = +$('#num').text();
var color = $('.chose-color .colors .focus').find('color-name').text();
var size = $('#sizes .size .focus').data('name');
var option = {
PRD_ID: getPrdId(),
PRD_NUM: num,
COLOR: color,
SIZE: size
};
yas.givePoint('YB_GDS_BUY_NOW_C', option);
});
/* 点击商品详情页商品角度图时埋点*/
$('#thumbs > .thumb-wrap').on('click', '.thumb', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_PICTURE_C', {PRD_ID: getPrdId(), PIC_INDEX: $index});
});
/* 点击商品分享渠道时埋点*/
$('.share-row .share-to i').on('click', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_SHARE_TYPE_C', {PRD_ID: getPrdId(), TYPE_ID: $index});
});
/* 查看VIP价格后的【立即登录】按钮点击埋点*/
$('.market-price .vip-price a').click(function() {
yas.givePoint('YB_GDS_VIP_PRICE_SIGN_C', {PRD_ID: getPrdId()});
});
/* 点击【展开全部促销】按钮时*/
$('.activity-wrapper .activity-title').click(function() {
yas.givePoint('YB_GDS_ALL_PROMOTION_C', { PRD_ID: getPrdId() });
});
/* 点击优惠券领取模块埋点*/
$('.small-coupon-list li .coupon-item .small-desc').click(function() {
var $this = $(this);
var coupon = $this.parent('.coupon-item').data('id');
yas.givePoint('YB_GDS_COUPON_C', {PRD_ID: getPrdId(), COUPON: coupon});
});
/* 点击商品详情页颜色时*/
$('.chose-color .colors').on('click', 'li', function() {
var $this = $(this);
var color = $this.find('color-name').text();
yas.givePoint('YB_GDS_COLOR_C', {PRD_ID: getPrdId(), COLOR: color});
});
/* 点击商品详情页尺寸时埋点*/
$('#sizes .size').on('click', 'li', function() {
var $this = $(this);
yas.givePoint('YB_GDS_SIZE_C', {PRD_ID: getPrdId(), SIZE: $this.data('name')});
});
/*点击到货通知按钮时*/
$('.trade-content .type-chose').on('click', '#enable-notify', function() {
yas.givePoint('YB_GDS_ARRIVAL_NOTICE_C', {PRD_ID: getPrdId()});
});
//点击数量加减号埋点
$('#plus-num').click(function(){
yas.givePoint('YB_GDS_NUMBER_C', {PRD_ID: getPrdId(), TYPE : 1});
});
$('#minus-num').click(function(){
yas.givePoint('YB_GDS_NUMBER_C', {PRD_ID: getPrdId(), TYPE : 2});
});
}
var $ = require('yoho-jquery');
var yas = require('../common/data-yas');
exports.yasHead = function() {
/* 获取商品编码*/
function getPrdId() {
return +$('.main').data('id');
}
/* 点击商品详情页【立即购买】按钮时埋点*/
$('#buy-now').click(function() {
var num = +$('#num').text();
var color = $('.chose-color .colors .focus').find('color-name').text();
var size = $('#sizes .size .focus').data('name');
var option = {
PRD_ID: getPrdId(),
PRD_NUM: num,
COLOR: color,
SIZE: size
};
yas.givePoint('YB_GDS_BUY_NOW_C', option);
});
/* 点击商品详情页商品角度图时埋点*/
$('#thumbs > .thumb-wrap').on('click', '.thumb', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_PICTURE_C', {PRD_ID: getPrdId(), PIC_INDEX: $index});
});
/* 点击商品分享渠道时埋点*/
$('.share-row .share-to i').on('click', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_SHARE_TYPE_C', {PRD_ID: getPrdId(), TYPE_ID: $index});
});
/* 查看VIP价格后的【立即登录】按钮点击埋点*/
$('.market-price .vip-price a').click(function() {
yas.givePoint('YB_GDS_VIP_PRICE_SIGN_C', {PRD_ID: getPrdId()});
});
/* 点击【展开全部促销】按钮时*/
$('.activity-wrapper .activity-title').click(function() {
yas.givePoint('YB_GDS_ALL_PROMOTION_C', { PRD_ID: getPrdId() });
});
/* 点击优惠券领取模块埋点*/
$('.small-coupon-list li .coupon-item .small-desc').click(function() {
var $this = $(this);
var coupon = $this.parent('.coupon-item').data('id');
yas.givePoint('YB_GDS_COUPON_C', {PRD_ID: getPrdId(), COUPON: coupon});
});
/* 点击商品详情页颜色时*/
$('.chose-color .colors').on('click', 'li', function() {
var $this = $(this);
var color = $this.find('color-name').text();
yas.givePoint('YB_GDS_COLOR_C', {PRD_ID: getPrdId(), COLOR: color});
});
/* 点击商品详情页尺寸时埋点*/
$('#sizes .size').on('click', 'li', function() {
var $this = $(this);
yas.givePoint('YB_GDS_SIZE_C', {PRD_ID: getPrdId(), SIZE: $this.data('name')});
});
/* 点击到货通知按钮时*/
$('.trade-content .type-chose').on('click', '#enable-notify', function() {
yas.givePoint('YB_GDS_ARRIVAL_NOTICE_C', {PRD_ID: getPrdId()});
});
// 点击数量加减号埋点
$('#plus-num').click(function() {
yas.givePoint('YB_GDS_NUMBER_C', {PRD_ID: getPrdId(), TYPE: 1});
});
$('#minus-num').click(function() {
yas.givePoint('YB_GDS_NUMBER_C', {PRD_ID: getPrdId(), TYPE: 2});
});
};
... ...