Authored by lijing

收藏bug

... ... @@ -42,6 +42,7 @@ router.get('/author/index', index.editor); // 编辑简介
router.get('/index/page', index.pageData); // 逛列表页面的资讯分页
router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5里显示点赞)
router.post('/opt/collectArticle', opt.collectArticle); // 资讯文章收藏 (H5里显示收藏)
router.post('/opt/favoriteBrand', opt.favoriteBrand); // 品牌收藏
router.get('/info/index', info.index); // 逛详情页
... ...
... ... @@ -171,6 +171,8 @@ function initInfosEvt($container) {
// 切换收藏状态
$btn.toggleClass('collected');
} else {
tip.show(data.message);
}
},
error: function() {
... ...
... ... @@ -78,9 +78,9 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr
// 收藏
if (isApp) {
result.collect = [];
result.collect = {};
result.collect.isCollected = articleData.isFavor === true;
let originUrl = helpers.urlFormat('/author/index', null, 'guang') + reqQueryString; // 跳转回的链接
let originUrl = helpers.urlFormat('/author/index', null, 'guang'); // 跳转回的链接
let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接
if (!uid) {
... ...