Authored by zhangxiaoru

merge

'use strict';
const productNameProcess = require(`${utils}/product-name-process`);
const serviceApi = global.yoho.ServiceAPI;
const api = global.yoho.API;
const helpers = global.yoho.helpers;
... ... @@ -224,6 +226,11 @@ exports.index = (req, res, next) => {
datas[1].data = datas[1].data || {};
datas[1].data.product_list = (datas[1].data.product_list || []).map(function(value) {
value.goodsId = value.goods_list[0].goods_id;
if (value.cn_alphabet) {
value.cn_alphabet = productNameProcess(value.cn_alphabet);
}
value.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`;
return value;
});
... ... @@ -368,6 +375,11 @@ exports.verifystudent = (req, res, next) => {
datas[1].data.product_list = (datas[1].data.product_list || []).map(function(value) {
value.goodsId = value.goods_list[0].goods_id;
value.product_id = value.product_id;
if (value.cn_alphabet) {
value.cn_alphabet = productNameProcess(value.cn_alphabet);
}
value.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`;
return value;
});
... ...
'use strict';
const productNameProcess = require(`${utils}/product-name-process`);
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const _ = require('lodash');
... ... @@ -179,6 +181,10 @@ const getNewProduct = (brandId, gender, url, isApp) => {
newArrival.moreUrl = url;
if (list.cn_alphabet) {
list.cn_alphabet = productNameProcess(list.cn_alphabet);
}
let productUrl = '//m.yohobuy.com/product/pro_' + list.product_id + '_' +
list.goods_list[0].goods_id + '/' + list.cn_alphabet + '.html';
... ...
'use strict';
const productNameProcess = require(`${utils}/product-name-process`);
const api = global.yoho.API;
const _ = require('lodash');
const serviceAPI = global.yoho.ServiceAPI;
... ... @@ -97,6 +98,10 @@ const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => {
return false;
}
if (data.cn_alphabet) {
data.cn_alphabet = productNameProcess(data.cn_alphabet);
}
one = _.assign(one, {
url: '/product/pro_' + data.product_id + '_' + data.goods_list[0].goods_id +
'/' + data.cn_alphabet + '.html',
... ...
... ... @@ -7,6 +7,7 @@
'use strict';
const _ = require('lodash');
const productNameProcess = require(`${utils}/product-name-process`);
const api = global.yoho.API;
const helpers = global.yoho.helpers;
... ... @@ -27,6 +28,10 @@ const _formatProduct = (data) => {
}
value.goodsId = value.goods_list[0].goods_id;
if (value.cn_alphabet) {
value.cn_alphabet = productNameProcess(value.cn_alphabet);
}
let goods = {
salePrice: value.sales_price ? value.sales_price : '',
price: value.market_price ? value.market_price : '',
... ...
'use strict';
const productNameProcess = require(`${utils}/product-name-process`);
var api = global.yoho.API;
const helpers = global.yoho.helpers;
const _ = require('lodash');
... ... @@ -23,6 +24,10 @@ const getPreferenceData = (data) => {
}
value.goodsId = value.goods_list && value.goods_list[0] && value.goods_list[0].goods_id;
if (value.cn_alphabet) {
value.cn_alphabet = productNameProcess(value.cn_alphabet);
}
let goods = {
product_skn: value.product_skn,
product_name: value.product_name,
... ...
... ... @@ -42,7 +42,7 @@
"passport-weixin": "^0.1.0",
"request-promise": "^3.0.0",
"serve-favicon": "^2.3.2",
"uuid": "^3.0.1",
"uuid": "^2.0.3",
"yoho-node-lib": "0.2.2",
"yoho-zookeeper": "^1.0.4"
},
... ...
... ... @@ -4,6 +4,7 @@
'use strict';
const helpers = global.yoho.helpers;
const productNameProcess = require('./product-name-process');
/**
* [将首字符为//的url转换为http://]
... ... @@ -275,6 +276,11 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height,
// TODO student price
result.studentPrice = parseInt(productData.sales_price * 100 * 0.9) / 100;
result.is_soon_sold_out = (productData.is_soon_sold_out === 'Y');
if (productData.cn_alphabet) {
productData.cn_alphabet = productNameProcess(productData.cn_alphabet);
}
let url = encodeURI(helpers.urlFormat(`/product/pro_${productData.product_id}_${productData.goods_list[0].goods_id}/${productData.cn_alphabet}.html`));
result.url = url.replace('http://', '//');
... ...