enginex

app 用户打卡签到信息如何保存?

  •  
  •   enginex · Sep 20, 2017 · 3757 views
    This topic created in 3189 days ago, the information mentioned may be changed or developed.

    前端新手,如下图,想模拟实现类似移动 app 中这样的每日签到功能

    Imgur

    目前初步思路是:

    1.calendar 用 table 实现(每个日期对应一个 td)

    2.用户第一次点击签到 button,获取当前 Date 值,query 到包含相同数字的那个 td,给 td add 一个 class (打勾或改色,表示签到)

    3.同时将 Date 值 push 进一个 array,array 以 json 格式保存到本地

    4.然后禁用签到 button

    5.当用户再次点开签到页时,先解析本地 array 中的 Date 序列,将对应 td 都 add class(表示已签到的日期)

    6.然后根据当前 Date 值,比对本地 array 中是否有此值,没有则启用签到 button,有则依旧禁用

    问题

    1.上述思路是否有什么问题?

    2.用户签到信息一般是如何保存的?感觉移动 app 是保存在 server 端?

    3.因为我 calendar 后续可能还要实现前后翻月,感觉更复杂,有没有简洁的方案?

    感谢

    1 replies    2017-09-20 09:44:26 +08:00
    coo
        1
    coo  
       Sep 20, 2017   ❤️ 1
    1. 有问题,数据应当保存在服务器端
    2. 同上
    3. 签到信息存储到数据库,通过 SQL 切割时间获取数据
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2794 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:17 · PVG 14:17 · LAX 23:17 · JFK 02:17
    ♥ Do have faith in what you're doing.