Authored by OF1706

m

... ... @@ -39,7 +39,7 @@ const helpers = global.yoho.helpers;
helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
// NOTE:这里修改了参数的个数
helpers.getUrlBySkc = pid => `//item.yohobuy.com/${pid}.html`;
helpers.getUrlBySkc = skn => `//item.yohobuy.com/${skn}.html`;
global.middleware = path.resolve('./doraemon/middleware');
global.utils = path.resolve('./utils');
... ...
... ... @@ -322,7 +322,6 @@ const formatPriceGiftOne = (it) => {
// 商品链接
if (g.goods_id) {
// let cnAlphaBet = g.cn_alphabet ? g.cn_alphabet : md5(g.product_name);
goods.subjoinLink = helpers.getUrlBySkc(g.product_skn);
} else {
let uri = `/product/show_${g.product_id}_${g.product_skn}/${makeToken(g.product_skn)}.html`;
... ...
... ... @@ -784,11 +784,6 @@ const getRecommendProduct = (channelNum, uid, udid, page) => {
'¥' + chelper.transPrice(it.market_price) : ''
};
// 商品链接
// let cnAlphaBet = it.cn_alphabet ? it.cn_alphabet : md5(it.product_name);
// let firstGoods = it.goods_list && it.goods_list[0];
// let productSkc = firstGoods && firstGoods.product_skc;
item.href = helpers.getUrlBySkc(it.product_skn);
if (it.sales_price !== it.market_price) {
... ...
... ... @@ -79,7 +79,6 @@ exports.getCommentList = (uid, isComment, page, limit) => {
};
_.forEach(value.orderGoods, (v) => {
// let cnAlphabet = v.cnAlphabet || '';
let hasComments = false;
let good = {
href: helpers.getUrlBySkc(v.productSkn),
... ...
... ... @@ -82,12 +82,8 @@ const currencyList = (uid, condition)=>{
if (_.get(product, 'code') === 200 &&
!_.isEmpty(product.data.product_list) &&
!_.isEmpty(product.data.product_list[0].goods_list)) {
// let productId = _.get(product, 'data.product_list[0].product_id');
let productSkn = _.get(product, 'data.product_list[0].product_skn');
// let goodsId = _.get(product, 'data.product_list[0].goods_list[0].goods_id');
// let alphabet = _.get(product, 'data.product_list[0].cn_alphabet');
result.list[key].detailUrl = helpers.getUrlBySkc(productSkn);
}
}
... ...
... ... @@ -73,8 +73,7 @@ const _handleProduct = (products) => {
thumb: img,
name: product.product_name,
price: product.sales_price,
productId: product.product_id,
productSkn: product.product_skn
productId: product.product_id
};
});
};
... ...
... ... @@ -57,10 +57,9 @@ function getGoodsData(goods) {
let arr = [];
goods.forEach(good => {
let cnAlphabet = good.cn_alphabet || '';
arr.push({
href: getProductUrlBySkc(good.product_skn, good.goods_id, cnAlphabet),
href: getProductUrlBySkc(good.product_skn),
thumb: helpers.image(good.goods_image, 60, 60),
name: good.product_name,
color: good.color_name,
... ... @@ -180,9 +179,8 @@ const getOrderRefund = (orderCode, uid) => {
_.forEach(_.get(result, 'data.goods_list', []), value => {
let cnAlphabet = value.cn_alphabet || 'cnalphabet';
let item = {
href: getProductUrlBySkc(value.product_skn, value.goods_id, cnAlphabet),
href: getProductUrlBySkc(value.product_skn),
thumb: helpers.image(value.goods_image, 60, 60),
name: value.product_name,
color: value.factory_color_name,
... ...
... ... @@ -83,6 +83,8 @@ const detailHeader = (req, res, next) => {
.then((result) => {
if (result.code === 200) {
return res.render('product/detail-header', Object.assign({layout: false}, result.data));
}else{
res.status(204).end();
}
}).catch(next);
};
... ...
... ... @@ -299,9 +299,6 @@ exports.getSearchLessProduct = (channelNum, uid, udid, page) => {
false : ('¥' + transPrice(it.market_price))
};
// let firstGoods = it.goods_list && it.goods_list[0];
// let productSkc = firstGoods && firstGoods.product_skc;
item.href = helpers.getUrlBySkc(it.product_skn);
return item;
... ...