bigbigeggs
V2EX  ›  问与答

咨询一下小说 app 如微信读书等后端如何分页返回前端

  •  
  •   bigbigeggs · Oct 16, 2023 · 1298 views
    This topic created in 971 days ago, the information mentioned may be changed or developed.

    现在遇到一个问题是,前端的容器多种多样,比如大屏幕小屏幕,app 可以拉伸等等。

    因此就会导致每个页面展示的字数是不同的,那么后端如何分割返回前端。

    后端现在有一个几十万字的小说。每一页应该返回多少,应该怎么返回呢,一直没有想好思路

    4 replies    2023-10-17 07:03:11 +08:00
    zhcode
        1
    zhcode  
       Oct 16, 2023
    按章节返回,微信读书就是
    一个章节分多少页,前端处理
    anjingdexiaocai
        2
    anjingdexiaocai  
       Oct 16, 2023 via Android
    显然多少页是客户端处理的啊
    akira
        3
    akira  
       Oct 16, 2023
    内容提前返回,客户端视为本地阅读器来做
    panlatent
        4
    panlatent  
       Oct 17, 2023 via Android
    肯定得按章节啊(至少一章)

    不然用户翻了两页突然因为网络之类的看不了 那简直灾难级的体验
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   997 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 22:50 · PVG 06:50 · LAX 15:50 · JFK 18:50
    ♥ Do have faith in what you're doing.