welog
welog copied to clipboard
增加 Like 按钮功能
Like 只有登陆用户可以点. 点击以后记录到 Post 里的一个 Likes [] Array 里面. 每个 Like 需要记录 userId 和时间戳. 如果 Like 过, 再点 Like, 就取消 Like. 也就是从数组中取消. 不会重复记录. UI 可以显示出已经 Like 过这个帖子和没有 Like 过的区别 UI 可以显示 多少个人 Like 了这个帖子. 日后作为排序的依据.
这个功能谁做? 做完这个的人会接着继续做 Comments.
https://github.com/kevingzhang/welog/commit/8c082ce2505bc622179bb5057c73a112c73207cb
我完成了Like按钮的功能了。
Comments稍微复杂一点因为需要提供一个comments的template了吧。
comments 的 tepmlate 完全可以使用 autoform 自动生成. 自己定义好 comments 的 schedma 即可.