...
|
...
|
@@ -38,7 +38,7 @@ const _category = () => { |
|
|
return serviceAPI.get('/guang/api/v1/category/get', {
|
|
|
|
|
|
}, {
|
|
|
|
|
|
cache: true,
|
|
|
code: 200
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -139,11 +139,12 @@ const _article = (param) => { |
|
|
page: param.page || 1,
|
|
|
uid: param.uid,
|
|
|
udid: param.udid,
|
|
|
sort_id: param.type ? param.type : 1,
|
|
|
sort_id: param.type === 0 ? param.type : 1,
|
|
|
tag: param.tag ? param.tag : null,
|
|
|
author_id: param.authorId ? param.authorId : null,
|
|
|
limit: param.limit ? param.limit : null,
|
|
|
}, {
|
|
|
cache: true,
|
|
|
code: 200
|
|
|
}).then(result => {
|
|
|
|
...
|
...
|
@@ -159,8 +160,8 @@ const _article = (param) => { |
|
|
*/
|
|
|
const getArticle = (param) => {
|
|
|
|
|
|
let page = param.page ? param.page : 1;
|
|
|
|
|
|
let page = param.page ? param.page : 1;
|
|
|
Object.assign(param, { page: page });
|
|
|
|
|
|
return api.all([
|
...
|
...
|
@@ -172,17 +173,16 @@ const getArticle = (param) => { |
|
|
|
|
|
let resu = {
|
|
|
guang: {
|
|
|
swiper: true
|
|
|
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
// 顶部的分类列表
|
|
|
let curIndex = 0;// 当前tab顺序
|
|
|
|
|
|
let indexTmp = 0;
|
|
|
|
|
|
if (result[0] && result[0].data) {
|
|
|
if (result[0] && result[0].data && result[0].data) {
|
|
|
|
|
|
indexTmp = 0;
|
|
|
|
...
|
...
|
@@ -219,7 +219,7 @@ const getArticle = (param) => { |
|
|
|
|
|
}
|
|
|
|
|
|
if (result[1].data.list.adlist) {
|
|
|
if (result[1].data.list.adlist && result[1].data) {
|
|
|
|
|
|
let swp = [];
|
|
|
|
...
|
...
|
@@ -235,11 +235,9 @@ const getArticle = (param) => { |
|
|
|
|
|
resu.guang.swiper = swp;
|
|
|
|
|
|
// console.log(resu);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (result[1].data.list.artList) {
|
|
|
if (result[1].data.list.artList && result[1].data) {
|
|
|
|
|
|
let inf = [];
|
|
|
|
...
|
...
|
@@ -253,76 +251,17 @@ const getArticle = (param) => { |
|
|
|
|
|
}
|
|
|
|
|
|
return resu;
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 逛切换
|
|
|
* @param params
|
|
|
*/
|
|
|
const getArticleGroup = (param) => {
|
|
|
|
|
|
let page = param.page ? param.page : 1;
|
|
|
|
|
|
Object.assign(param, { page: page });
|
|
|
|
|
|
return api.all([
|
|
|
_category(),
|
|
|
_article(param)
|
|
|
]).then(result => {
|
|
|
|
|
|
let type = param.type;
|
|
|
|
|
|
let resu = {
|
|
|
guang: {
|
|
|
|
|
|
}
|
|
|
};
|
|
|
|
|
|
if (result[0] && result[0].data) {
|
|
|
|
|
|
let cateList = result[0].data;
|
|
|
|
|
|
let build = [];
|
|
|
|
|
|
let inf = [];
|
|
|
|
|
|
cateList.forEach(val => {
|
|
|
build.push({
|
|
|
typeId: val.id,
|
|
|
type: val.name,
|
|
|
focus: (val.id == type)
|
|
|
});
|
|
|
|
|
|
inf.push({
|
|
|
show: (val.id == type),
|
|
|
typeId: type,
|
|
|
info: []
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
resu.guang.navs = build;
|
|
|
|
|
|
resu.guang.infos = inf;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
// console.log(resu);
|
|
|
|
|
|
return resu;
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
getAuthor: _getAuthor,
|
|
|
getArticleList: _getArticleList,
|
|
|
getPageData: _getPageData,
|
|
|
getArticle,
|
|
|
getArticleGroup
|
|
|
getArticle
|
|
|
}; |
...
|
...
|
|