WeChat Small Program Framework Logic Layer (App Service)
May 18, 2021
WeChat Mini Program Development Document
Table of contents
Logic Layer (App Service)
The logical layer of the small program development framework is written by JavaScript.
The logical layer processes the data and sends it to the view layer, while accepting event feedback from the view layer.
Based
on JavaScript,
we made some changes to make it easy to develop small programs.
-
Add
app
and
Page methods
to register programs and pages.
-
Provides rich
APIs
such as Sweep, Pay and other WeChat capabilities.
-
Each page has a
separate scope and
provides modular capabilities.
-
Because the framework is not running in a browser, JavaScript has some capabilities on the web that are not available, such as document, window, and so on.
-
All code written by the developer will eventually be packaged into a copy of JavaScript and run when the small program starts until the small program is destroyed.
Similar to ServiceWorker, so the logical layer is also called App Service.