Authored by biao

Merge branch 'feature/outlet' of http://git.yoho.cn/fe/yohobuywap-node into feature/outlet

... ... @@ -16,8 +16,9 @@ const renderData = {
exports.index = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
outletModel.getContent().then(result => {
outletModel.getContent(categoryId).then(result => {
res.render('outlet', Object.assign({
pageHeader: headerData,
pageFooter: true
... ...
... ... @@ -54,18 +54,18 @@ const convertNavData = (list) => {
return {data: formatData};
};
const getNavData = () => {
const getNavData = (categoryId) => {
const params = {
// client_type: 'iphone',
// os_version: 8.4,
// screen_size: '320x568',
v: 7,
// parent_id: 1107,
parent_id: categoryId,
debug: 'XYZ'
};
return api.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
if (result && result.code === 200) {
return convertNavData(result.data);
} else {
... ... @@ -162,10 +162,10 @@ const getHomeActivity = (id) => {
});
};
exports.getContent = () => {
exports.getContent = (categoryId) => {
let floorsData = {};
return Promise.all([getNavData(), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => {
return Promise.all([getNavData(categoryId), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => {
floorsData.nav = data[0] || [];
floorsData.content = data[1] || [];
floorsData.activity = data[2] || [];
... ...