微信小程序分享到朋友圈之后打开,打开的单页应用的生命周期是什么?

小程序 文章 2020-08-31 16:01 528 0 全屏看文

AI助手支持GPT4.0

微信小程序分享到朋友圈之后打开,打开的单页应用的生命周期是什么?What is the life cycle of the opened single-page application after opening the WeChat applet to Moments?

微信小程序分享到朋友圈之后打开,打开的单页应用的生命周期是什么?

如题所述,我需要在onUnLoad的时候调用统计接口,但是在朋友圈打开后,必须点击进入小程序,相关的生命周期才会调用,光是在打开的单页内,生命周期不会调用,怎么解决这个问题呢?

As mentioned in the title, I need to call the statistics interface when onunload is opened. However, after the circle of friends is opened, I must click to enter the applet, and the relevant life cycle will be called. Only in the open single page, the life cycle will not be called. How to solve this problem?

回答:

11月:

建议好好看下文档。

孩子🍑:文档要是有我就不会在这问了,这种话请不要再回答了
默认²⁰²⁰:

onUnLoad是在页面销毁后才会调用的啊

你点击进入小程序之后 单页才会执行onUnLoad啊 没毛病的啊

孩子🍑:是的,在单页中调用确实不符合微信的设计
微喵网络:

没办法解决

孩子🍑:好吧,请问,打开的单页是H5页面吗
微喵网络:特殊的小程序页面

-EOF-

AI助手支持GPT4.0