Authored by lijing

逛标签页

... ... @@ -144,8 +144,46 @@ const index = (req, res, next) => {
}).catch(next);
};
/**
* 逛标签页
* @param req
* @param res
* @param next
*/
const tag = (req, res, next) => {
let headerData = headerModel.setNav({
navTitle: '逛标签页'
});
let responseData = {
pageHeader: headerData,
module: 'guang',
page: 'index-tag',
title: '逛标签页',
pageFooter: true
};
let param = {
tag: req.query.tag || '逛标签页h5', // TODO
channel: req.query.channel,
isApp: req.query.app_version || req.query.appVersion || false,
gender: req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1,
uid: req.user.uid || 6228593, // TODO
udid: req.sessionID
};
if (param.isApp === false) {
responseData.pageHeader.navTitle = param.tag;
}
indexModel.getTagEditor(param).then(result => {
res.render('index/list', responseData);
}).catch(next);
};
module.exports = {
editor,
pageData,
index
index,
tag
};
... ...
... ... @@ -168,7 +168,7 @@ const getArticle = (param) => {
_category(),
_article(param)
]).then(result => {
console.log(result[1].data);
let type = param.type;
let resu = {
... ... @@ -251,7 +251,19 @@ const getArticle = (param) => {
}
// console.log(resu);
return resu;
});
};
const getTagEditor = (param) => {
return api.all([
_article(param)
]).then(result => {
// console.log(result[0].data.list);
let resu = {};
return resu;
... ... @@ -263,5 +275,6 @@ module.exports = {
getAuthor: _getAuthor,
getArticleList: _getArticleList,
getPageData: _getPageData,
getArticle
getArticle,
getTagEditor
};
... ...
... ... @@ -30,6 +30,7 @@ router.post('/star/setFavorite', star.setFavorite); // 收藏文章
router.get('/plusstar', plusstar.index); // 潮流优选
router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // 潮流优选首页-资源位
router.get('/', index.index); // 逛首页
router.get('/index/tags', index.tag); // 逛标签页
router.get('/author/list', index.editor); // 编辑简介
... ...
require('../common');
... ...