Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 不等待点赞数接口, 先展示数据 #2

Open
boyangwang opened this issue Jun 14, 2021 · 2 comments
Open

feat: 不等待点赞数接口, 先展示数据 #2

boyangwang opened this issue Jun 14, 2021 · 2 comments

Comments

@boyangwang
Copy link
Collaborator

lanting前端的启动流程, 基本只需要三个数据:

  1. archives.json, 包含所有文章
  2. https://lanting.wiki/api/archive/like/read?articleId=-1 包含文章的点赞数, 用于展示点赞数, 和文章排序
  3. https://lanting.wiki/api/archive/search/keyword/read 这个是历史搜索关键词, 类似于 "热搜词" 的概念

在第一个archives.json返回后, 就可以直接展示数据了. 现在是要等 1和2 全都返回才展示
在第一个archives.json返回后, 就默认大家点赞数都是0, 按照ID倒序展示即可. 等2的请求返回之后, 重新渲染改变排序

@ChelesteWang
Copy link
Contributor

懒加载的话,改变渲染顺序是不是不太好啊

@ChelesteWang
Copy link
Contributor

是不是可以考虑从列表顺序下手,比如每一段时间自动刷新一下列表存储顺序,实现热度高的靠前,如果是实时更新数据感觉交互上不是很舒服,比如正在看第十五页的某条信息时,感觉不错点了个赞直接变到第一页,如果变成异步更新的话感觉可能会更好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants