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) => { @@ -50,7 +50,7 @@ exports.index = (req, res) => {
50 exports.channel = (req, res) => { 50 exports.channel = (req, res) => {
51 let resData = { 51 let resData = {
52 module: 'product', 52 module: 'product',
53 - page: 'outlets' 53 + page: 'outlets',
54 }; 54 };
55 55
56 // 首页模拟数据 56 // 首页模拟数据
@@ -223,7 +223,7 @@ exports.handleOutletsActivityData = (origin, name) => { @@ -223,7 +223,7 @@ exports.handleOutletsActivityData = (origin, name) => {
223 let activity = {}; 223 let activity = {};
224 224
225 activity.href = helpers.urlFormat('/outlets/special/detail', { id: value.id }); 225 activity.href = helpers.urlFormat('/outlets/special/detail', { id: value.id });
226 - activity.img = value.coverUrl; 226 + activity.img = value.webCoverUrl;
227 activity.logo = value.logoUrl; 227 activity.logo = value.logoUrl;
228 activity.title = value.title; 228 activity.title = value.title;
229 activity.limit = (value.endTime - nowTime) * 1000; 229 activity.limit = (value.endTime - nowTime) * 1000;
@@ -97,8 +97,10 @@ exports.getOutletsChannelData = (params, channel) => { @@ -97,8 +97,10 @@ exports.getOutletsChannelData = (params, channel) => {
97 apiArr.push(outletsApi.getOutletsActivityOrigin({ 97 apiArr.push(outletsApi.getOutletsActivityOrigin({
98 platform: 1, 98 platform: 1,
99 size: 0, 99 size: 0,
  100 + channel: channel,
100 type: 1 101 type: 1
101 })); 102 }));
  103 + params.channel = channel;
102 apiArr.push(saleApi.getSaleGoodsList(params)); 104 apiArr.push(saleApi.getSaleGoodsList(params));
103 } else { 105 } else {
104 // 错误页面 106 // 错误页面
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-19 10:20:08 3 * @Date: 2016-05-19 10:20:08
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-06-07 15:07:22 5 + * @Last Modified time: 2016-06-07 14:12:50
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
@@ -279,7 +279,8 @@ exports.getSaleDiscountData = (params, channel) => { @@ -279,7 +279,8 @@ exports.getSaleDiscountData = (params, channel) => {
279 headerModel.requestHeaderData(channel), 279 headerModel.requestHeaderData(channel),
280 saleApi.getSaleGoodsList(params), 280 saleApi.getSaleGoodsList(params),
281 saleApi.getSaleBannerList(contentCode[channel].sale), 281 saleApi.getSaleBannerList(contentCode[channel].sale),
282 - saleApi.getSaleActivityList(params, channel) 282 + saleApi.getSaleActivityList(params, channel),
  283 + saleApi.getSaleGoodsList({ channel: channel, saleType: '3', limit: '1' })
283 ]).then(result => { 284 ]).then(result => {
284 let finalResult = result[0]; 285 let finalResult = result[0];
285 286
@@ -287,15 +288,7 @@ exports.getSaleDiscountData = (params, channel) => { @@ -287,15 +288,7 @@ exports.getSaleDiscountData = (params, channel) => {
287 if (result[1].code === 200) { 288 if (result[1].code === 200) {
288 finalResult.saleList = {}; 289 finalResult.saleList = {};
289 finalResult.saleList.goods = productProcess.processProductList(result[1].data.product_list); 290 finalResult.saleList.goods = productProcess.processProductList(result[1].data.product_list);
290 - finalResult.leftContent = saleHandler.handleSaleSortData(result[1].data.filter.group_sort, params);  
291 - finalResult.saleList.totalCount = result[1].data.total;  
292 - finalResult.saleList.pager = saleHandler.handleSalePagerData(result[1].data.total, params);  
293 291
294 - // 处理所有商品标题数据  
295 - finalResult.saleTitle = {};  
296 -  
297 - finalResult.saleTitle.name = '所有商品';  
298 - finalResult.saleTitle.count = finalResult.saleList.totalCount;  
299 } 292 }
300 293
301 // 处理焦点图数据 294 // 处理焦点图数据
@@ -310,6 +303,20 @@ exports.getSaleDiscountData = (params, channel) => { @@ -310,6 +303,20 @@ exports.getSaleDiscountData = (params, channel) => {
310 } 303 }
311 } 304 }
312 305
  306 + // 处理分页等筛选信息
  307 + if (result[4].code === 200) {
  308 + finalResult.leftContent = saleHandler.handleSaleSortData(result[4].data.filter.group_sort, params);
  309 + finalResult.saleList.totalCount = result[4].data.total;
  310 + finalResult.saleList.pager = saleHandler.handleSalePagerData(result[4].data.total, params);
  311 + finalResult.saleList.opts = saleHandler.handleSaleOptsData(params, result[4].data.total);
  312 +
  313 + // 处理所有商品标题数据
  314 + finalResult.saleTitle = {};
  315 +
  316 + finalResult.saleTitle.name = '所有商品';
  317 + finalResult.saleTitle.count = finalResult.saleList.totalCount;
  318 + }
  319 +
313 return finalResult; 320 return finalResult;
314 }); 321 });
315 }; 322 };