Authored by 王水玲

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuywap-node into release/4.6

@@ -24,8 +24,9 @@ exports.index = (req, res) => { @@ -24,8 +24,9 @@ exports.index = (req, res) => {
24 let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null); 24 let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
25 let categoryId = req.query.category_id; 25 let categoryId = req.query.category_id;
26 let yhChannel = req.query.yh_channel || 1; 26 let yhChannel = req.query.yh_channel || 1;
  27 + let contentcode = req.query.content_code;
27 28
28 - outletModel.getContent(categoryId, yhChannel).then(result => { 29 + outletModel.getContent(categoryId, yhChannel, contentcode).then(result => {
29 res.render('outlet', Object.assign({ 30 res.render('outlet', Object.assign({
30 page: 'outlet', 31 page: 'outlet',
31 pageHeader: headerData, 32 pageHeader: headerData,
@@ -53,7 +54,7 @@ exports.activityChannel = (req, res) => { @@ -53,7 +54,7 @@ exports.activityChannel = (req, res) => {
53 let categoryId = req.query.category_id; 54 let categoryId = req.query.category_id;
54 let type = req.query.type || 2; 55 let type = req.query.type || 2;
55 let template = type === 2 ? 'outlet/will-end' : 'outlet/will-start'; 56 let template = type === 2 ? 'outlet/will-end' : 'outlet/will-start';
56 - let page = type === 2 ? 'tobeend' : 'soon'; 57 + let page = type === 2 ? 'outlet-will-end' : 'outlet-will-start';
57 let yhChannel = yhChannelMap[channel]; 58 let yhChannel = yhChannelMap[channel];
58 59
59 outletModel.getNearlyActivity(yhChannel, type, categoryId).then(result => { 60 outletModel.getNearlyActivity(yhChannel, type, categoryId).then(result => {
@@ -22,9 +22,10 @@ const serviceApi = new ServiceAPI(); @@ -22,9 +22,10 @@ const serviceApi = new ServiceAPI();
22 const api = new API(); 22 const api = new API();
23 23
24 24
25 -const getOutletResource = (channel) => { 25 +const getOutletResource = (channel, contentcode) => {
  26 + console.log(contentcode);
26 const params = { 27 const params = {
27 - content_code: 'c19ffa03f053f4cac3690b22c8da26b7', 28 + content_code: contentcode || 'c19ffa03f053f4cac3690b22c8da26b7',
28 limit: 25, 29 limit: 25,
29 yh_channel: channel || '', 30 yh_channel: channel || '',
30 debug: 'XYZ' 31 debug: 'XYZ'
@@ -58,8 +59,7 @@ const convertNavData = (list) => { @@ -58,8 +59,7 @@ const convertNavData = (list) => {
58 const getNavData = (categoryId) => { 59 const getNavData = (categoryId) => {
59 const params = { 60 const params = {
60 v: 7, 61 v: 7,
61 - parent_id: categoryId,  
62 - debug: 'XYZ' 62 + parent_id: categoryId
63 }; 63 };
64 64
65 return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => { 65 return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
@@ -137,7 +137,6 @@ const getHomeActivity = (data) => { @@ -137,7 +137,6 @@ const getHomeActivity = (data) => {
137 var params = { 137 var params = {
138 method: 'app.outlets.activityGet', 138 method: 'app.outlets.activityGet',
139 platform: 2, 139 platform: 2,
140 - size: 0,  
141 sort: 2, 140 sort: 2,
142 client_type: 'h5' 141 client_type: 'h5'
143 }; 142 };
@@ -147,19 +146,16 @@ const getHomeActivity = (data) => { @@ -147,19 +146,16 @@ const getHomeActivity = (data) => {
147 }); 146 });
148 }; 147 };
149 148
150 -exports.getContent = (categoryId, channel) => { 149 +exports.getContent = (categoryId, channel, code) => {
151 let floorsData = {}, 150 let floorsData = {},
152 params = { 151 params = {
153 type: 0, 152 type: 0,
154 id: 0 153 id: 0
155 }; 154 };
156 155
157 - if (channel === 'boys') {  
158 - params.yh_channel = 1;  
159 - }  
160 - const promises = [getNavData(categoryId), getOutletResource(channel), getHomeActivity(params), getGoodsList()]; 156 + const p = [getNavData(categoryId), getOutletResource(channel, code), getHomeActivity(params), getGoodsList()];
161 157
162 - return Promise.all(promises).then(data => { 158 + return Promise.all(p).then(data => {
163 floorsData.nav = data[0] || []; 159 floorsData.nav = data[0] || [];
164 floorsData.content = data[1] || []; 160 floorsData.content = data[1] || [];
165 floorsData.activity = {data: data[2]}; 161 floorsData.activity = {data: data[2]};
@@ -186,10 +182,6 @@ exports.getNearlyActivity = (channel, type, categoryId) => { @@ -186,10 +182,6 @@ exports.getNearlyActivity = (channel, type, categoryId) => {
186 type: type 182 type: type
187 }; 183 };
188 184
189 - if (channel === 'boys') {  
190 - params.yh_channel = 1;  
191 - }  
192 -  
193 return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => { 185 return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
194 var data = { 186 var data = {
195 nav: res[0] || [], 187 nav: res[0] || [],
1 -<div class="outlet-page"> 1 +<div class="outlet-page yoho-page">
2 {{> product/outlet/nav}} 2 {{> product/outlet/nav}}
3 {{# activity}} 3 {{# activity}}
4 {{#data}} 4 {{#data}}
1 -<div class="outlet-page"> 1 +<div class="outlet-page yoho-page">
2 {{> product/outlet/nav}} 2 {{> product/outlet/nav}}
3 {{# activity}} 3 {{# activity}}
4 {{> resources/acivity-outlets}} 4 {{> resources/acivity-outlets}}
  1 +/**
  2 + * Created by runner on 16/6/14.
  3 + */
  4 +var $ = require('yoho-jquery'),
  5 + Countdown = require('./outlet/countdown'),
  6 + tip = require('../plugin/tip');
  7 +
  8 +var el = $('.cd-lite');
  9 +
  10 +require('../common');
  11 +
  12 +new Countdown.Countdown({
  13 + el: el
  14 +});
  15 +
  16 +$('.will-end-back').on('click', function() {
  17 + tip.show('活动即将结束');
  18 + return false;
  19 +});
  1 +/**
  2 + * Created by runner on 16/6/14.
  3 + */
  4 +var $ = require('yoho-jquery'),
  5 + Countdown = require('./outlet/countdown'),
  6 + tip = require('../plugin/tip');
  7 +
  8 +var el = $('.cd-lite');
  9 +
  10 +require('../common');
  11 +
  12 +new Countdown.Countdown({
  13 + el: el
  14 +});
  15 +
  16 +$('.back-ground-white').on('click', function() {
  17 + tip.show('活动即将开始');
  18 + return false;
  19 +});