...
|
...
|
@@ -33,7 +33,7 @@ const getOutletResource = (channel, contentcode) => { |
|
|
return resourcesProcess(result.data.list);
|
|
|
} else {
|
|
|
log.error('奥莱资源位接口返回状态码 不是 200');
|
|
|
return result;
|
|
|
return [];
|
|
|
}
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -68,7 +68,7 @@ const getNavData = (categoryId) => { |
|
|
return data;
|
|
|
} else {
|
|
|
log.error('奥莱导航接口返回状态码 不是 200', result);
|
|
|
return result;
|
|
|
return [];
|
|
|
}
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -115,7 +115,7 @@ const convertActicityData = (data) => { |
|
|
const getHomeActivity = (data) => {
|
|
|
var params = {
|
|
|
method: 'app.outlets.activityGet',
|
|
|
platform: 2,
|
|
|
platform: 2
|
|
|
};
|
|
|
|
|
|
return api.get('', sign.apiSign(_.assign(params, data))).then(res => {
|
...
|
...
|
@@ -124,48 +124,51 @@ const getHomeActivity = (data) => { |
|
|
};
|
|
|
|
|
|
exports.getContent = (categoryId, channel, code) => {
|
|
|
let floorsData = {},
|
|
|
params = {
|
|
|
type: 0,
|
|
|
yh_channel: channel
|
|
|
};
|
|
|
let params = {
|
|
|
type: 0,
|
|
|
yh_channel: channel
|
|
|
};
|
|
|
|
|
|
const p = [getNavData(categoryId), getOutletResource(channel, code), getHomeActivity(params)];
|
|
|
|
|
|
return Promise.all(p).then(data => {
|
|
|
floorsData.nav = data[0] || [];
|
|
|
floorsData.content = data[1] || [];
|
|
|
floorsData.activity = {data: data[2]};
|
|
|
|
|
|
return floorsData;
|
|
|
return {
|
|
|
nav: data[0] || [],
|
|
|
content: data[1] || [],
|
|
|
activity: data[2]
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
exports.getActivity = (id) => {
|
|
|
return getActivityDetail(id).then(res => {
|
|
|
var data = {};
|
|
|
|
|
|
data.outletActivity = res;
|
|
|
data.productPool = res[0] && res[0].productPoolId || '';
|
|
|
data.saleType = 4;
|
|
|
return data;
|
|
|
return {
|
|
|
outletActivity: res,
|
|
|
productPool: res[0] || res[0].productPoolId || '',
|
|
|
saleType: 4
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.getNearlyActivity = (channel, type, categoryId) => {
|
|
|
/**
|
|
|
* 获取即将开始或即将结束的活动列表
|
|
|
* @param {Number} type 标明是即将开始还是即将技术
|
|
|
* @param {String} categoryId 父级菜单id,用于标明当前页面是奥莱页面
|
|
|
* @return {Object} 活动列表数据
|
|
|
*/
|
|
|
exports.getRecentActivity = (type, categoryId) => {
|
|
|
var params = {
|
|
|
type: type
|
|
|
type: 0
|
|
|
};
|
|
|
|
|
|
return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
|
|
|
var data = {
|
|
|
|
|
|
return {
|
|
|
nav: res[0] || [],
|
|
|
activity: {
|
|
|
data: res[1]
|
|
|
}
|
|
|
activity: res[1]
|
|
|
};
|
|
|
|
|
|
return data;
|
|
|
});
|
|
|
}; |
...
|
...
|
|