Authored by 郭成尧

'资讯列表资源码'

... ... @@ -23,7 +23,7 @@ module.exports = {
getNewsList: (req, res, next) => {
let params = {
page: req.body.page,
gender: req.body.gender,
channel: req.body.channel,
uid: req.user.uid
};
... ...
... ... @@ -8,13 +8,25 @@
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
const yhChannel = {
men: {
channel: '1,3'
},
women: {
channel: '2,3'
},
all: {
channel: '1,2,3'
}
};
module.exports = {
/* 资讯列表页数据获取 */
getNewsListData(params) {
return serviceAPI.get('guang/api/v2/article/getList', {
sort_id: '',
gender: params.gender,
gender: yhChannel[params.channel].channel,
uid: params.uid || '0',
page: params.page,
limit: '10'
... ...
... ... @@ -24,13 +24,11 @@ const cate = {
lifestyle: '6f7b590ed3844e680d4052fc5c4d98ad'
};
/* 资讯列表资源位 */
/* TODO 资讯列表资源位 */
const news = {
new: 'd4fdfcad1ec877d466d9780efaf4d296',
sports: 'e1f8dce8cb9de1a0977479c13c4d3dcc',
life: '5c0b9963d8b75e6fd788a2b49402be14',
sneakers: 'c4a62196c30cae5301e419aa3f77747b',
fashion: '70bc6b9d5c96bb7698eab85c7cd5ebbe'
all: 'd4fdfcad1ec877d466d9780efaf4d296',
men: 'e1f8dce8cb9de1a0977479c13c4d3dcc',
women: '5c0b9963d8b75e6fd788a2b49402be14'
};
module.exports = {
... ...
... ... @@ -77,15 +77,14 @@
module.exports = {
data() {
return {
contentCode: contentCode.news[qs.cate || 'new'],
contentCode: contentCode.news[qs.channel || 'all'],
newsList: [],
gender: qs.gender,
page: 0,
scrollDisabled: false
};
},
watch: {
gender() {
channel() {
this.getNewsList();
}
},
... ... @@ -96,9 +95,8 @@
$.post({
url: '/news/list.json',
data: {
sortId: this.crntCateId,
page: this.page++,
gender: this.gender || '1,2,3'
channel: qs.channel || 'all'
}
}).done(result => {
if (result.code === 200) {
... ...