Showing
3 changed files
with
5 additions
and
2 deletions
@@ -42,6 +42,7 @@ router.get('/author/index', index.editor); // 编辑简介 | @@ -42,6 +42,7 @@ router.get('/author/index', index.editor); // 编辑简介 | ||
42 | router.get('/index/page', index.pageData); // 逛列表页面的资讯分页 | 42 | router.get('/index/page', index.pageData); // 逛列表页面的资讯分页 |
43 | 43 | ||
44 | router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5里显示点赞) | 44 | router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5里显示点赞) |
45 | +router.post('/opt/collectArticle', opt.collectArticle); // 资讯文章收藏 (H5里显示收藏) | ||
45 | router.post('/opt/favoriteBrand', opt.favoriteBrand); // 品牌收藏 | 46 | router.post('/opt/favoriteBrand', opt.favoriteBrand); // 品牌收藏 |
46 | 47 | ||
47 | router.get('/info/index', info.index); // 逛详情页 | 48 | router.get('/info/index', info.index); // 逛详情页 |
@@ -171,6 +171,8 @@ function initInfosEvt($container) { | @@ -171,6 +171,8 @@ function initInfosEvt($container) { | ||
171 | 171 | ||
172 | // 切换收藏状态 | 172 | // 切换收藏状态 |
173 | $btn.toggleClass('collected'); | 173 | $btn.toggleClass('collected'); |
174 | + } else { | ||
175 | + tip.show(data.message); | ||
174 | } | 176 | } |
175 | }, | 177 | }, |
176 | error: function() { | 178 | error: function() { |
@@ -78,9 +78,9 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr | @@ -78,9 +78,9 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr | ||
78 | 78 | ||
79 | // 收藏 | 79 | // 收藏 |
80 | if (isApp) { | 80 | if (isApp) { |
81 | - result.collect = []; | 81 | + result.collect = {}; |
82 | result.collect.isCollected = articleData.isFavor === true; | 82 | result.collect.isCollected = articleData.isFavor === true; |
83 | - let originUrl = helpers.urlFormat('/author/index', null, 'guang') + reqQueryString; // 跳转回的链接 | 83 | + let originUrl = helpers.urlFormat('/author/index', null, 'guang'); // 跳转回的链接 |
84 | let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接 | 84 | let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接 |
85 | 85 | ||
86 | if (!uid) { | 86 | if (!uid) { |
-
Please register or login to post a comment