Authored by zhangxiaoru

recommend-for-you

... ... @@ -2,7 +2,7 @@
var api = global.yoho.API;
const camelCase = global.yoho.camelCase;
//const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
const _ = require('lodash');
... ... @@ -16,7 +16,7 @@ const getPreferenceData = (data) => {
let list = data.data || {};
list = camelCase(list);
//list = camelCase(list);
let distGoods = [];
... ... @@ -27,20 +27,33 @@ const getPreferenceData = (data) => {
}
value.goodsId = value.goodsList[0].goodsId;
let goods = value;
//let goods = value;
let goods = [];
goods.push({
productSkn: value.product_skn,
productName: value.product_name,
defaultImages: value.default_images,
isSoonSoldOut: value.is_soon_sold_out,
url: helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`),
marketPrice: value.market_price,
salesPrice: value.sales_price
})
//goods.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`);
goods.url = helpers.urlFormat(`/product/pro_${value.productId}_${value.goodsId}/${value.cnAlphabet}.html`);
if (_.get(goods, 'tags[0]', null)) {
goods.tags = [];
if (goods.isNew === 'Y') {
goods.tags.push({isNew: true});
} else if (goods.isAdvance === 'Y') {
goods.tags.push({is_new: true});
} else if (goods.is_advance === 'Y') {
goods.tags.push({isAdvance: true});
} else if (goods.isDiscount === 'Y') {
} else if (goods.is_discount === 'Y') {
goods.tags.push({isDiscount: true});
} else if (goods.isYohoood === 'Y') {
} else if (goods.is_yohoood === 'Y') {
goods.tags.push({isYohoood: true});
} else if (goods.isLimited === 'Y') {
} else if (goods.is_limited === 'Y') {
goods.tags.push({isLimited: true});
}
}
... ...
... ... @@ -44,7 +44,7 @@
line-height: 1;
.sale-price {
display: block;
/*display: block;*/
margin-right: 8px;
color: #d9134f;
}
... ...