Merge branch 'feature/guang2' into release/5.8
Showing
1 changed file
with
44 additions
and
9 deletions
@@ -241,21 +241,37 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW | @@ -241,21 +241,37 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW | ||
241 | // 一张图片 | 241 | // 一张图片 |
242 | if (_.get(value, 'singleImage.data.length', false)) { | 242 | if (_.get(value, 'singleImage.data.length', false)) { |
243 | let tagList = _.get(value, 'singleImage.data[0].tagList', []); | 243 | let tagList = _.get(value, 'singleImage.data[0].tagList', []); |
244 | + let tagListGlobal = _.get(value, 'singleImage.data[0].tagListGlobal', []); | ||
245 | + let tagListLimit = _.get(value, 'singleImage.data[0].tagListLimit', []); | ||
244 | 246 | ||
245 | - | 247 | + // 普通商品 |
246 | if (tagList.length > 0) { | 248 | if (tagList.length > 0) { |
247 | _.forEach(tagList, (tag, tagIndex) => { | 249 | _.forEach(tagList, (tag, tagIndex) => { |
248 | - | ||
249 | - // 链接 | ||
250 | - if (tag.is_global === 'Y') { | ||
251 | - tagList[tagIndex].href = '//m.yohobuy.com/product/global/' + tag.product_skn + '.html'; | ||
252 | - } else { | ||
253 | - tagList[tagIndex].href = '//m.yohobuy.com/product/' + tag.product_skn + '.html'; | ||
254 | - } | 250 | + tagList[tagIndex].href = '//m.yohobuy.com/product/' + tag.product_skn + '.html'; |
255 | tagList[tagIndex].isApp = isApp; | 251 | tagList[tagIndex].isApp = isApp; |
256 | }); | 252 | }); |
257 | } | 253 | } |
258 | 254 | ||
255 | + // 全球购商品 | ||
256 | + if (tagListGlobal.length > 0) { | ||
257 | + _.forEach(tagListGlobal, tagGlobal => { | ||
258 | + tagList.push(Object.assign(tagGlobal, { | ||
259 | + href: '//m.yohobuy.com/product/global/' + tagGlobal.product_skn + '.html', | ||
260 | + isApp: isApp | ||
261 | + })); | ||
262 | + }); | ||
263 | + } | ||
264 | + | ||
265 | + // 限定商品 | ||
266 | + if (tagListLimit.length > 0) { | ||
267 | + _.forEach(tagListLimit, tagLimit => { | ||
268 | + tagList.push(Object.assign(tagLimit, { | ||
269 | + href: '//m.yohobuy.com/product/' + tagLimit.product_skn + '.html', | ||
270 | + isApp: isApp | ||
271 | + })); | ||
272 | + }); | ||
273 | + } | ||
274 | + | ||
259 | finalDetail.push({ | 275 | finalDetail.push({ |
260 | bigImage: helpers.image(_.get(value, 'singleImage.data[0].src', ''), 640, 640), | 276 | bigImage: helpers.image(_.get(value, 'singleImage.data[0].src', ''), 640, 640), |
261 | noLazy: index <= 3, | 277 | noLazy: index <= 3, |
@@ -378,15 +394,34 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW | @@ -378,15 +394,34 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW | ||
378 | }); | 394 | }); |
379 | } | 395 | } |
380 | 396 | ||
381 | - // 170505 新添加推荐商品 | 397 | + // 推荐商品 |
382 | if (_.get(value, 'recommend_products', false)) { | 398 | if (_.get(value, 'recommend_products', false)) { |
383 | let recommendProducts = _.get(value, 'recommend_products.data', []); | 399 | let recommendProducts = _.get(value, 'recommend_products.data', []); |
400 | + let recommendProductsGlobal = _.get(value, 'recommend_products.dataGlobal', []); | ||
401 | + let recommendProductsLimit = _.get(value, 'recommend_products.dataLimit', []); | ||
384 | 402 | ||
403 | + // 普通商品 | ||
385 | _.forEach(recommendProducts, (goods, goodsKey) => { | 404 | _.forEach(recommendProducts, (goods, goodsKey) => { |
386 | recommendProducts[goodsKey].price = parseFloat(goods.sales_price).toFixed(2); | 405 | recommendProducts[goodsKey].price = parseFloat(goods.sales_price).toFixed(2); |
387 | 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`; | 406 | 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`; |
388 | }); | 407 | }); |
389 | 408 | ||
409 | + // 全球购商品 | ||
410 | + _.forEach(recommendProductsGlobal, goodsGlobal => { | ||
411 | + recommendProducts.push(Object.assign(goodsGlobal, { | ||
412 | + price: parseFloat(goodsGlobal.sales_price).toFixed(2), | ||
413 | + 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` | ||
414 | + })); | ||
415 | + }); | ||
416 | + | ||
417 | + // 限定商品 | ||
418 | + _.forEach(recommendProductsLimit, goodsLimit => { | ||
419 | + recommendProducts.push(Object.assign(goodsLimit, { | ||
420 | + price: parseFloat(goodsLimit.sales_price).toFixed(2), | ||
421 | + 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` | ||
422 | + })); | ||
423 | + }); | ||
424 | + | ||
390 | finalDetail.push({ | 425 | finalDetail.push({ |
391 | recommendProducts: _.get(value, 'recommend_products.data', []) | 426 | recommendProducts: _.get(value, 'recommend_products.data', []) |
392 | }); | 427 | }); |
-
Please register or login to post a comment