...
|
...
|
@@ -35,8 +35,6 @@ const _processListData = (list) => { |
|
|
total: list.total
|
|
|
});
|
|
|
|
|
|
// console.log(list)
|
|
|
|
|
|
_.forEach(list.list.artList, (data) => {
|
|
|
|
|
|
if (data.author) {
|
...
|
...
|
@@ -49,10 +47,11 @@ const _processListData = (list) => { |
|
|
data.publishTime = data.publishTime.replace(/日/g, '');
|
|
|
|
|
|
data.isPraise = data.isPraise === 'Y';
|
|
|
|
|
|
});
|
|
|
listData.tabs = list.list.artList;
|
|
|
|
|
|
// console.log(listData)
|
|
|
|
|
|
return listData;
|
|
|
};
|
|
|
|
...
|
...
|
@@ -65,13 +64,16 @@ const _processListData = (list) => { |
|
|
* @param limit
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const getIndexData = (pageNum, limit, appType) => {
|
|
|
const getIndexData = (pageNum, limit, appType, udid, gender) => {
|
|
|
return serviceAPI.get('guang/api/*/article/getList', {
|
|
|
page: pageNum,
|
|
|
limit: limit,
|
|
|
app_type: appType
|
|
|
app_type: appType,
|
|
|
udid: udid,
|
|
|
gender: gender
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
// console.log(result)
|
|
|
return _processListData(result.data);
|
|
|
} else {
|
|
|
logger.error('Information page list data return code is not 200');
|
...
|
...
|
@@ -88,10 +90,11 @@ const getIndexData = (pageNum, limit, appType) => { |
|
|
* @param authorId
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const getListData = (pageNum, limit, tag, authorId) => {
|
|
|
const getListData = (pageNum, limit, tag, authorId, udid) => {
|
|
|
let param = {
|
|
|
page: pageNum,
|
|
|
limit: limit
|
|
|
limit: limit,
|
|
|
udid: udid
|
|
|
};
|
|
|
|
|
|
if (tag) {
|
...
|
...
|
@@ -188,8 +191,8 @@ const _processHeadData = (list) => { |
|
|
}
|
|
|
});
|
|
|
|
|
|
newData.headData.time = newData.headData.time.replace(/-/g, '/');
|
|
|
newData.headData.time = newData.headData.time.replace(':00', '', 2);
|
|
|
// newData.headData.time = newData.headData.time.replace(/-/g, '/');
|
|
|
// newData.headData.time = newData.headData.time.replace(':00', '', 2);
|
|
|
|
|
|
let id = newData.headData.authorId;
|
|
|
|
...
|
...
|
@@ -341,9 +344,10 @@ const _processContentData = (list) => { |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getHeadData = (id) => {
|
|
|
const _getHeadData = (id, appType) => {
|
|
|
return serviceAPI.get('/guang/api/*/article/getArticleBaseInfo', {
|
|
|
id: id
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return result.data;
|
...
|
...
|
@@ -400,6 +404,10 @@ const _getCommentsData = (id) => { |
|
|
article_id: id
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
_.forEach(result.data.list, function(data) {
|
|
|
data.create_time = data.create_time.replace(/月/g, '/');
|
|
|
data.create_time = data.create_time.replace(/日/g, '');
|
|
|
});
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
|
|
logger.error('Review data return code is not 200');
|
...
|
...
|
@@ -433,12 +441,15 @@ const _getRelateBrand = (id) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const _getArticlePre = (id) => {
|
|
|
const _getArticlePre = (id, appType) => {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticlePre', {
|
|
|
id: id
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
// console.log(result);
|
|
|
// console.log(1)
|
|
|
// let id = result.data.articleIdPre;
|
|
|
// _getHeadData(id, appType);
|
|
|
return result;
|
|
|
} else {
|
|
|
logger.error('上一篇不是200');
|
...
|
...
|
@@ -554,13 +565,13 @@ const shareData = () => { |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const getDetailData = (id) => {
|
|
|
const getDetailData = (id, appType) => {
|
|
|
return co(function *() {
|
|
|
let result = yield Promise.all([_getHeadData(id),
|
|
|
let result = yield Promise.all([_getHeadData(id, appType),
|
|
|
_getArticleData(id),
|
|
|
_getContentData(id),
|
|
|
_getCommentsData(id),
|
|
|
_getArticlePre(id),
|
|
|
_getArticlePre(id, appType),
|
|
|
_getRelateBrand(id)]);
|
|
|
let res = yield _processHeadData([result[0], result[1], result[3]]);
|
|
|
|
...
|
...
|
|