Authored by yyq

outlets channel

@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 'use strict'; 7 'use strict';
8 const mRoot = '../models'; 8 const mRoot = '../models';
9 const outlets = require(`${mRoot}/outlets`); 9 const outlets = require(`${mRoot}/outlets`);
  10 +const log = require(`${global.library}/logger`);
10 11
11 /** 12 /**
12 * outlets 首页 13 * outlets 首页
@@ -27,7 +28,8 @@ exports.index = (req, res) => { @@ -27,7 +28,8 @@ exports.index = (req, res) => {
27 resData.headerData = result.headerData; 28 resData.headerData = result.headerData;
28 resData.resultShow = JSON.stringify(result, null, 4); 29 resData.resultShow = JSON.stringify(result, null, 4);
29 res.render('outlets/index', resData); 30 res.render('outlets/index', resData);
30 - }).catch(() => { 31 + }).catch((e) => {
  32 + log.error(e);
31 resData.pageErr = true; 33 resData.pageErr = true;
32 res.render('error', resData); 34 res.render('error', resData);
33 }); 35 });
@@ -48,7 +50,8 @@ exports.channel = (req, res) => { @@ -48,7 +50,8 @@ exports.channel = (req, res) => {
48 50
49 outlets.getOutletsChannelData(req.query, req.params.channel).then(result => { 51 outlets.getOutletsChannelData(req.query, req.params.channel).then(result => {
50 res.render('outlets/channel', Object.assign(resData, result)); 52 res.render('outlets/channel', Object.assign(resData, result));
51 - }).catch(() => { 53 + }).catch((e) => {
  54 + log.error(e);
52 resData.pageErr = true; 55 resData.pageErr = true;
53 res.render('error', resData); 56 res.render('error', resData);
54 }); 57 });
@@ -74,7 +77,8 @@ exports.special = (req, res) => { @@ -74,7 +77,8 @@ exports.special = (req, res) => {
74 77
75 outlets.getOutletsSpecialData(params, channel).then(result => { 78 outlets.getOutletsSpecialData(params, channel).then(result => {
76 res.render('outlets/special', Object.assign(resData, result)); 79 res.render('outlets/special', Object.assign(resData, result));
77 - }).catch(() => { 80 + }).catch((e) => {
  81 + log.error(e);
78 resData.pageErr = true; 82 resData.pageErr = true;
79 res.render('error', resData); 83 res.render('error', resData);
80 }); 84 });
@@ -101,7 +105,8 @@ exports.list = (req, res) => { @@ -101,7 +105,8 @@ exports.list = (req, res) => {
101 outlets.getOutletsCategoryData(params, channel).then((result) => { 105 outlets.getOutletsCategoryData(params, channel).then((result) => {
102 responseData.resultShow = JSON.stringify(result, null, 4); 106 responseData.resultShow = JSON.stringify(result, null, 4);
103 res.render('sale/other', Object.assign(responseData, result)); 107 res.render('sale/other', Object.assign(responseData, result));
104 - }).catch(() => { 108 + }).catch((e) => {
  109 + log.error(e);
105 responseData.pageErr = true; 110 responseData.pageErr = true;
106 res.render('error', responseData); 111 res.render('error', responseData);
107 }); 112 });
@@ -129,7 +129,6 @@ exports.getOutletsChannelData = (params, channel) => { @@ -129,7 +129,6 @@ exports.getOutletsChannelData = (params, channel) => {
129 if (result[1].code === 200) { 129 if (result[1].code === 200) {
130 Object.assign(channelData, outletsProcess.processFloor(result[1].data.list, params)); 130 Object.assign(channelData, outletsProcess.processFloor(result[1].data.list, params));
131 } 131 }
132 -  
133 // 限时嗨购 132 // 限时嗨购
134 if (result[2].code === 200) { 133 if (result[2].code === 200) {
135 channelData.nearOver = outletsProcess.handleOutletsActivityData(result[2].data, '限时嗨购'); 134 channelData.nearOver = outletsProcess.handleOutletsActivityData(result[2].data, '限时嗨购');
@@ -137,6 +136,9 @@ exports.getOutletsChannelData = (params, channel) => { @@ -137,6 +136,9 @@ exports.getOutletsChannelData = (params, channel) => {
137 136
138 // 商品列表 137 // 商品列表
139 if (result[3].code === 200) { 138 if (result[3].code === 200) {
  139 + if (!channelData.goodsBoard) {
  140 + channelData.goodsBoard = {};
  141 + }
140 channelData.goodsBoard.sort = publicHandler.handleSaleOptsData(params, result[3].data.total); 142 channelData.goodsBoard.sort = publicHandler.handleSaleOptsData(params, result[3].data.total);
141 channelData.goodsBoard.sort.newPage = true; 143 channelData.goodsBoard.sort.newPage = true;
142 channelData.goodsBoard.list = productProcess.processProductList(result[3].data.product_list); 144 channelData.goodsBoard.list = productProcess.processProductList(result[3].data.product_list);
1 -<div class="outlets-channel-page yoho-page" data-page="girls"> 1 +<div class="outlets-channel-page outlets-page center-content yoho-page" data-page="girls">
2 <div class="slide-container clearfix"> 2 <div class="slide-container clearfix">
3 <div class="center-col col"> 3 <div class="center-col col">
4 <ul class="slide-wrapper"> 4 <ul class="slide-wrapper">