Authored by 刘传洋

m

... ... @@ -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 = {
}
};
... ...
... ... @@ -37,8 +37,8 @@ const getClientData = (type, encryptedUid) => {
let records = [];
let hasHistory = false;
if(res[0] && res[0].code === 200) {
if(res[0].data.config) {
if (res[0] && res[0].code === 200) {
if (res[0].data.config) {
csSetting = res[0].data.config;
csSetting.qrCode = csSetting.qrCode.replace(regExp, qcSize);
csSetting.pcAdImg = csSetting.pcAdImg.replace(regExp, advSize);
... ... @@ -46,16 +46,16 @@ const getClientData = (type, encryptedUid) => {
}
}
if(res[1] && res[1].code === 200) {
if (res[1] && res[1].code === 200) {
records = res[1].data.records;
hasHistory = records.length > 0;
}
if(res[2] && res[2].code === 200) {
if (res[2] && res[2].code === 200) {
orderList = res[2].data;
}
if(res[3] && res[3].code === 200) {
if (res[3] && res[3].code === 200) {
qasList = res[3].data;
}
... ...
... ... @@ -13,7 +13,7 @@ function cdnReplace(cdn, imgUrl) {
return imgUrl;
}
module.exports = function (imageUrl, opts) {
module.exports = function(imageUrl, opts) {
var cdn = window.cdn;
if (imageUrl) {
... ... @@ -34,19 +34,19 @@ module.exports = function (imageUrl, opts) {
if (query.indexOf('imageView2') === 0) {
if (params.q && query.indexOf('/q/') > 0) {
query = query.replace(/\/q\/\d+/g, '/q/' + params.q);
} else if(params.q) {
} else if (params.q) {
query += '/q/' + params.q;
}
} else if (query.indexOf('imageMogr2') === 0) {
if (params.q && query.indexOf('/quality/') > 0) {
query = query.replace(/\/quality\/\d+/g, '/quality/' + params.q);
} else if(params.q) {
} else if (params.q) {
query += '/quality/' + params.q;
}
} else if (query.indexOf('imageView/') === 0) {
if (params.q && query.indexOf('/q/') > 0) {
query = query.replace(/\/q\/\d+/g, '/q/' + params.q);
} else if(params.q) {
} else if (params.q) {
query += '/q/' + params.q;
}
... ...
... ... @@ -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);
... ...
... ... @@ -71,7 +71,7 @@
/* 点击商品详情页尺寸时埋点*/
$('#sizes .size').on('click', 'li', function() {
var $this = $(this);
yas.givePoint('YB_GDS_SIZE_C', {PRD_ID: getPrdId(), SIZE: $this.data('name')});
});
... ...
... ... @@ -19,7 +19,7 @@ function cdnReplace(cdn, imgUrl) {
}
module.exports = {
image2: function (imageUrl, opts) {
image2: function(imageUrl, opts) {
let cdn = _.get(opts, 'data.root.cdn');
if (imageUrl && _.isString(imageUrl)) {
... ... @@ -40,7 +40,7 @@ module.exports = {
if (query.indexOf('imageView2') === 0) {
if (params.q && query.indexOf('/q/') > 0) {
query = query.replace(/\/q\/\d+/g, '/q/' + params.q);
} else if (params.q){
} else if (params.q) {
query += '/q/' + params.q;
}
} else if (query.indexOf('imageMogr2') === 0) {
... ...