...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2017-03-23 11:02:31
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2017-05-02 11:09:37
|
|
|
* @Last Modified time: 2017-05-26 16:42:29
|
|
|
*/
|
|
|
/* 红人店铺数据处理 */
|
|
|
|
...
|
...
|
@@ -34,7 +34,8 @@ const _linkhandle = (linkParent) => { |
|
|
switch (parseInt(linkParent.linkType, 10)) {
|
|
|
case 0:
|
|
|
return helpers.urlFormat('', {
|
|
|
filter_poolId: linkParent.resource
|
|
|
filter_poolId: linkParent.resource,
|
|
|
title: linkParent.text
|
|
|
}, 'list');
|
|
|
case 1:
|
|
|
return helpers.urlFormat('/product/' + linkParent.resource + '.html');
|
...
|
...
|
@@ -56,7 +57,7 @@ const _picsHandle = (moduleData) => { |
|
|
let pics = [];
|
|
|
|
|
|
_.forEach(_.get(moduleData, 'data', []), value => {
|
|
|
let showProductInfo = false;
|
|
|
let showProductInfo = true;
|
|
|
|
|
|
if (_.has(value, 'showProductInfo')) {
|
|
|
showProductInfo = value.showProductInfo;
|
...
|
...
|
@@ -325,12 +326,18 @@ const pushGoodsInfo = (decorators, goodsList) => { |
|
|
_.forEach(_.get(value, 'pics', []), (subValue, subKey) => {
|
|
|
let hasGoods = _.get(goodsObj, `${subValue.skn}.default_images`, false);
|
|
|
|
|
|
if (!hasGoods) {
|
|
|
decorators[key].noShowProductInfo = true;
|
|
|
}
|
|
|
|
|
|
if (subValue.skn && hasGoods) {
|
|
|
let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, '');
|
|
|
let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, '');
|
|
|
let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, '');
|
|
|
|
|
|
decorators[key].pics[subKey].showProductInfo = salesPrice !== 0;
|
|
|
if (salesPrice === 0) {
|
|
|
decorators[key].noShowProductInfo = true;
|
|
|
}
|
|
|
decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, '');
|
|
|
decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : '';
|
|
|
decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : '';
|
...
|
...
|
|