...
|
...
|
@@ -3,6 +3,8 @@ const api = global.yoho.API; |
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const _ = require('lodash');
|
|
|
const productProcess = require('../../../utils/product-process');
|
|
|
const logger = global.yoho.logger;
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
|
|
|
const formaData = (data, gender) => {
|
|
|
let build = [];
|
...
|
...
|
@@ -64,8 +66,6 @@ const getContentData = (gender, type) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getListData = (gender, recom, all) => {
|
|
|
return Promise.all([getContentData(gender, recom), getContentData(gender, all)]).then((result) => {
|
|
|
return {
|
...
|
...
|
@@ -75,7 +75,37 @@ const getListData = (gender, recom, all) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const getRelatedEditorial = () => {
|
|
|
|
|
|
};
|
|
|
|
|
|
const getBrandData = (id, clientType) => {
|
|
|
|
|
|
return serviceAPI.get('guang/api/v1/plustar/getbrandinfo', {
|
|
|
id: id,
|
|
|
client_type: clientType
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
//console.log(result.data)
|
|
|
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
|
|
logger.error('detail data return code is not 200');
|
|
|
return {};
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
|
|
|
return Promise.all([getBrandData(id, clientType), getRelatedEditorial(gender)]).then((result) => {
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
getListData,
|
|
|
getContentData
|
|
|
getContentData,
|
|
|
getDetailData
|
|
|
}; |
...
|
...
|
|