怎样定时执行设定的时间任务?

小程序 文章 2021-12-14 11:00 443 0 全屏看文

AI助手支持GPT4.0

怎样定时执行设定的时间任务?How to execute the set time task regularly?

怎样定时执行设定的时间任务?

我在做一个定时器,到了设定的时间,怎样执行设定的时间任务? 如果登陆小程序,也可以自动执行,求代码

I'm making a timer. When the set time comes, how to execute the set time task? If you log in to the applet, it can also be executed automatically to find the code

回答:

困难:

云开发可以设定定时执行某个云函数。https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/triggers.html

登录小程序自动执行,可以在onload中去执行

圣殿骑士:

云开发支持的,小程序端 只能接口判断。

https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/triggers.html

这是云开发的文档

garField:

云开发可以,小程序不在前台没办法一直保持活跃。

-EOF-

AI助手支持GPT4.0