WeChat small program open data official-account
May 18, 2021
WeChat Mini Program Development Document
Table of contents
official-account
The base library 2.3.0 starts to support, and the lower version needs to be
compatible.
The public is concerned about components.
When the user sweeps the small program code to open the small program, the developer can configure the public number attention component within the small program, so that the user can quickly pay attention to the public number, can be nested within the native component.
Tips
-
Before using the component, go to the background of the small program and set the public number to be displayed in Settings-
Note: The public number set must be the same as the subject of the small program.
-
During the life cycle of a small program, the ability to direct attention to the public number component is demonstrated only by entering the small program from the following scenario: when the small program opens from the sweep small program code scene (scene value 1047, scene value 1124) when the small program is opened from the chat top scene (scene value 1089)
When opened in recent use, if the program was not previously destroyed, the component remains in the state it was in the last time it was opened When the program was returned from another small program (scene value 1038), and if the program was not previously destroyed, the component remained in the state it was in the last time the program was opened
-
For developer debugging, the development of the development version of the base library 2.7.3 adds the following scenario to show the public number component: the development version of the small program from the sweep QR code (scene value 1011) open - the experience version of the small program open
-
The component is limited to a minimum width of 300px and a height of 84px.
-
You can only configure one of the components per page.
Attribute name
|
type
|
illustrate
|
bindload
|
EventHandle
|
Trigger when the component is loaded
|
binderror
|
EventHandle
|
Trigger when component loading fails
|
Detail object
Attribute name
|
type
|
illustrate
|
status
|
Number
|
status code
|
errMsg
|
String
|
Error message
|
Status Valid Value
value
|
illustrate
|
-2
|
Network Error
|
-1
|
Data analysis error
|
0
|
Load success
|
1
|
The applet pays attention to the public number function being banned
|
2
|
Associated public number is banned
|
3
|
The association is disaled or the associated public number is not selected
|
4
|
The Pay Attention Public number feature is not turned on
|
5
|
The scene value is wrong
|
6
|
Repeat the creation
|
The sample code
<official-account></official-account>