Authored by zhangxiaoru

editorialpre

... ... @@ -461,24 +461,23 @@ const _getArticlePre = (id, appType) => {
id: id,
app_type: appType
}).then((result) => {
console.log(result.message);
//console.log(result.message);
// result.code = 200;
// result.data = {
// articleIdPre: 34288,
// authorId: 589238
// }
if (result && result.code === 200) {
let perArticle = {};
// let id = result.data.articleIdPre;
return _getHeadData(result.data.articleIdPre, appType).then((list) => {
perArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdPre}.html`;
_getHeadData(result.data.articleIdPre, appType).then((list) => {
console.log(list);
perArticle.lastChapter = list.title;
perArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdPre}.html`;
}).then(() => {
console.log(perArticle);
return perArticle;
});
return perArticle;
} else {
logger.error('In the previous is not 200');
return {};
... ... @@ -496,22 +495,24 @@ const _getArticleNext = (id, appType) => {
id: id,
app_type: appType
}).then((result) => {
console.log(result)
// console.log(result);
// result.code = 200;
// result.data = {
// articleIdNext: 34288,
// authorId: 589238
// }
if (result && result.code === 200) {
let nextArticle = {};
nextArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdNext}.html`;
_getHeadData(result.data.articleIdNext, appType).then((list) => {
return _getHeadData(result.data.articleIdNext, appType).then((list) => {
nextArticle.lastChapter = list.title;
}).then(() => {
nextArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdNext}.html`;
nextArticle.nextChapter = list.title;
return nextArticle;
});
return nextArticle;
})
} else {
logger.error('The next article is not 200');
... ... @@ -644,8 +645,8 @@ const getDetailData = (id, uid, udid, appType) => {
content: result[2],
comment: result[3],
brands: result[6],
nextArticle: result[4],
perArticle: result[5]
nextArticle: result[5],
perArticle: result[4]
};
})();
};
... ...
... ... @@ -156,7 +156,7 @@ const _calcStatusRate = (num, total) => {
*/
const submitChange = (data, uid) => {
return returnsAPI.changeSubmitAsync(data, uid).then(result => {
console.log(result)
console.log(result);
return result;
});
};
... ...
... ... @@ -19,7 +19,9 @@ var $commentList = $commentArea.find('.comments-wrap'),
_alert = dialog.Alert,
tag = $('#tags').find('li').length,
leng = $('.goods').find('.good-info').length / 4,
pag = 0;
pag = 0,
pre = $('.chapter-left').find('a'),
next = $('.chapter-right').find('a');
require('../plugins/share');
require('../common/header');
... ... @@ -231,3 +233,13 @@ $('.left').click(function() {
$goods.animate({left: '+=930px'});
});
console.log($('.chapter-left').find('a').text().length)
if (pre.text().length > 20) {
pre.text(pre.text().substring(0, 19) + '...');
}
if (next.text().length > 20) {
next.text(next.text().substring(0, 19) + '...');
}
... ...
... ... @@ -94,6 +94,8 @@
margin-top: 10px;
white-space: nowrap;
text-overflow: ellipsis;
height: 18px;
line-height: 18px;
}
}
... ...