|
|
const api = global.yoho.API;
|
|
|
|
|
|
module.exports = {
|
|
|
productLst: function(params) {
|
|
|
return api.get('', Object.assign({
|
|
|
method: 'web.search.newPromotion'
|
|
|
}, params)).then(res => {
|
|
|
var data = [],
|
|
|
lst = (res.data && res.data.product_list) || [];
|
|
|
|
|
|
lst.forEach(function(o) {
|
|
|
data.push({
|
|
|
brand_domain: o.brand_domain,
|
|
|
brand_name: o.brand_name,
|
|
|
product_id: o.product_id,
|
|
|
product_name: o.product_name,
|
|
|
product_skn: o.product_skn,
|
|
|
market_price: o.market_price,
|
|
|
sales_price: o.sales_price,
|
|
|
cn_alphabet: o.cn_alphabet,
|
|
|
default_images: o.default_images,
|
|
|
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : ''
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return data;
|
|
|
});
|
|
|
}
|
|
|
}; |
|
|
\ No newline at end of file |
...
|
...
|
|