Showing
4 changed files
with
57 additions
and
4 deletions
@@ -144,8 +144,46 @@ const index = (req, res, next) => { | @@ -144,8 +144,46 @@ const index = (req, res, next) => { | ||
144 | }).catch(next); | 144 | }).catch(next); |
145 | }; | 145 | }; |
146 | 146 | ||
147 | +/** | ||
148 | + * 逛标签页 | ||
149 | + * @param req | ||
150 | + * @param res | ||
151 | + * @param next | ||
152 | + */ | ||
153 | +const tag = (req, res, next) => { | ||
154 | + let headerData = headerModel.setNav({ | ||
155 | + navTitle: '逛标签页' | ||
156 | + }); | ||
157 | + | ||
158 | + let responseData = { | ||
159 | + pageHeader: headerData, | ||
160 | + module: 'guang', | ||
161 | + page: 'index-tag', | ||
162 | + title: '逛标签页', | ||
163 | + pageFooter: true | ||
164 | + }; | ||
165 | + | ||
166 | + let param = { | ||
167 | + tag: req.query.tag || '逛标签页h5', // TODO | ||
168 | + channel: req.query.channel, | ||
169 | + isApp: req.query.app_version || req.query.appVersion || false, | ||
170 | + gender: req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1, | ||
171 | + uid: req.user.uid || 6228593, // TODO | ||
172 | + udid: req.sessionID | ||
173 | + }; | ||
174 | + | ||
175 | + if (param.isApp === false) { | ||
176 | + responseData.pageHeader.navTitle = param.tag; | ||
177 | + } | ||
178 | + | ||
179 | + indexModel.getTagEditor(param).then(result => { | ||
180 | + res.render('index/list', responseData); | ||
181 | + }).catch(next); | ||
182 | +}; | ||
183 | + | ||
147 | module.exports = { | 184 | module.exports = { |
148 | editor, | 185 | editor, |
149 | pageData, | 186 | pageData, |
150 | - index | 187 | + index, |
188 | + tag | ||
151 | }; | 189 | }; |
@@ -168,7 +168,7 @@ const getArticle = (param) => { | @@ -168,7 +168,7 @@ const getArticle = (param) => { | ||
168 | _category(), | 168 | _category(), |
169 | _article(param) | 169 | _article(param) |
170 | ]).then(result => { | 170 | ]).then(result => { |
171 | - | 171 | + console.log(result[1].data); |
172 | let type = param.type; | 172 | let type = param.type; |
173 | 173 | ||
174 | let resu = { | 174 | let resu = { |
@@ -251,7 +251,19 @@ const getArticle = (param) => { | @@ -251,7 +251,19 @@ const getArticle = (param) => { | ||
251 | 251 | ||
252 | } | 252 | } |
253 | 253 | ||
254 | - // console.log(resu); | 254 | + return resu; |
255 | + | ||
256 | + }); | ||
257 | + | ||
258 | +}; | ||
259 | + | ||
260 | +const getTagEditor = (param) => { | ||
261 | + | ||
262 | + return api.all([ | ||
263 | + _article(param) | ||
264 | + ]).then(result => { | ||
265 | + // console.log(result[0].data.list); | ||
266 | + let resu = {}; | ||
255 | 267 | ||
256 | return resu; | 268 | return resu; |
257 | 269 | ||
@@ -263,5 +275,6 @@ module.exports = { | @@ -263,5 +275,6 @@ module.exports = { | ||
263 | getAuthor: _getAuthor, | 275 | getAuthor: _getAuthor, |
264 | getArticleList: _getArticleList, | 276 | getArticleList: _getArticleList, |
265 | getPageData: _getPageData, | 277 | getPageData: _getPageData, |
266 | - getArticle | 278 | + getArticle, |
279 | + getTagEditor | ||
267 | }; | 280 | }; |
@@ -30,6 +30,7 @@ router.post('/star/setFavorite', star.setFavorite); // 收藏文章 | @@ -30,6 +30,7 @@ router.post('/star/setFavorite', star.setFavorite); // 收藏文章 | ||
30 | router.get('/plusstar', plusstar.index); // 潮流优选 | 30 | router.get('/plusstar', plusstar.index); // 潮流优选 |
31 | router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // 潮流优选首页-资源位 | 31 | router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // 潮流优选首页-资源位 |
32 | router.get('/', index.index); // 逛首页 | 32 | router.get('/', index.index); // 逛首页 |
33 | +router.get('/index/tags', index.tag); // 逛标签页 | ||
33 | 34 | ||
34 | router.get('/author/list', index.editor); // 编辑简介 | 35 | router.get('/author/list', index.editor); // 编辑简介 |
35 | 36 |
public/js/guang/index-tag.page.js
0 → 100644
1 | +require('../common'); |
-
Please register or login to post a comment