...
|
...
|
@@ -628,7 +628,7 @@ const _formatParams = (channel, data) => { |
|
|
params.sales = 'Y'; // 只搜索销售的产品
|
|
|
params.outlets = 2; // 非奥莱商品
|
|
|
params.stocknumber = 1; // 过滤掉已售罄的商品
|
|
|
params.attribute_not = 2; //过滤掉赠品
|
|
|
params.attribute_not = 2; // 过滤掉赠品
|
|
|
if (!data.order) {
|
|
|
params.order = orderMaps.s_t_desc;
|
|
|
} else {
|
...
|
...
|
@@ -655,7 +655,7 @@ const _formatParams = (channel, data) => { |
|
|
|
|
|
return result;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 格式化频道页首次登陆导航数据
|
...
|
...
|
@@ -687,9 +687,9 @@ const formatIndexGuideData = data => { |
|
|
});
|
|
|
|
|
|
if (channels[channel]) {
|
|
|
promiseArr.push(_formatParams(channel, channels[channel]))
|
|
|
promiseArr.push(_formatParams(channel, channels[channel]));
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
|
|
|
return Promise.all(promiseArr).then(data => {
|
|
|
_.forEach(formatData, (item, index) => {
|
...
|
...
|
@@ -697,12 +697,13 @@ const formatIndexGuideData = data => { |
|
|
if (formatData[index].channel === data[ind].channel) {
|
|
|
formatData[index].num = data[ind].total;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return formatData;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取最新上架商品数据
|
|
|
*
|
...
|
...
|
@@ -845,23 +846,23 @@ exports.getResourceData = (formatData) => { |
|
|
|
|
|
_.forEach(data, item => {
|
|
|
if (item.content_code) {
|
|
|
promiseArr.push(_formatResourceParams(content_code))
|
|
|
promiseArr.push(_formatResourceParams(content_code));
|
|
|
}
|
|
|
|
|
|
return Promise.all(promiseArr).then(data => {
|
|
|
//console.log(formatData);
|
|
|
// console.log(formatData);
|
|
|
_.forEach(formatData, (item, index) => {
|
|
|
_.forEach(data, (item, ind) => {
|
|
|
if (formatData[index].channel === data[ind].channel) {
|
|
|
formatData[index].src = data[ind].src;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
console.log(formatData);
|
|
|
return formatData;
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取频道页首次登陆导航数据
|
...
|
...
|
@@ -875,7 +876,7 @@ const getIndexGuideData = () => { |
|
|
};
|
|
|
|
|
|
return serviceApi.get('operations/api/v6/category/getCategory', params);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getNewArrival: getNewArrival,
|
...
|
...
|
|