Authored by biao

update

... ... @@ -42,16 +42,26 @@ exports.activity = (req, res) => {
exports.willBeEnd = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
outletModel.getNearlyActivity(channel, 2).then(result => {
res.render('outlet/will-end', Object.assign(renderData, result));
outletModel.getNearlyActivity(channel, 2, categoryId).then(result => {
renderData.page = 'outlet-activity';
res.render('outlet/will-end', Object.assign({
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};
exports.willBeCome = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
outletModel.getNearlyActivity(channel, 3).then(result => {
res.render('outlet/will-start', Object.assign(renderData, result));
res.render('outlet/will-start', Object.assign({
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};
... ...
/**
* 频道页面 model
G* @author: Bi Kai<kai.bi@yoho.cn>
* @author: Bi Kai<kai.bi@yoho.cn>
* @date: 2016/05/09
*/
'use strict';
... ... @@ -57,18 +57,17 @@ const convertNavData = (list) => {
const getNavData = (categoryId) => {
const params = {
// client_type: 'iphone',
// os_version: 8.4,
// screen_size: '320x568',
v: 7,
parent_id: categoryId,
debug: 'XYZ'
};
return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
if (result && result.code === 200) {
return convertNavData(result.data);
let data = convertNavData(result.data);
data.category = categoryId;
return data;
} else {
log.error('奥莱导航接口返回状态码 不是 200', result);
return result;
... ... @@ -182,7 +181,7 @@ exports.getActivity = (id) => {
});
};
exports.getNearlyActivity = (channel, type) => {
exports.getNearlyActivity = (channel, type, categoryId) => {
var params = {
type: type
};
... ... @@ -191,10 +190,11 @@ exports.getNearlyActivity = (channel, type) => {
params.yh_channel = 1;
}
return getHomeActivity(params).then(res => {
return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
var data = {
nav: res[0] || [],
activity: {
data: res
data: res[1]
}
};
... ...
... ... @@ -37,7 +37,7 @@ router.get('/sale/filter', sale.filter);
router.get('/outlet', outlet.index);
router.get('/outlet/activity', outlet.activity);
router.get('/outlet/willBeEnd', outlet.willBeEnd);
router.get('/outlet/willBeCome', outlet.willBeCome);
router.get('/outlet/tobeend', outlet.willBeEnd);
router.get('/outlet/soon', outlet.willBeCome);
module.exports = router;
... ...
<div class="outlet-page goods-page yoho-page">
{{> product/outlet/nav }}
{{> product/outlet/nav}}
{{> product/outlet/resource }}
</div>
... ...
<div class="outlet-page">
{{log activity}}
{{> product/outlet/nav}}
{{# activity}}
{{> resources/acivity-outlets}}
{{/ activity}}
... ...
<div class="outlet-page">
{{log activity}}
{{> product/outlet/nav}}
{{# activity}}
{{> resources/acivity-outlets}}
{{/ activity}}
... ...
... ... @@ -4,8 +4,8 @@
{{#each data}}
<li><a href="{{url}}">{{name}}</a></li>
{{/each}}
<li><a href="outlet/willStart">即将结束</a></li>
<li><a href="outlet/willEnd">即将开始</a></li>
<li><a href="outlet/tobeend?yh_channel=5&category_id={{category}}">即将结束</a></li>
<li><a href="outlet/soon?yh_channel=6&category_id={{category}}">即将开始</a></li>
</ul>
</nav>
{{/nav}}
... ...
var iscroll = require('./outlet/nav'),
Countdown = require('./outlet/countdown');
var el = $('.cd-lite');
// 导航滚动
iscroll({
el: '#index_nav'
}).goto($('#index_nav').find('.active').index());
new Countdown.Countdown({
el: el
});
... ...