...
|
...
|
@@ -214,6 +214,7 @@ const _getRelatedData = (idList) => { |
|
|
productSkn: idList,
|
|
|
method: 'h5.product.batch'
|
|
|
}).then((result) => {
|
|
|
// console.log(result)
|
|
|
let productList = [];
|
|
|
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -224,7 +225,8 @@ const _getRelatedData = (idList) => { |
|
|
name: data.product_name,
|
|
|
price: data.sales_price,
|
|
|
productId: data.product_id,
|
|
|
cnAlphabet: data.cn_alphabet
|
|
|
cnAlphabet: data.cn_alphabet,
|
|
|
productSkn: data.product_skn
|
|
|
});
|
|
|
});
|
|
|
return productList;
|
...
|
...
|
@@ -316,24 +318,46 @@ const _processContentData = (list) => { |
|
|
|
|
|
return _getRelatedData(idList).then((result) => {
|
|
|
|
|
|
|
|
|
if (related.relatedReco) {
|
|
|
_.forEach(related.relatedReco, function(data, index) {
|
|
|
if (result[index]) {
|
|
|
data = _.assign(data, {
|
|
|
link: config.siteUrl + '/product/list/pro_' +
|
|
|
result[index].productId + '_' + data.productSkc + '/' +
|
|
|
result[index].cnAlphabet + '.html'
|
|
|
});
|
|
|
data = _.assign(data, result[index]);
|
|
|
_.forEach(related.relatedReco, function(data, key) {
|
|
|
|
|
|
_.forEach(result, function(list, index) {
|
|
|
if(data.id === list.productSkn) {
|
|
|
data = _.assign(data, {
|
|
|
link: config.siteUrl + '/product/list/pro_' +
|
|
|
result[index].productId + '_' + data.productSkc + '/' +
|
|
|
result[index].cnAlphabet + '.html'
|
|
|
});
|
|
|
data = _.assign(data, result[index]);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (!data.name) {
|
|
|
delete related.relatedReco[key];
|
|
|
}
|
|
|
|
|
|
});
|
|
|
result.splice(0, recoLength.length);
|
|
|
}
|
|
|
|
|
|
if (related.relatedGroup) {
|
|
|
_.forEach(related.relatedGroup, function(data, index) {
|
|
|
_.forEach(related.relatedGroup, function(data, key) {
|
|
|
|
|
|
_.forEach(result, function(list, index) {
|
|
|
if(data.id === list.productSkn) {
|
|
|
data = _.assign(data, {
|
|
|
link: config.siteUrl + '/product/list/pro_' +
|
|
|
result[index].productId + '_' + data.productSkc + '/' +
|
|
|
result[index].cnAlphabet + '.html'
|
|
|
});
|
|
|
data = _.assign(data, result[index]);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (!data.name) {
|
|
|
delete related.relatedGroup[key];
|
|
|
}
|
|
|
|
|
|
data = _.assign(data, result[index]);
|
|
|
|
|
|
});
|
|
|
}
|
...
|
...
|
|