Showing
8 changed files
with
43 additions
and
19 deletions
@@ -42,16 +42,26 @@ exports.activity = (req, res) => { | @@ -42,16 +42,26 @@ exports.activity = (req, res) => { | ||
42 | 42 | ||
43 | exports.willBeEnd = (req, res) => { | 43 | exports.willBeEnd = (req, res) => { |
44 | let channel = req.query.channel || req.cookies._Channel || 'boys'; | 44 | let channel = req.query.channel || req.cookies._Channel || 'boys'; |
45 | + let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null); | ||
46 | + let categoryId = req.query.category_id; | ||
45 | 47 | ||
46 | - outletModel.getNearlyActivity(channel, 2).then(result => { | ||
47 | - res.render('outlet/will-end', Object.assign(renderData, result)); | 48 | + outletModel.getNearlyActivity(channel, 2, categoryId).then(result => { |
49 | + renderData.page = 'outlet-activity'; | ||
50 | + res.render('outlet/will-end', Object.assign({ | ||
51 | + pageHeader: headerData, | ||
52 | + pageFooter: true | ||
53 | + }, renderData, result)); | ||
48 | }); | 54 | }); |
49 | }; | 55 | }; |
50 | 56 | ||
51 | exports.willBeCome = (req, res) => { | 57 | exports.willBeCome = (req, res) => { |
52 | let channel = req.query.channel || req.cookies._Channel || 'boys'; | 58 | let channel = req.query.channel || req.cookies._Channel || 'boys'; |
59 | + let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null); | ||
53 | 60 | ||
54 | outletModel.getNearlyActivity(channel, 3).then(result => { | 61 | outletModel.getNearlyActivity(channel, 3).then(result => { |
55 | - res.render('outlet/will-start', Object.assign(renderData, result)); | 62 | + res.render('outlet/will-start', Object.assign({ |
63 | + pageHeader: headerData, | ||
64 | + pageFooter: true | ||
65 | + }, renderData, result)); | ||
56 | }); | 66 | }); |
57 | }; | 67 | }; |
1 | /** | 1 | /** |
2 | * 频道页面 model | 2 | * 频道页面 model |
3 | -G* @author: Bi Kai<kai.bi@yoho.cn> | 3 | + * @author: Bi Kai<kai.bi@yoho.cn> |
4 | * @date: 2016/05/09 | 4 | * @date: 2016/05/09 |
5 | */ | 5 | */ |
6 | 'use strict'; | 6 | 'use strict'; |
@@ -57,18 +57,17 @@ const convertNavData = (list) => { | @@ -57,18 +57,17 @@ const convertNavData = (list) => { | ||
57 | 57 | ||
58 | const getNavData = (categoryId) => { | 58 | const getNavData = (categoryId) => { |
59 | const params = { | 59 | const params = { |
60 | - // client_type: 'iphone', | ||
61 | - // os_version: 8.4, | ||
62 | - // screen_size: '320x568', | ||
63 | v: 7, | 60 | v: 7, |
64 | - | ||
65 | parent_id: categoryId, | 61 | parent_id: categoryId, |
66 | debug: 'XYZ' | 62 | debug: 'XYZ' |
67 | }; | 63 | }; |
68 | 64 | ||
69 | 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 => { |
70 | if (result && result.code === 200) { | 66 | if (result && result.code === 200) { |
71 | - return convertNavData(result.data); | 67 | + let data = convertNavData(result.data); |
68 | + | ||
69 | + data.category = categoryId; | ||
70 | + return data; | ||
72 | } else { | 71 | } else { |
73 | log.error('奥莱导航接口返回状态码 不是 200', result); | 72 | log.error('奥莱导航接口返回状态码 不是 200', result); |
74 | return result; | 73 | return result; |
@@ -182,7 +181,7 @@ exports.getActivity = (id) => { | @@ -182,7 +181,7 @@ exports.getActivity = (id) => { | ||
182 | }); | 181 | }); |
183 | }; | 182 | }; |
184 | 183 | ||
185 | -exports.getNearlyActivity = (channel, type) => { | 184 | +exports.getNearlyActivity = (channel, type, categoryId) => { |
186 | var params = { | 185 | var params = { |
187 | type: type | 186 | type: type |
188 | }; | 187 | }; |
@@ -191,10 +190,11 @@ exports.getNearlyActivity = (channel, type) => { | @@ -191,10 +190,11 @@ exports.getNearlyActivity = (channel, type) => { | ||
191 | params.yh_channel = 1; | 190 | params.yh_channel = 1; |
192 | } | 191 | } |
193 | 192 | ||
194 | - return getHomeActivity(params).then(res => { | 193 | + return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => { |
195 | var data = { | 194 | var data = { |
195 | + nav: res[0] || [], | ||
196 | activity: { | 196 | activity: { |
197 | - data: res | 197 | + data: res[1] |
198 | } | 198 | } |
199 | }; | 199 | }; |
200 | 200 |
@@ -37,7 +37,7 @@ router.get('/sale/filter', sale.filter); | @@ -37,7 +37,7 @@ router.get('/sale/filter', sale.filter); | ||
37 | router.get('/outlet', outlet.index); | 37 | router.get('/outlet', outlet.index); |
38 | router.get('/outlet/activity', outlet.activity); | 38 | router.get('/outlet/activity', outlet.activity); |
39 | 39 | ||
40 | -router.get('/outlet/willBeEnd', outlet.willBeEnd); | ||
41 | -router.get('/outlet/willBeCome', outlet.willBeCome); | 40 | +router.get('/outlet/tobeend', outlet.willBeEnd); |
41 | +router.get('/outlet/soon', outlet.willBeCome); | ||
42 | 42 | ||
43 | module.exports = router; | 43 | module.exports = router; |
@@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
4 | {{#each data}} | 4 | {{#each data}} |
5 | <li><a href="{{url}}">{{name}}</a></li> | 5 | <li><a href="{{url}}">{{name}}</a></li> |
6 | {{/each}} | 6 | {{/each}} |
7 | - <li><a href="outlet/willStart">即将结束</a></li> | ||
8 | - <li><a href="outlet/willEnd">即将开始</a></li> | 7 | + <li><a href="outlet/tobeend?yh_channel=5&category_id={{category}}">即将结束</a></li> |
8 | + <li><a href="outlet/soon?yh_channel=6&category_id={{category}}">即将开始</a></li> | ||
9 | </ul> | 9 | </ul> |
10 | </nav> | 10 | </nav> |
11 | {{/nav}} | 11 | {{/nav}} |
public/js/product/outlet-activity.page.js
0 → 100644
-
Please register or login to post a comment