# official-account

Start from base library version 2.3.0. Please remaining backward compatible.

Official Account message template Focus on components. When the user sweepsMini Program code When the Mini Program is opened, the developer can configure the Official Account message template Focus on components, convenient user fast attention Official Account message template, Can be nested within native components.

Base library 2.18.1 From, Official Account message template The Attention Component display scenario values have changed as follows:

Mini Program scenario values show concern when they hit the following values Official Account message template Components:

  1. 1011 Scan QR code
  2. 1017 Go to the entry page for the Mini Program experience
  3. 1025 Scan one-dimensional code
  4. 1047 Scan Mini Program code
  5. 1124 Scan "one thing a code" to open the Mini Program

Mini Programs Hot Start Scenario Value When the following values are hit, the cold start scenario value is in [1011, 1017, 1025, 1047, 1124] Official Account message template Components:

  1. 1001 The main entry of the discovery bar Mini Program,Recent uselist
  2. 1038 Back from another Mini Program
  3. 1041 Back to Mini Program from plug-in Mini Program
  4. 1089 WeChat chat main interface pull down,Recent usecolumn
  5. 1090 Long press the top right corner of the Mini Program menu to call out the recent use history
  6. 1104 WeChat chat main interface pull down,My little program.column
  7. 1131 Floating window
  8. 1187 New floating window, WeChat 8.0

# Tips

  1. Before using the component, go to the Mini Program backend and click "Settings" ->“follow Official Account message template " Set the settings to be displayed in Official Account message template.Note: Set Official Account message template Need to be consistent with the Mini Program body.

  2. In the life cycle of a Mini Program, only when entering the Mini Program from the following scenario will there be show-led attention Official Account message template Capabilities of components:

    • When the Mini Program opens from the sweep Mini Program scene (scene value 1047, scene value 1124)
    • When the Mini Program moves from the chat top scene (scene value 1089)Recent useIf the Mini Program has not been destroyed before, the component remains in the state it was last opened
    • When the Mini Program is returned from another Mini Program (scenario 1038), if it has not been destroyed before, the component remains in the state it was last opened
  3. To facilitate developer debugging, the base library 2.7.3 Version from the development version of the Mini Program to add the following scene show Official Account message template Components:

    • Development version Mini Program from scan two-dimensional code (scene value 101) Open Experience version of the Mini Program to open
  4. Components are limited to a minimum width of 300 px and a height of 84 px.

  5. Only one component can be configured per page.

Attribute name type Introductions
bindload EventHandle Triggered when component loads successfully
binderror EventHandle Triggered when component loading fails

# detail object

Attribute name type Introductions
status Number Status code
errMsg String Error message
# status Valid value
value Introductions
-2 Network error
-1 Data resolution error
0 Load success
1 Mini Program concern Official Account message template Features blocked
2 Relation Official Account message template Banned
3 Association Deprecated or Unchecked Association Official Account message template
4 Unopened attention Official Account message template function
5 Scene Value Error
6 Duplicate creation

# sample code

<official-account></official-account>