diff --git a/src/api/like.js b/src/api/like.js new file mode 100644 index 0000000000000000000000000000000000000000..e611eec90dd06f9d14a33cb936e9ea3e26359c49 --- /dev/null +++ b/src/api/like.js @@ -0,0 +1,34 @@ +import request from '@/util/request' + +// 关注 +export function like(id) { + return request(({ + url: `/post/like`, + method: 'get', + params: { + topic_id: id + } + })) +} + +// 关注 +export function unLike(id) { + return request(({ + url: `/post/unlike`, + method: 'get', + params: { + topic_id: id + } + })) +} + +// 验证是否关注 +export function hasLiked(id) { + return request(({ + url: `/post/hasliked`, + method: 'get', + params: { + topic_id: id + } + })) +} \ No newline at end of file diff --git a/src/api/post.js b/src/api/post.js index 84d46265b769d927b99471dcf744386201f794f0..69e0c7d1ecb06dbe5bfb4a31f7cb28ba8b92a3d4 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -1,13 +1,14 @@ import request from '@/util/request' -export function getList(pageNo, size, tab) { +export function getList(pageNo, size, tab, userid) { return request(({ url: '/post/list', method: 'get', params: { pageNo: pageNo, size: size, - tab: tab + tab: tab, + userid:userid } })) } diff --git a/src/assets/app.css b/src/assets/app.css index 252ef00357497487121859f3d695696c10ec810f..def002df534de85d78125998d8c99dbea02d13f0 100644 --- a/src/assets/app.css +++ b/src/assets/app.css @@ -159,6 +159,36 @@ a:hover { font-size: 14px !important; } +.like{ + color: rgb(64, 158, 255); + background: rgb(205, 228, 255); + height: 30px; + width: 110px; + border-radius: 15px; + border:1px; + } + +.like:hover +{ + color: rgb(255, 255, 255); + background: rgb(64, 158, 255); +} + +.liked{ + color: rgb(255, 255, 255); + background: rgb(64, 158, 255); + height: 30px; + width: 110px; + border-radius: 15px; + border:1px; + } + +.liked:hover +{ + color: rgb(255, 255, 255); + background: rgb(0, 128, 255); +} + .center { width: 100%; height: 100%; diff --git a/src/i18n/lang/en.js b/src/i18n/lang/en.js index f2e5a732c8f8627738c6fc8d64a0c45b15c4db04..b9dc989de2a90a4f743a32970990dbe02d17e4f4 100644 --- a/src/i18n/lang/en.js +++ b/src/i18n/lang/en.js @@ -58,6 +58,8 @@ export default { posting: 'Publish idea', settled: 'Sign up', signIn: 'Sign in', + changeBillboard: 'Change billboard', + changeSentence: 'Change daliy sentence', promotion: 'Promotion', detail: 'Not received related promotion!', sentence: 'Daily sentence' @@ -83,7 +85,8 @@ export default { latest: 'Latest topics', release: 'Released', view: 'Views', - hot: 'Hot Topics' + hot: 'Hot Topics', + star: 'Favourites' }, user: { score: 'Score', @@ -117,7 +120,6 @@ export default { placeholder: 'Add a comment...', submit: 'Submit', success: 'Comment successfully', - empty: 'Comment cannot be empty', failed: 'Cannot comment to this post, {0}' }, common: { diff --git a/src/i18n/lang/zh.js b/src/i18n/lang/zh.js index 4923c5f50cf2846592cb26cadab3ca114eb6e07b..fd218e6ef73c0541bd4a3ad2e2f99cefa79584e9 100644 --- a/src/i18n/lang/zh.js +++ b/src/i18n/lang/zh.js @@ -58,6 +58,8 @@ export default { posting: '发表想法', settled: '马上入驻', signIn: '社区登入', + changeBillboard: '修改公告栏', + changeSentence: '修改每日一句', promotion: '推广', detail: '未收到有关推广!', sentence: '每日一句' @@ -83,7 +85,8 @@ export default { latest: '最新主题', release: '发布于', view: '浏览', - hot: '热门主题' + hot: '热门主题', + star: '收藏夹' }, user: { score: '积分', @@ -117,7 +120,6 @@ export default { placeholder: '此处输入评论...', submit: '提交', success: '评论成功', - empty: '评论不能为空', failed: '无法在此帖发表评论, {0}' }, common: { diff --git a/src/view/post/Author.vue b/src/view/post/Author.vue index 9a57feeaf68fedc3f8b2562213fe98173c69b0d0..77687fe8289422f0d2e36d7e48d48b0535218e85 100644 --- a/src/view/post/Author.vue +++ b/src/view/post/Author.vue @@ -52,6 +52,7 @@ \ No newline at end of file diff --git a/src/view/post/Index.vue b/src/view/post/Index.vue index abb31377a5358c9588b4cc50b322443ee0fa3cff..be7cdfeb22a68d4c892a0244fdac91e724dfb442 100644 --- a/src/view/post/Index.vue +++ b/src/view/post/Index.vue @@ -133,6 +133,71 @@
+ +
+
+
+ +
+
+
+
+

+ + + {{ item.title }} + + +

+
+ +
+
+
+
@@ -151,6 +216,8 @@