Authored by OF1706

header api add channel

... ... @@ -191,11 +191,14 @@ const setHeaderData = (resData, type) => (
);
const getHotSearchAsync = () => {
return api.get('', {method: 'app.search.getTerms'}, {
const getHotSearchAsync = (channel) => {
return api.get('', {method: 'app.search.getTerms',yh_channel: channel}, {
cache: 600,
code: 200
});
};
const getHeaderNavAsync = () => {
... ... @@ -215,9 +218,24 @@ exports.requestHeaderData = (type) => {
type = type || 'boys';
let channelNum = (function() {
switch (type) {
case 'boys':
return 1;
case 'girls':
return 2;
case 'kids':
case 'lifestyle':
return 3;
default:
return 1;
}
}());
return Promise.all([
getHeaderNavAsync(),
getHotSearchAsync()
getHotSearchAsync(channelNum)
]).then(res => {
resData.headerData = {};
... ...