...
|
...
|
@@ -241,21 +241,37 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
|
// 一张图片
|
|
|
if (_.get(value, 'singleImage.data.length', false)) {
|
|
|
let tagList = _.get(value, 'singleImage.data[0].tagList', []);
|
|
|
let tagListGlobal = _.get(value, 'singleImage.data[0].tagListGlobal', []);
|
|
|
let tagListLimit = _.get(value, 'singleImage.data[0].tagListLimit', []);
|
|
|
|
|
|
|
|
|
// 普通商品
|
|
|
if (tagList.length > 0) {
|
|
|
_.forEach(tagList, (tag, tagIndex) => {
|
|
|
|
|
|
// 链接
|
|
|
if (tag.is_global === 'Y') {
|
|
|
tagList[tagIndex].href = '//m.yohobuy.com/product/global/' + tag.product_skn + '.html';
|
|
|
} else {
|
|
|
tagList[tagIndex].href = '//m.yohobuy.com/product/' + tag.product_skn + '.html';
|
|
|
}
|
|
|
tagList[tagIndex].href = '//m.yohobuy.com/product/' + tag.product_skn + '.html';
|
|
|
tagList[tagIndex].isApp = isApp;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 全球购商品
|
|
|
if (tagListGlobal.length > 0) {
|
|
|
_.forEach(tagListGlobal, tagGlobal => {
|
|
|
tagList.push(Object.assign(tagGlobal, {
|
|
|
href: '//m.yohobuy.com/product/global/' + tagGlobal.product_skn + '.html',
|
|
|
isApp: isApp
|
|
|
}));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 限定商品
|
|
|
if (tagListLimit.length > 0) {
|
|
|
_.forEach(tagListLimit, tagLimit => {
|
|
|
tagList.push(Object.assign(tagLimit, {
|
|
|
href: '//m.yohobuy.com/product/' + tagLimit.product_skn + '.html',
|
|
|
isApp: isApp
|
|
|
}));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
finalDetail.push({
|
|
|
bigImage: helpers.image(_.get(value, 'singleImage.data[0].src', ''), 640, 640),
|
|
|
noLazy: index <= 3,
|
...
|
...
|
@@ -378,15 +394,34 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 170505 新添加推荐商品
|
|
|
// 推荐商品
|
|
|
if (_.get(value, 'recommend_products', false)) {
|
|
|
let recommendProducts = _.get(value, 'recommend_products.data', []);
|
|
|
let recommendProductsGlobal = _.get(value, 'recommend_products.dataGlobal', []);
|
|
|
let recommendProductsLimit = _.get(value, 'recommend_products.dataLimit', []);
|
|
|
|
|
|
// 普通商品
|
|
|
_.forEach(recommendProducts, (goods, goodsKey) => {
|
|
|
recommendProducts[goodsKey].price = parseFloat(goods.sales_price).toFixed(2);
|
|
|
recommendProducts[goodsKey].href = isApp ? `http://m.yohobuy.com/product/${goods.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${goods.product_skn}"}}` : `//m.yohobuy.com/product/${goods.product_skn}.html`;
|
|
|
});
|
|
|
|
|
|
// 全球购商品
|
|
|
_.forEach(recommendProductsGlobal, goodsGlobal => {
|
|
|
recommendProducts.push(Object.assign(goodsGlobal, {
|
|
|
price: parseFloat(goodsGlobal.sales_price).toFixed(2),
|
|
|
href: isApp ? `http://m.yohobuy.com/product/${goodsGlobal.product_skn}.html?openby:yohobuy={"action":"go.globalpurchase","params":{"skn":"${goodsGlobal.product_skn}"}}` : `//m.yohobuy.com/product/global/${goodsGlobal.product_skn}.html`
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
// 限定商品
|
|
|
_.forEach(recommendProductsLimit, goodsLimit => {
|
|
|
recommendProducts.push(Object.assign(goodsLimit, {
|
|
|
price: parseFloat(goodsLimit.sales_price).toFixed(2),
|
|
|
href: isApp ? `http://m.yohobuy.com/product/${goodsLimit.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${goodsLimit.product_skn}"}}` : `//m.yohobuy.com/product/${goodsLimit.product_skn}.html`
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
finalDetail.push({
|
|
|
recommendProducts: _.get(value, 'recommend_products.data', [])
|
|
|
});
|
...
|
...
|
|