Authored by yyq

Merge branch 'feature/sale' of git.yoho.cn:fe/yohobuy-node into feature/sale

... ... @@ -50,7 +50,7 @@ exports.index = (req, res) => {
exports.channel = (req, res) => {
let resData = {
module: 'product',
page: 'outlets'
page: 'outlets',
};
// 首页模拟数据
... ...
... ... @@ -223,7 +223,7 @@ exports.handleOutletsActivityData = (origin, name) => {
let activity = {};
activity.href = helpers.urlFormat('/outlets/special/detail', { id: value.id });
activity.img = value.coverUrl;
activity.img = value.webCoverUrl;
activity.logo = value.logoUrl;
activity.title = value.title;
activity.limit = (value.endTime - nowTime) * 1000;
... ...
... ... @@ -97,8 +97,10 @@ exports.getOutletsChannelData = (params, channel) => {
apiArr.push(outletsApi.getOutletsActivityOrigin({
platform: 1,
size: 0,
channel: channel,
type: 1
}));
params.channel = channel;
apiArr.push(saleApi.getSaleGoodsList(params));
} else {
// 错误页面
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-19 10:20:08
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-07 15:07:22
* @Last Modified time: 2016-06-07 14:12:50
*/
'use strict';
... ... @@ -279,7 +279,8 @@ exports.getSaleDiscountData = (params, channel) => {
headerModel.requestHeaderData(channel),
saleApi.getSaleGoodsList(params),
saleApi.getSaleBannerList(contentCode[channel].sale),
saleApi.getSaleActivityList(params, channel)
saleApi.getSaleActivityList(params, channel),
saleApi.getSaleGoodsList({ channel: channel, saleType: '3', limit: '1' })
]).then(result => {
let finalResult = result[0];
... ... @@ -287,15 +288,7 @@ exports.getSaleDiscountData = (params, channel) => {
if (result[1].code === 200) {
finalResult.saleList = {};
finalResult.saleList.goods = productProcess.processProductList(result[1].data.product_list);
finalResult.leftContent = saleHandler.handleSaleSortData(result[1].data.filter.group_sort, params);
finalResult.saleList.totalCount = result[1].data.total;
finalResult.saleList.pager = saleHandler.handleSalePagerData(result[1].data.total, params);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = finalResult.saleList.totalCount;
}
// 处理焦点图数据
... ... @@ -310,6 +303,20 @@ exports.getSaleDiscountData = (params, channel) => {
}
}
// 处理分页等筛选信息
if (result[4].code === 200) {
finalResult.leftContent = saleHandler.handleSaleSortData(result[4].data.filter.group_sort, params);
finalResult.saleList.totalCount = result[4].data.total;
finalResult.saleList.pager = saleHandler.handleSalePagerData(result[4].data.total, params);
finalResult.saleList.opts = saleHandler.handleSaleOptsData(params, result[4].data.total);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = finalResult.saleList.totalCount;
}
return finalResult;
});
};
... ...