...
|
...
|
@@ -260,12 +260,15 @@ const _processHeadData = (list) => { |
|
|
};
|
|
|
|
|
|
|
|
|
// 推荐商品
|
|
|
const _getRelatedData = (sknList) => {
|
|
|
// console.log(id);
|
|
|
/**
|
|
|
* 推荐商品
|
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getRelatedData = () => {
|
|
|
// console.log(idList);
|
|
|
return api.get('', {
|
|
|
// query: '51152761,51178582,51146105,51149561,51149414,51082157,51079256,',
|
|
|
qurey: sknList,
|
|
|
qurey: '51162882',
|
|
|
method: 'app.search.li'
|
|
|
}).then((result) => {
|
|
|
let productList = [];
|
...
|
...
|
@@ -273,15 +276,16 @@ const _getRelatedData = (sknList) => { |
|
|
if (result && result.code === 200) {
|
|
|
|
|
|
_.forEach(result.data.product_list, function(data) {
|
|
|
productList.push({
|
|
|
name: data.product_name,
|
|
|
price: data.sales_price,
|
|
|
id: data.product_id,
|
|
|
cnAlphabet: data.cn_alphabet
|
|
|
});
|
|
|
console.log(data.product_name)
|
|
|
// productList.push({
|
|
|
// name: data.product_name,
|
|
|
// price: data.sales_price,
|
|
|
// id: data.product_id,
|
|
|
// cnAlphabet: data.cn_alphabet
|
|
|
// });
|
|
|
});
|
|
|
|
|
|
// console.log(productList)
|
|
|
console.log(productList)
|
|
|
return productList;
|
|
|
} else {
|
|
|
logger.error('推荐商品 cood 不是 200');
|
...
|
...
|
@@ -320,7 +324,7 @@ const _processContentData = (list) => { |
|
|
|
|
|
contentData.contents = list;
|
|
|
|
|
|
// let idList = '';
|
|
|
let idList = '';
|
|
|
let sknList = '';
|
|
|
let formatData = [];
|
|
|
|
...
|
...
|
@@ -330,11 +334,12 @@ const _processContentData = (list) => { |
|
|
|
|
|
_.forEach(value.goods.data, function(data) {
|
|
|
|
|
|
// idList += data.id + ',';
|
|
|
idList += data.id + ',';
|
|
|
// idList = '51152761';
|
|
|
formatData.push(data);
|
|
|
});
|
|
|
}
|
|
|
//console.log(idList)
|
|
|
|
|
|
if (value.goodsGroup) {
|
|
|
|
...
|
...
|
@@ -349,8 +354,10 @@ const _processContentData = (list) => { |
|
|
// });
|
|
|
}
|
|
|
});
|
|
|
// console.log(idList)
|
|
|
|
|
|
_getRelatedData(sknList).then((result) => {
|
|
|
_getRelatedData().then((result) => {
|
|
|
//console.log(result)
|
|
|
|
|
|
_.forEach(formatData, function(data, index) {
|
|
|
// console.log(formatData)
|
...
|
...
|
|