...
|
...
|
@@ -16,7 +16,7 @@ const index = (req, res, next) => { |
|
|
// let gender = req.query.brand || 1;
|
|
|
|
|
|
editorialModel.getIndexData(type, pageNum, limit).then((result) => {
|
|
|
console.log();
|
|
|
|
|
|
res.display('index', {
|
|
|
module: 'editorial',
|
|
|
page: 'index',
|
...
|
...
|
@@ -26,7 +26,7 @@ const index = (req, res, next) => { |
|
|
{
|
|
|
link: '/editorial?type=0',
|
|
|
pathTitle: '首页',
|
|
|
name: 'MEN首页'
|
|
|
name: 'MEN首页'
|
|
|
},
|
|
|
{
|
|
|
pathTitle: '资讯',
|
...
|
...
|
@@ -34,7 +34,7 @@ const index = (req, res, next) => { |
|
|
}
|
|
|
],
|
|
|
msgTypes: result.msgTypes,
|
|
|
msg: result.msg.list.artList,
|
|
|
msg: result.msg.tabs,
|
|
|
paginationOpts: {
|
|
|
page: pageNum, // current page: http://host/?page=2
|
|
|
limit: 20, // per_page records' number
|
...
|
...
|
@@ -58,12 +58,13 @@ const index = (req, res, next) => { |
|
|
const list = (req, res) => {
|
|
|
let pageNum = req.query.page || 1;
|
|
|
let limit = req.query.limit || 20;
|
|
|
let tag = req.params.tag || '暗黑';
|
|
|
let authorId = req.params.authorId || 0;
|
|
|
let tag = req.query.query;
|
|
|
let authorId = req.query.authorId;
|
|
|
|
|
|
// let curChannel = getChannelData(req.channel, req.query.query);
|
|
|
|
|
|
editorialModel.getListData(pageNum, limit, tag, authorId).then((result) => {
|
|
|
|
|
|
res.display('list', {
|
|
|
module: 'editorial',
|
|
|
page: 'list',
|
...
|
...
|
@@ -85,8 +86,8 @@ const list = (req, res) => { |
|
|
name: req.query.query
|
|
|
}
|
|
|
],
|
|
|
pathTitle: req.query.query,
|
|
|
msg: result.list.artList,
|
|
|
pathTitle: req.query.query || result.authorName,
|
|
|
msg: result.tabs,
|
|
|
paginationOpts: {
|
|
|
page: pageNum, // current page: http://host/?page=2
|
|
|
limit: 20, // per_page records' number
|
...
|
...
|
@@ -103,7 +104,7 @@ const list = (req, res) => { |
|
|
};
|
|
|
|
|
|
const detail = (req, res, next) => {
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
|
|
|
editorialModel.getDetailData(id).then((result) => {
|
|
|
res.display('detail', {
|
...
|
...
|
@@ -128,7 +129,7 @@ const detail = (req, res, next) => { |
|
|
}
|
|
|
],
|
|
|
header: result.head,
|
|
|
content: result.content,
|
|
|
content: result.content.contents,
|
|
|
tags: result.tags,
|
|
|
userInfo: result.head,
|
|
|
comment: result.comment,
|
...
|
...
|
@@ -137,56 +138,10 @@ const detail = (req, res, next) => { |
|
|
nextChapter: '来来来,让我们好好聊聊',
|
|
|
lastChapter: '除了黑白灰'
|
|
|
},
|
|
|
|
|
|
// content: {
|
|
|
// goods: [
|
|
|
// {
|
|
|
// img: 'http://placehold.it/274x366',
|
|
|
// link: '',
|
|
|
// name: 'Fred Perry Bomber jacket',
|
|
|
// price: '1015.00'
|
|
|
// }
|
|
|
// ]
|
|
|
// },
|
|
|
// relatedGoods: {
|
|
|
// relatedTitle: '推荐搭配',
|
|
|
// goods: [
|
|
|
// {
|
|
|
// img: 'http://placehold.it/274x366',
|
|
|
// link: '',
|
|
|
// name: 'Fred Perry Bomber jacket',
|
|
|
// price: '1015.00'
|
|
|
// }
|
|
|
//
|
|
|
// ]
|
|
|
// }
|
|
|
// },
|
|
|
// brands: [
|
|
|
// {
|
|
|
// url: 'http://placehold.it/274x366',
|
|
|
// thumb: 'wed',
|
|
|
// name: 'Fred Perry'
|
|
|
// },
|
|
|
// {
|
|
|
// url: 'http://placehold.it/274x366',
|
|
|
// thumb: 'wed',
|
|
|
// name: 'Fred Perry'
|
|
|
// },
|
|
|
// {
|
|
|
// url: 'http://placehold.it/274x366',
|
|
|
// thumb: 'wed',
|
|
|
// name: 'Fred Perry'
|
|
|
// },
|
|
|
// {
|
|
|
// url: 'http://placehold.it/274x366',
|
|
|
// thumb: 'wed',
|
|
|
// name: 'Fred Perry'
|
|
|
// }
|
|
|
// ],
|
|
|
share: {
|
|
|
shareImg: 'hjchsk',
|
|
|
shareDesc: 'wjhdfwe',
|
|
|
weixinUrl: 'www.baidu.com'
|
|
|
shareImg: result.content.shareImg,
|
|
|
shareDesc: result.head.title,
|
|
|
weixinUrl: req.originalUrl
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -202,7 +157,7 @@ const detail = (req, res, next) => { |
|
|
|
|
|
let setCollect = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
|
|
|
editorialModel.setCollect(id, uid).then((result) => {
|
|
|
res.json(result);
|
...
|
...
|
@@ -211,7 +166,7 @@ let setCollect = (req, res, next) => { |
|
|
|
|
|
let cancelCollect = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
|
|
|
editorialModel.setCollect(id, uid).then((result) => {
|
|
|
res.json(result);
|
...
|
...
|
@@ -221,7 +176,7 @@ let cancelCollect = (req, res, next) => { |
|
|
// 点赞
|
|
|
let setPraise = (req, res, next) => {
|
|
|
let udid = req.user.uid;
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
|
|
|
editorialModel.setPraise(id, udid).then((result) => {
|
|
|
res.json(result);
|
...
|
...
|
@@ -230,7 +185,7 @@ let setPraise = (req, res, next) => { |
|
|
|
|
|
let cancelPraise = (req, res, next) => {
|
|
|
let udid = req.user.uid;
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
|
|
|
editorialModel.cancelPraise(id, udid).then((result) => {
|
|
|
res.json(result);
|
...
|
...
|
@@ -239,7 +194,7 @@ let cancelPraise = (req, res, next) => { |
|
|
|
|
|
let addComment = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let id = req.params.id || 52571;
|
|
|
let id = req.params.id;
|
|
|
let content = req.body.content;
|
|
|
|
|
|
editorialModel.setCollect(id, uid, content).then((result) => {
|
...
|
...
|
|